google-cloud-ai_platform-v1 1.51.0 → 1.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +4 -4
- data/README.md +4 -4
- data/lib/google/cloud/ai_platform/v1/agent_anomaly_detection_service/client.rb +1972 -0
- data/lib/google/cloud/ai_platform/v1/agent_anomaly_detection_service/credentials.rb +47 -0
- data/lib/google/cloud/ai_platform/v1/agent_anomaly_detection_service/operations.rb +851 -0
- data/lib/google/cloud/ai_platform/v1/agent_anomaly_detection_service/paths.rb +132 -0
- data/lib/google/cloud/ai_platform/v1/agent_anomaly_detection_service/rest/client.rb +1840 -0
- data/lib/google/cloud/ai_platform/v1/agent_anomaly_detection_service/rest/operations.rb +4481 -0
- data/lib/google/cloud/ai_platform/v1/agent_anomaly_detection_service/rest/service_stub.rb +939 -0
- data/lib/google/cloud/ai_platform/v1/agent_anomaly_detection_service/rest.rb +54 -0
- data/lib/google/cloud/ai_platform/v1/agent_anomaly_detection_service.rb +56 -0
- data/lib/google/cloud/ai_platform/v1/bindings_override.rb +1 -1
- data/lib/google/cloud/ai_platform/v1/rest.rb +2 -1
- data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
- data/lib/google/cloud/ai_platform/v1.rb +3 -2
- data/lib/google/cloud/aiplatform/v1/agent_anomaly_detection_service_pb.rb +73 -0
- data/lib/google/cloud/aiplatform/v1/agent_anomaly_detection_service_services_pb.rb +86 -0
- data/proto_docs/google/cloud/aiplatform/v1/agent_anomaly_detection_service.rb +1009 -0
- data/proto_docs/google/cloud/aiplatform/v1/reasoning_engine.rb +63 -8
- metadata +13 -1
|
@@ -0,0 +1,1972 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Copyright 2026 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/cloud/aiplatform/v1/agent_anomaly_detection_service_pb"
|
|
21
|
+
require "google/cloud/location"
|
|
22
|
+
require "google/iam/v1"
|
|
23
|
+
|
|
24
|
+
module Google
|
|
25
|
+
module Cloud
|
|
26
|
+
module AIPlatform
|
|
27
|
+
module V1
|
|
28
|
+
module AgentAnomalyDetectionService
|
|
29
|
+
##
|
|
30
|
+
# Client for the AgentAnomalyDetectionService service.
|
|
31
|
+
#
|
|
32
|
+
# A service for managing Agent Anomaly Detection for monitored agents.
|
|
33
|
+
#
|
|
34
|
+
class Client
|
|
35
|
+
# @private
|
|
36
|
+
API_VERSION = ""
|
|
37
|
+
|
|
38
|
+
# @private
|
|
39
|
+
DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
|
|
40
|
+
|
|
41
|
+
include Paths
|
|
42
|
+
|
|
43
|
+
# @private
|
|
44
|
+
attr_reader :agent_anomaly_detection_service_stub
|
|
45
|
+
|
|
46
|
+
##
|
|
47
|
+
# Configure the AgentAnomalyDetectionService Client class.
|
|
48
|
+
#
|
|
49
|
+
# See {::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client::Configuration}
|
|
50
|
+
# for a description of the configuration fields.
|
|
51
|
+
#
|
|
52
|
+
# @example
|
|
53
|
+
#
|
|
54
|
+
# # Modify the configuration for all AgentAnomalyDetectionService clients
|
|
55
|
+
# ::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::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", "AIPlatform", "V1"]
|
|
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
|
|
76
|
+
end
|
|
77
|
+
yield @configure if block_given?
|
|
78
|
+
@configure
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
##
|
|
82
|
+
# Configure the AgentAnomalyDetectionService Client instance.
|
|
83
|
+
#
|
|
84
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
|
85
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
|
86
|
+
# should be made on {Client.configure}.
|
|
87
|
+
#
|
|
88
|
+
# See {::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client::Configuration}
|
|
89
|
+
# for a description of the configuration fields.
|
|
90
|
+
#
|
|
91
|
+
# @yield [config] Configure the Client client.
|
|
92
|
+
# @yieldparam config [Client::Configuration]
|
|
93
|
+
#
|
|
94
|
+
# @return [Client::Configuration]
|
|
95
|
+
#
|
|
96
|
+
def configure
|
|
97
|
+
yield @config if block_given?
|
|
98
|
+
@config
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
##
|
|
102
|
+
# The effective universe domain
|
|
103
|
+
#
|
|
104
|
+
# @return [String]
|
|
105
|
+
#
|
|
106
|
+
def universe_domain
|
|
107
|
+
@agent_anomaly_detection_service_stub.universe_domain
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
##
|
|
111
|
+
# Create a new AgentAnomalyDetectionService client object.
|
|
112
|
+
#
|
|
113
|
+
# @example
|
|
114
|
+
#
|
|
115
|
+
# # Create a client using the default configuration
|
|
116
|
+
# client = ::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
117
|
+
#
|
|
118
|
+
# # Create a client using a custom configuration
|
|
119
|
+
# client = ::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new do |config|
|
|
120
|
+
# config.timeout = 10.0
|
|
121
|
+
# end
|
|
122
|
+
#
|
|
123
|
+
# @yield [config] Configure the AgentAnomalyDetectionService client.
|
|
124
|
+
# @yieldparam config [Client::Configuration]
|
|
125
|
+
#
|
|
126
|
+
def initialize
|
|
127
|
+
# These require statements are intentionally placed here to initialize
|
|
128
|
+
# the gRPC module only when it's required.
|
|
129
|
+
# See https://github.com/googleapis/toolkit/issues/446
|
|
130
|
+
require "gapic/grpc"
|
|
131
|
+
require "google/cloud/aiplatform/v1/agent_anomaly_detection_service_services_pb"
|
|
132
|
+
|
|
133
|
+
# Create the configuration object
|
|
134
|
+
@config = Configuration.new Client.configure
|
|
135
|
+
|
|
136
|
+
# Yield the configuration if needed
|
|
137
|
+
yield @config if block_given?
|
|
138
|
+
|
|
139
|
+
# Create credentials
|
|
140
|
+
credentials = @config.credentials
|
|
141
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
|
142
|
+
# but only if the default endpoint does not have a region prefix.
|
|
143
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
|
144
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
|
145
|
+
!@config.endpoint.split(".").first.include?("-"))
|
|
146
|
+
credentials ||= Credentials.default scope: @config.scope,
|
|
147
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
|
148
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
|
149
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
|
150
|
+
end
|
|
151
|
+
@quota_project_id = @config.quota_project
|
|
152
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
|
153
|
+
|
|
154
|
+
@operations_client = Operations.new do |config|
|
|
155
|
+
config.credentials = credentials
|
|
156
|
+
config.quota_project = @quota_project_id
|
|
157
|
+
config.endpoint = @config.endpoint
|
|
158
|
+
config.universe_domain = @config.universe_domain
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
@agent_anomaly_detection_service_stub = ::Gapic::ServiceStub.new(
|
|
162
|
+
::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Stub,
|
|
163
|
+
credentials: credentials,
|
|
164
|
+
endpoint: @config.endpoint,
|
|
165
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
|
166
|
+
universe_domain: @config.universe_domain,
|
|
167
|
+
channel_args: @config.channel_args,
|
|
168
|
+
interceptors: @config.interceptors,
|
|
169
|
+
channel_pool_config: @config.channel_pool,
|
|
170
|
+
logger: @config.logger
|
|
171
|
+
)
|
|
172
|
+
|
|
173
|
+
@agent_anomaly_detection_service_stub.stub_logger&.info do |entry|
|
|
174
|
+
entry.set_system_name
|
|
175
|
+
entry.set_service
|
|
176
|
+
entry.message = "Created client for #{entry.service}"
|
|
177
|
+
entry.set_credentials_fields credentials
|
|
178
|
+
entry.set "customEndpoint", @config.endpoint if @config.endpoint
|
|
179
|
+
entry.set "defaultTimeout", @config.timeout if @config.timeout
|
|
180
|
+
entry.set "quotaProject", @quota_project_id if @quota_project_id
|
|
181
|
+
end
|
|
182
|
+
|
|
183
|
+
@location_client = Google::Cloud::Location::Locations::Client.new do |config|
|
|
184
|
+
config.credentials = credentials
|
|
185
|
+
config.quota_project = @quota_project_id
|
|
186
|
+
config.endpoint = @agent_anomaly_detection_service_stub.endpoint
|
|
187
|
+
config.universe_domain = @agent_anomaly_detection_service_stub.universe_domain
|
|
188
|
+
config.logger = @agent_anomaly_detection_service_stub.logger if config.respond_to? :logger=
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Client.new do |config|
|
|
192
|
+
config.credentials = credentials
|
|
193
|
+
config.quota_project = @quota_project_id
|
|
194
|
+
config.endpoint = @agent_anomaly_detection_service_stub.endpoint
|
|
195
|
+
config.universe_domain = @agent_anomaly_detection_service_stub.universe_domain
|
|
196
|
+
config.logger = @agent_anomaly_detection_service_stub.logger if config.respond_to? :logger=
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
##
|
|
201
|
+
# Get the associated client for long-running operations.
|
|
202
|
+
#
|
|
203
|
+
# @return [::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Operations]
|
|
204
|
+
#
|
|
205
|
+
attr_reader :operations_client
|
|
206
|
+
|
|
207
|
+
##
|
|
208
|
+
# Get the associated client for mix-in of the Locations.
|
|
209
|
+
#
|
|
210
|
+
# @return [Google::Cloud::Location::Locations::Client]
|
|
211
|
+
#
|
|
212
|
+
attr_reader :location_client
|
|
213
|
+
|
|
214
|
+
##
|
|
215
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
|
216
|
+
#
|
|
217
|
+
# @return [Google::Iam::V1::IAMPolicy::Client]
|
|
218
|
+
#
|
|
219
|
+
attr_reader :iam_policy_client
|
|
220
|
+
|
|
221
|
+
##
|
|
222
|
+
# The logger used for request/response debug logging.
|
|
223
|
+
#
|
|
224
|
+
# @return [Logger]
|
|
225
|
+
#
|
|
226
|
+
def logger
|
|
227
|
+
@agent_anomaly_detection_service_stub.logger
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Service calls
|
|
231
|
+
|
|
232
|
+
##
|
|
233
|
+
# Gets the details of a specific AgentAnomalyDetectionScope.
|
|
234
|
+
#
|
|
235
|
+
# @overload get_agent_anomaly_detection_scope(request, options = nil)
|
|
236
|
+
# Pass arguments to `get_agent_anomaly_detection_scope` via a request object, either of type
|
|
237
|
+
# {::Google::Cloud::AIPlatform::V1::GetAgentAnomalyDetectionScopeRequest} or an equivalent Hash.
|
|
238
|
+
#
|
|
239
|
+
# @param request [::Google::Cloud::AIPlatform::V1::GetAgentAnomalyDetectionScopeRequest, ::Hash]
|
|
240
|
+
# A request object representing the call parameters. Required. To specify no
|
|
241
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
242
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
243
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
244
|
+
#
|
|
245
|
+
# @overload get_agent_anomaly_detection_scope(name: nil)
|
|
246
|
+
# Pass arguments to `get_agent_anomaly_detection_scope` via keyword arguments. Note that at
|
|
247
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
248
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
249
|
+
#
|
|
250
|
+
# @param name [::String]
|
|
251
|
+
# Required. The name of the AgentAnomalyDetectionScope resource.
|
|
252
|
+
# Format:
|
|
253
|
+
# `projects/{project}/locations/{location}/agentAnomalyDetectionScopes/{agent_anomaly_detection_scope}`
|
|
254
|
+
#
|
|
255
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
256
|
+
# @yieldparam response [::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionScope]
|
|
257
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
258
|
+
#
|
|
259
|
+
# @return [::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionScope]
|
|
260
|
+
#
|
|
261
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
262
|
+
#
|
|
263
|
+
# @example Basic example
|
|
264
|
+
# require "google/cloud/ai_platform/v1"
|
|
265
|
+
#
|
|
266
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
267
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
268
|
+
#
|
|
269
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
270
|
+
# request = Google::Cloud::AIPlatform::V1::GetAgentAnomalyDetectionScopeRequest.new
|
|
271
|
+
#
|
|
272
|
+
# # Call the get_agent_anomaly_detection_scope method.
|
|
273
|
+
# result = client.get_agent_anomaly_detection_scope request
|
|
274
|
+
#
|
|
275
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionScope.
|
|
276
|
+
# p result
|
|
277
|
+
#
|
|
278
|
+
def get_agent_anomaly_detection_scope request, options = nil
|
|
279
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
280
|
+
|
|
281
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetAgentAnomalyDetectionScopeRequest
|
|
282
|
+
|
|
283
|
+
# Converts hash and nil to an options object
|
|
284
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
285
|
+
|
|
286
|
+
# Customize the options with defaults
|
|
287
|
+
metadata = @config.rpcs.get_agent_anomaly_detection_scope.metadata.to_h
|
|
288
|
+
|
|
289
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
290
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
291
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
292
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
293
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
294
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
295
|
+
|
|
296
|
+
header_params = {}
|
|
297
|
+
if request.name
|
|
298
|
+
header_params["name"] = request.name
|
|
299
|
+
end
|
|
300
|
+
|
|
301
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
302
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
303
|
+
|
|
304
|
+
options.apply_defaults timeout: @config.rpcs.get_agent_anomaly_detection_scope.timeout,
|
|
305
|
+
metadata: metadata,
|
|
306
|
+
retry_policy: @config.rpcs.get_agent_anomaly_detection_scope.retry_policy
|
|
307
|
+
|
|
308
|
+
options.apply_defaults timeout: @config.timeout,
|
|
309
|
+
metadata: @config.metadata,
|
|
310
|
+
retry_policy: @config.retry_policy
|
|
311
|
+
|
|
312
|
+
@agent_anomaly_detection_service_stub.call_rpc :get_agent_anomaly_detection_scope, request, options: options do |response, operation|
|
|
313
|
+
yield response, operation if block_given?
|
|
314
|
+
end
|
|
315
|
+
rescue ::GRPC::BadStatus => e
|
|
316
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
##
|
|
320
|
+
# Gets the details of a specific MonitoredAgent.
|
|
321
|
+
#
|
|
322
|
+
# @overload get_monitored_agent(request, options = nil)
|
|
323
|
+
# Pass arguments to `get_monitored_agent` via a request object, either of type
|
|
324
|
+
# {::Google::Cloud::AIPlatform::V1::GetMonitoredAgentRequest} or an equivalent Hash.
|
|
325
|
+
#
|
|
326
|
+
# @param request [::Google::Cloud::AIPlatform::V1::GetMonitoredAgentRequest, ::Hash]
|
|
327
|
+
# A request object representing the call parameters. Required. To specify no
|
|
328
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
329
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
330
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
331
|
+
#
|
|
332
|
+
# @overload get_monitored_agent(name: nil)
|
|
333
|
+
# Pass arguments to `get_monitored_agent` via keyword arguments. Note that at
|
|
334
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
335
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
336
|
+
#
|
|
337
|
+
# @param name [::String]
|
|
338
|
+
# Required. The name of the MonitoredAgent resource.
|
|
339
|
+
# Format:
|
|
340
|
+
# `projects/{project}/locations/{location}/monitoredAgents/{monitored_agent}`
|
|
341
|
+
#
|
|
342
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
343
|
+
# @yieldparam response [::Google::Cloud::AIPlatform::V1::MonitoredAgent]
|
|
344
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
345
|
+
#
|
|
346
|
+
# @return [::Google::Cloud::AIPlatform::V1::MonitoredAgent]
|
|
347
|
+
#
|
|
348
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
349
|
+
#
|
|
350
|
+
# @example Basic example
|
|
351
|
+
# require "google/cloud/ai_platform/v1"
|
|
352
|
+
#
|
|
353
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
354
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
355
|
+
#
|
|
356
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
357
|
+
# request = Google::Cloud::AIPlatform::V1::GetMonitoredAgentRequest.new
|
|
358
|
+
#
|
|
359
|
+
# # Call the get_monitored_agent method.
|
|
360
|
+
# result = client.get_monitored_agent request
|
|
361
|
+
#
|
|
362
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::MonitoredAgent.
|
|
363
|
+
# p result
|
|
364
|
+
#
|
|
365
|
+
def get_monitored_agent request, options = nil
|
|
366
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
367
|
+
|
|
368
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetMonitoredAgentRequest
|
|
369
|
+
|
|
370
|
+
# Converts hash and nil to an options object
|
|
371
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
372
|
+
|
|
373
|
+
# Customize the options with defaults
|
|
374
|
+
metadata = @config.rpcs.get_monitored_agent.metadata.to_h
|
|
375
|
+
|
|
376
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
377
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
378
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
379
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
380
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
381
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
382
|
+
|
|
383
|
+
header_params = {}
|
|
384
|
+
if request.name
|
|
385
|
+
header_params["name"] = request.name
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
389
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
390
|
+
|
|
391
|
+
options.apply_defaults timeout: @config.rpcs.get_monitored_agent.timeout,
|
|
392
|
+
metadata: metadata,
|
|
393
|
+
retry_policy: @config.rpcs.get_monitored_agent.retry_policy
|
|
394
|
+
|
|
395
|
+
options.apply_defaults timeout: @config.timeout,
|
|
396
|
+
metadata: @config.metadata,
|
|
397
|
+
retry_policy: @config.retry_policy
|
|
398
|
+
|
|
399
|
+
@agent_anomaly_detection_service_stub.call_rpc :get_monitored_agent, request, options: options do |response, operation|
|
|
400
|
+
yield response, operation if block_given?
|
|
401
|
+
end
|
|
402
|
+
rescue ::GRPC::BadStatus => e
|
|
403
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
##
|
|
407
|
+
# Lists MonitoredAgents in a specific Location.
|
|
408
|
+
#
|
|
409
|
+
# @overload list_monitored_agents(request, options = nil)
|
|
410
|
+
# Pass arguments to `list_monitored_agents` via a request object, either of type
|
|
411
|
+
# {::Google::Cloud::AIPlatform::V1::ListMonitoredAgentsRequest} or an equivalent Hash.
|
|
412
|
+
#
|
|
413
|
+
# @param request [::Google::Cloud::AIPlatform::V1::ListMonitoredAgentsRequest, ::Hash]
|
|
414
|
+
# A request object representing the call parameters. Required. To specify no
|
|
415
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
416
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
417
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
418
|
+
#
|
|
419
|
+
# @overload list_monitored_agents(parent: nil, page_size: nil, page_token: nil, filter: nil)
|
|
420
|
+
# Pass arguments to `list_monitored_agents` via keyword arguments. Note that at
|
|
421
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
422
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
423
|
+
#
|
|
424
|
+
# @param parent [::String]
|
|
425
|
+
# Required. The resource name of the Location to list the
|
|
426
|
+
# MonitoredAgents from. Format:
|
|
427
|
+
# `projects/{project}/locations/{location}`
|
|
428
|
+
# @param page_size [::Integer]
|
|
429
|
+
# Optional. The standard list page size. The maximum value is 100; values
|
|
430
|
+
# above 100 will be coerced to 100. If unspecified, at most 10
|
|
431
|
+
# MonitoredAgents will be returned.
|
|
432
|
+
# @param page_token [::String]
|
|
433
|
+
# Optional. The standard list page token.
|
|
434
|
+
# @param filter [::String]
|
|
435
|
+
# Optional. An AIP-160 filter, currently restricted to a single equality
|
|
436
|
+
# predicate on `state`. The value must be the exact, case-sensitive name of a
|
|
437
|
+
# `MonitoredAgent.EnablementState` value: `ACTIVE`, `DISABLED`, `ENABLING`,
|
|
438
|
+
# or `ENABLEMENT_STATE_UNSPECIFIED`. A blank or absent filter returns every
|
|
439
|
+
# MonitoredAgent in the parent regardless of state; any other value returns
|
|
440
|
+
# `INVALID_ARGUMENT`.
|
|
441
|
+
#
|
|
442
|
+
# Example:
|
|
443
|
+
#
|
|
444
|
+
# ```
|
|
445
|
+
# state = ACTIVE
|
|
446
|
+
# ```
|
|
447
|
+
#
|
|
448
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
449
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MonitoredAgent>]
|
|
450
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
451
|
+
#
|
|
452
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::MonitoredAgent>]
|
|
453
|
+
#
|
|
454
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
455
|
+
#
|
|
456
|
+
# @example Basic example
|
|
457
|
+
# require "google/cloud/ai_platform/v1"
|
|
458
|
+
#
|
|
459
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
460
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
461
|
+
#
|
|
462
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
463
|
+
# request = Google::Cloud::AIPlatform::V1::ListMonitoredAgentsRequest.new
|
|
464
|
+
#
|
|
465
|
+
# # Call the list_monitored_agents method.
|
|
466
|
+
# result = client.list_monitored_agents request
|
|
467
|
+
#
|
|
468
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
469
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
470
|
+
# result.each do |item|
|
|
471
|
+
# # Each element is of type ::Google::Cloud::AIPlatform::V1::MonitoredAgent.
|
|
472
|
+
# p item
|
|
473
|
+
# end
|
|
474
|
+
#
|
|
475
|
+
def list_monitored_agents request, options = nil
|
|
476
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
477
|
+
|
|
478
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListMonitoredAgentsRequest
|
|
479
|
+
|
|
480
|
+
# Converts hash and nil to an options object
|
|
481
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
482
|
+
|
|
483
|
+
# Customize the options with defaults
|
|
484
|
+
metadata = @config.rpcs.list_monitored_agents.metadata.to_h
|
|
485
|
+
|
|
486
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
487
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
488
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
489
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
490
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
491
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
492
|
+
|
|
493
|
+
header_params = {}
|
|
494
|
+
if request.parent
|
|
495
|
+
header_params["parent"] = request.parent
|
|
496
|
+
end
|
|
497
|
+
|
|
498
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
499
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
500
|
+
|
|
501
|
+
options.apply_defaults timeout: @config.rpcs.list_monitored_agents.timeout,
|
|
502
|
+
metadata: metadata,
|
|
503
|
+
retry_policy: @config.rpcs.list_monitored_agents.retry_policy
|
|
504
|
+
|
|
505
|
+
options.apply_defaults timeout: @config.timeout,
|
|
506
|
+
metadata: @config.metadata,
|
|
507
|
+
retry_policy: @config.retry_policy
|
|
508
|
+
|
|
509
|
+
@agent_anomaly_detection_service_stub.call_rpc :list_monitored_agents, request, options: options do |response, operation|
|
|
510
|
+
response = ::Gapic::PagedEnumerable.new @agent_anomaly_detection_service_stub, :list_monitored_agents, request, response, operation, options
|
|
511
|
+
yield response, operation if block_given?
|
|
512
|
+
throw :response, response
|
|
513
|
+
end
|
|
514
|
+
rescue ::GRPC::BadStatus => e
|
|
515
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
516
|
+
end
|
|
517
|
+
|
|
518
|
+
##
|
|
519
|
+
# Enables a specific MonitoredAgent.
|
|
520
|
+
#
|
|
521
|
+
# @overload enable_monitored_agent(request, options = nil)
|
|
522
|
+
# Pass arguments to `enable_monitored_agent` via a request object, either of type
|
|
523
|
+
# {::Google::Cloud::AIPlatform::V1::EnableMonitoredAgentRequest} or an equivalent Hash.
|
|
524
|
+
#
|
|
525
|
+
# @param request [::Google::Cloud::AIPlatform::V1::EnableMonitoredAgentRequest, ::Hash]
|
|
526
|
+
# A request object representing the call parameters. Required. To specify no
|
|
527
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
528
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
529
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
530
|
+
#
|
|
531
|
+
# @overload enable_monitored_agent(name: nil)
|
|
532
|
+
# Pass arguments to `enable_monitored_agent` via keyword arguments. Note that at
|
|
533
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
534
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
535
|
+
#
|
|
536
|
+
# @param name [::String]
|
|
537
|
+
# Required. The name of the MonitoredAgent resource to be enabled.
|
|
538
|
+
# Format:
|
|
539
|
+
# `projects/{project}/locations/{location}/monitoredAgents/{monitored_agent}`
|
|
540
|
+
#
|
|
541
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
542
|
+
# @yieldparam response [::Gapic::Operation]
|
|
543
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
544
|
+
#
|
|
545
|
+
# @return [::Gapic::Operation]
|
|
546
|
+
#
|
|
547
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
548
|
+
#
|
|
549
|
+
# @example Basic example
|
|
550
|
+
# require "google/cloud/ai_platform/v1"
|
|
551
|
+
#
|
|
552
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
553
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
554
|
+
#
|
|
555
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
556
|
+
# request = Google::Cloud::AIPlatform::V1::EnableMonitoredAgentRequest.new
|
|
557
|
+
#
|
|
558
|
+
# # Call the enable_monitored_agent method.
|
|
559
|
+
# result = client.enable_monitored_agent request
|
|
560
|
+
#
|
|
561
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
562
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
563
|
+
# # Here is how to wait for a response.
|
|
564
|
+
# result.wait_until_done! timeout: 60
|
|
565
|
+
# if result.response?
|
|
566
|
+
# p result.response
|
|
567
|
+
# else
|
|
568
|
+
# puts "No response received."
|
|
569
|
+
# end
|
|
570
|
+
#
|
|
571
|
+
def enable_monitored_agent request, options = nil
|
|
572
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
573
|
+
|
|
574
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::EnableMonitoredAgentRequest
|
|
575
|
+
|
|
576
|
+
# Converts hash and nil to an options object
|
|
577
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
578
|
+
|
|
579
|
+
# Customize the options with defaults
|
|
580
|
+
metadata = @config.rpcs.enable_monitored_agent.metadata.to_h
|
|
581
|
+
|
|
582
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
583
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
584
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
585
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
586
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
587
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
588
|
+
|
|
589
|
+
header_params = {}
|
|
590
|
+
if request.name
|
|
591
|
+
header_params["name"] = request.name
|
|
592
|
+
end
|
|
593
|
+
|
|
594
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
595
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
596
|
+
|
|
597
|
+
options.apply_defaults timeout: @config.rpcs.enable_monitored_agent.timeout,
|
|
598
|
+
metadata: metadata,
|
|
599
|
+
retry_policy: @config.rpcs.enable_monitored_agent.retry_policy
|
|
600
|
+
|
|
601
|
+
options.apply_defaults timeout: @config.timeout,
|
|
602
|
+
metadata: @config.metadata,
|
|
603
|
+
retry_policy: @config.retry_policy
|
|
604
|
+
|
|
605
|
+
@agent_anomaly_detection_service_stub.call_rpc :enable_monitored_agent, request, options: options do |response, operation|
|
|
606
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
607
|
+
yield response, operation if block_given?
|
|
608
|
+
throw :response, response
|
|
609
|
+
end
|
|
610
|
+
rescue ::GRPC::BadStatus => e
|
|
611
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
612
|
+
end
|
|
613
|
+
|
|
614
|
+
##
|
|
615
|
+
# Disables a specific MonitoredAgent.
|
|
616
|
+
#
|
|
617
|
+
# @overload disable_monitored_agent(request, options = nil)
|
|
618
|
+
# Pass arguments to `disable_monitored_agent` via a request object, either of type
|
|
619
|
+
# {::Google::Cloud::AIPlatform::V1::DisableMonitoredAgentRequest} or an equivalent Hash.
|
|
620
|
+
#
|
|
621
|
+
# @param request [::Google::Cloud::AIPlatform::V1::DisableMonitoredAgentRequest, ::Hash]
|
|
622
|
+
# A request object representing the call parameters. Required. To specify no
|
|
623
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
624
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
625
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
626
|
+
#
|
|
627
|
+
# @overload disable_monitored_agent(name: nil)
|
|
628
|
+
# Pass arguments to `disable_monitored_agent` via keyword arguments. Note that at
|
|
629
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
630
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
631
|
+
#
|
|
632
|
+
# @param name [::String]
|
|
633
|
+
# Required. The name of the MonitoredAgent resource to be disabled.
|
|
634
|
+
# Format:
|
|
635
|
+
# `projects/{project}/locations/{location}/monitoredAgents/{monitored_agent}`
|
|
636
|
+
#
|
|
637
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
638
|
+
# @yieldparam response [::Gapic::Operation]
|
|
639
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
640
|
+
#
|
|
641
|
+
# @return [::Gapic::Operation]
|
|
642
|
+
#
|
|
643
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
644
|
+
#
|
|
645
|
+
# @example Basic example
|
|
646
|
+
# require "google/cloud/ai_platform/v1"
|
|
647
|
+
#
|
|
648
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
649
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
650
|
+
#
|
|
651
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
652
|
+
# request = Google::Cloud::AIPlatform::V1::DisableMonitoredAgentRequest.new
|
|
653
|
+
#
|
|
654
|
+
# # Call the disable_monitored_agent method.
|
|
655
|
+
# result = client.disable_monitored_agent request
|
|
656
|
+
#
|
|
657
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
658
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
659
|
+
# # Here is how to wait for a response.
|
|
660
|
+
# result.wait_until_done! timeout: 60
|
|
661
|
+
# if result.response?
|
|
662
|
+
# p result.response
|
|
663
|
+
# else
|
|
664
|
+
# puts "No response received."
|
|
665
|
+
# end
|
|
666
|
+
#
|
|
667
|
+
def disable_monitored_agent request, options = nil
|
|
668
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
669
|
+
|
|
670
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DisableMonitoredAgentRequest
|
|
671
|
+
|
|
672
|
+
# Converts hash and nil to an options object
|
|
673
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
674
|
+
|
|
675
|
+
# Customize the options with defaults
|
|
676
|
+
metadata = @config.rpcs.disable_monitored_agent.metadata.to_h
|
|
677
|
+
|
|
678
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
679
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
680
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
681
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
682
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
683
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
684
|
+
|
|
685
|
+
header_params = {}
|
|
686
|
+
if request.name
|
|
687
|
+
header_params["name"] = request.name
|
|
688
|
+
end
|
|
689
|
+
|
|
690
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
691
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
692
|
+
|
|
693
|
+
options.apply_defaults timeout: @config.rpcs.disable_monitored_agent.timeout,
|
|
694
|
+
metadata: metadata,
|
|
695
|
+
retry_policy: @config.rpcs.disable_monitored_agent.retry_policy
|
|
696
|
+
|
|
697
|
+
options.apply_defaults timeout: @config.timeout,
|
|
698
|
+
metadata: @config.metadata,
|
|
699
|
+
retry_policy: @config.retry_policy
|
|
700
|
+
|
|
701
|
+
@agent_anomaly_detection_service_stub.call_rpc :disable_monitored_agent, request, options: options do |response, operation|
|
|
702
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
703
|
+
yield response, operation if block_given?
|
|
704
|
+
throw :response, response
|
|
705
|
+
end
|
|
706
|
+
rescue ::GRPC::BadStatus => e
|
|
707
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
708
|
+
end
|
|
709
|
+
|
|
710
|
+
##
|
|
711
|
+
# Deletes a specific AgentAnomalyDetectionScope.
|
|
712
|
+
#
|
|
713
|
+
# @overload delete_agent_anomaly_detection_scope(request, options = nil)
|
|
714
|
+
# Pass arguments to `delete_agent_anomaly_detection_scope` via a request object, either of type
|
|
715
|
+
# {::Google::Cloud::AIPlatform::V1::DeleteAgentAnomalyDetectionScopeRequest} or an equivalent Hash.
|
|
716
|
+
#
|
|
717
|
+
# @param request [::Google::Cloud::AIPlatform::V1::DeleteAgentAnomalyDetectionScopeRequest, ::Hash]
|
|
718
|
+
# A request object representing the call parameters. Required. To specify no
|
|
719
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
720
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
721
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
722
|
+
#
|
|
723
|
+
# @overload delete_agent_anomaly_detection_scope(name: nil)
|
|
724
|
+
# Pass arguments to `delete_agent_anomaly_detection_scope` via keyword arguments. Note that at
|
|
725
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
726
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
727
|
+
#
|
|
728
|
+
# @param name [::String]
|
|
729
|
+
# Required. The name of the AgentAnomalyDetectionScope resource to be
|
|
730
|
+
# deleted. Format:
|
|
731
|
+
# `projects/{project}/locations/{location}/agentAnomalyDetectionScopes/{agent_anomaly_detection_scope}`
|
|
732
|
+
#
|
|
733
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
734
|
+
# @yieldparam response [::Gapic::Operation]
|
|
735
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
736
|
+
#
|
|
737
|
+
# @return [::Gapic::Operation]
|
|
738
|
+
#
|
|
739
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
740
|
+
#
|
|
741
|
+
# @example Basic example
|
|
742
|
+
# require "google/cloud/ai_platform/v1"
|
|
743
|
+
#
|
|
744
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
745
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
746
|
+
#
|
|
747
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
748
|
+
# request = Google::Cloud::AIPlatform::V1::DeleteAgentAnomalyDetectionScopeRequest.new
|
|
749
|
+
#
|
|
750
|
+
# # Call the delete_agent_anomaly_detection_scope method.
|
|
751
|
+
# result = client.delete_agent_anomaly_detection_scope request
|
|
752
|
+
#
|
|
753
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
754
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
755
|
+
# # Here is how to wait for a response.
|
|
756
|
+
# result.wait_until_done! timeout: 60
|
|
757
|
+
# if result.response?
|
|
758
|
+
# p result.response
|
|
759
|
+
# else
|
|
760
|
+
# puts "No response received."
|
|
761
|
+
# end
|
|
762
|
+
#
|
|
763
|
+
def delete_agent_anomaly_detection_scope request, options = nil
|
|
764
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
765
|
+
|
|
766
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteAgentAnomalyDetectionScopeRequest
|
|
767
|
+
|
|
768
|
+
# Converts hash and nil to an options object
|
|
769
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
770
|
+
|
|
771
|
+
# Customize the options with defaults
|
|
772
|
+
metadata = @config.rpcs.delete_agent_anomaly_detection_scope.metadata.to_h
|
|
773
|
+
|
|
774
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
775
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
776
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
777
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
778
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
779
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
780
|
+
|
|
781
|
+
header_params = {}
|
|
782
|
+
if request.name
|
|
783
|
+
header_params["name"] = request.name
|
|
784
|
+
end
|
|
785
|
+
|
|
786
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
787
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
788
|
+
|
|
789
|
+
options.apply_defaults timeout: @config.rpcs.delete_agent_anomaly_detection_scope.timeout,
|
|
790
|
+
metadata: metadata,
|
|
791
|
+
retry_policy: @config.rpcs.delete_agent_anomaly_detection_scope.retry_policy
|
|
792
|
+
|
|
793
|
+
options.apply_defaults timeout: @config.timeout,
|
|
794
|
+
metadata: @config.metadata,
|
|
795
|
+
retry_policy: @config.retry_policy
|
|
796
|
+
|
|
797
|
+
@agent_anomaly_detection_service_stub.call_rpc :delete_agent_anomaly_detection_scope, request, options: options do |response, operation|
|
|
798
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
799
|
+
yield response, operation if block_given?
|
|
800
|
+
throw :response, response
|
|
801
|
+
end
|
|
802
|
+
rescue ::GRPC::BadStatus => e
|
|
803
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
804
|
+
end
|
|
805
|
+
|
|
806
|
+
##
|
|
807
|
+
# Creates a new AgentAnomalyDetectionScope.
|
|
808
|
+
#
|
|
809
|
+
# @overload create_agent_anomaly_detection_scope(request, options = nil)
|
|
810
|
+
# Pass arguments to `create_agent_anomaly_detection_scope` via a request object, either of type
|
|
811
|
+
# {::Google::Cloud::AIPlatform::V1::CreateAgentAnomalyDetectionScopeRequest} or an equivalent Hash.
|
|
812
|
+
#
|
|
813
|
+
# @param request [::Google::Cloud::AIPlatform::V1::CreateAgentAnomalyDetectionScopeRequest, ::Hash]
|
|
814
|
+
# A request object representing the call parameters. Required. To specify no
|
|
815
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
816
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
817
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
818
|
+
#
|
|
819
|
+
# @overload create_agent_anomaly_detection_scope(parent: nil, agent_anomaly_detection_scope: nil, agent_anomaly_detection_scope_id: nil)
|
|
820
|
+
# Pass arguments to `create_agent_anomaly_detection_scope` via keyword arguments. Note that at
|
|
821
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
822
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
823
|
+
#
|
|
824
|
+
# @param parent [::String]
|
|
825
|
+
# Required. The resource name of the Location to create the
|
|
826
|
+
# AgentAnomalyDetectionScope in. Format:
|
|
827
|
+
# `projects/{project}/locations/{location}`
|
|
828
|
+
# @param agent_anomaly_detection_scope [::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionScope, ::Hash]
|
|
829
|
+
# Required. The AgentAnomalyDetectionScope to create.
|
|
830
|
+
# @param agent_anomaly_detection_scope_id [::String]
|
|
831
|
+
# Required. The ID to use for the AgentAnomalyDetectionScope, which will
|
|
832
|
+
# become the final component of the AgentAnomalyDetectionScope's resource
|
|
833
|
+
# name.
|
|
834
|
+
#
|
|
835
|
+
# This value should be 1-63 characters, and valid characters
|
|
836
|
+
# are /[a-z]([a-z0-9-]\\{0,61}[a-z0-9])?/.
|
|
837
|
+
#
|
|
838
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
839
|
+
# @yieldparam response [::Gapic::Operation]
|
|
840
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
841
|
+
#
|
|
842
|
+
# @return [::Gapic::Operation]
|
|
843
|
+
#
|
|
844
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
845
|
+
#
|
|
846
|
+
# @example Basic example
|
|
847
|
+
# require "google/cloud/ai_platform/v1"
|
|
848
|
+
#
|
|
849
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
850
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
851
|
+
#
|
|
852
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
853
|
+
# request = Google::Cloud::AIPlatform::V1::CreateAgentAnomalyDetectionScopeRequest.new
|
|
854
|
+
#
|
|
855
|
+
# # Call the create_agent_anomaly_detection_scope method.
|
|
856
|
+
# result = client.create_agent_anomaly_detection_scope request
|
|
857
|
+
#
|
|
858
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
859
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
860
|
+
# # Here is how to wait for a response.
|
|
861
|
+
# result.wait_until_done! timeout: 60
|
|
862
|
+
# if result.response?
|
|
863
|
+
# p result.response
|
|
864
|
+
# else
|
|
865
|
+
# puts "No response received."
|
|
866
|
+
# end
|
|
867
|
+
#
|
|
868
|
+
def create_agent_anomaly_detection_scope request, options = nil
|
|
869
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
870
|
+
|
|
871
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateAgentAnomalyDetectionScopeRequest
|
|
872
|
+
|
|
873
|
+
# Converts hash and nil to an options object
|
|
874
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
875
|
+
|
|
876
|
+
# Customize the options with defaults
|
|
877
|
+
metadata = @config.rpcs.create_agent_anomaly_detection_scope.metadata.to_h
|
|
878
|
+
|
|
879
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
880
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
881
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
882
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
883
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
884
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
885
|
+
|
|
886
|
+
header_params = {}
|
|
887
|
+
if request.parent
|
|
888
|
+
header_params["parent"] = request.parent
|
|
889
|
+
end
|
|
890
|
+
|
|
891
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
892
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
893
|
+
|
|
894
|
+
options.apply_defaults timeout: @config.rpcs.create_agent_anomaly_detection_scope.timeout,
|
|
895
|
+
metadata: metadata,
|
|
896
|
+
retry_policy: @config.rpcs.create_agent_anomaly_detection_scope.retry_policy
|
|
897
|
+
|
|
898
|
+
options.apply_defaults timeout: @config.timeout,
|
|
899
|
+
metadata: @config.metadata,
|
|
900
|
+
retry_policy: @config.retry_policy
|
|
901
|
+
|
|
902
|
+
@agent_anomaly_detection_service_stub.call_rpc :create_agent_anomaly_detection_scope, request, options: options do |response, operation|
|
|
903
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
904
|
+
yield response, operation if block_given?
|
|
905
|
+
throw :response, response
|
|
906
|
+
end
|
|
907
|
+
rescue ::GRPC::BadStatus => e
|
|
908
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
909
|
+
end
|
|
910
|
+
|
|
911
|
+
##
|
|
912
|
+
# Lists AgentAnomalyDetectionScopes in a Location.
|
|
913
|
+
#
|
|
914
|
+
# @overload list_agent_anomaly_detection_scopes(request, options = nil)
|
|
915
|
+
# Pass arguments to `list_agent_anomaly_detection_scopes` via a request object, either of type
|
|
916
|
+
# {::Google::Cloud::AIPlatform::V1::ListAgentAnomalyDetectionScopesRequest} or an equivalent Hash.
|
|
917
|
+
#
|
|
918
|
+
# @param request [::Google::Cloud::AIPlatform::V1::ListAgentAnomalyDetectionScopesRequest, ::Hash]
|
|
919
|
+
# A request object representing the call parameters. Required. To specify no
|
|
920
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
921
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
922
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
923
|
+
#
|
|
924
|
+
# @overload list_agent_anomaly_detection_scopes(parent: nil, page_size: nil, page_token: nil)
|
|
925
|
+
# Pass arguments to `list_agent_anomaly_detection_scopes` via keyword arguments. Note that at
|
|
926
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
927
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
928
|
+
#
|
|
929
|
+
# @param parent [::String]
|
|
930
|
+
# Required. The resource name of the Location to list the
|
|
931
|
+
# AgentAnomalyDetectionScopes from. Format:
|
|
932
|
+
# `projects/{project}/locations/{location}`
|
|
933
|
+
# @param page_size [::Integer]
|
|
934
|
+
# Optional. The standard list page size. The maximum value is 100; values
|
|
935
|
+
# above 100 will be coerced to 100. If unspecified, at most 10
|
|
936
|
+
# AgentAnomalyDetectionScopes will be returned.
|
|
937
|
+
# @param page_token [::String]
|
|
938
|
+
# Optional. The standard list page token.
|
|
939
|
+
#
|
|
940
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
941
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionScope>]
|
|
942
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
943
|
+
#
|
|
944
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionScope>]
|
|
945
|
+
#
|
|
946
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
947
|
+
#
|
|
948
|
+
# @example Basic example
|
|
949
|
+
# require "google/cloud/ai_platform/v1"
|
|
950
|
+
#
|
|
951
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
952
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
953
|
+
#
|
|
954
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
955
|
+
# request = Google::Cloud::AIPlatform::V1::ListAgentAnomalyDetectionScopesRequest.new
|
|
956
|
+
#
|
|
957
|
+
# # Call the list_agent_anomaly_detection_scopes method.
|
|
958
|
+
# result = client.list_agent_anomaly_detection_scopes request
|
|
959
|
+
#
|
|
960
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
961
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
962
|
+
# result.each do |item|
|
|
963
|
+
# # Each element is of type ::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionScope.
|
|
964
|
+
# p item
|
|
965
|
+
# end
|
|
966
|
+
#
|
|
967
|
+
def list_agent_anomaly_detection_scopes request, options = nil
|
|
968
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
969
|
+
|
|
970
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListAgentAnomalyDetectionScopesRequest
|
|
971
|
+
|
|
972
|
+
# Converts hash and nil to an options object
|
|
973
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
974
|
+
|
|
975
|
+
# Customize the options with defaults
|
|
976
|
+
metadata = @config.rpcs.list_agent_anomaly_detection_scopes.metadata.to_h
|
|
977
|
+
|
|
978
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
979
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
980
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
981
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
982
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
983
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
984
|
+
|
|
985
|
+
header_params = {}
|
|
986
|
+
if request.parent
|
|
987
|
+
header_params["parent"] = request.parent
|
|
988
|
+
end
|
|
989
|
+
|
|
990
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
991
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
992
|
+
|
|
993
|
+
options.apply_defaults timeout: @config.rpcs.list_agent_anomaly_detection_scopes.timeout,
|
|
994
|
+
metadata: metadata,
|
|
995
|
+
retry_policy: @config.rpcs.list_agent_anomaly_detection_scopes.retry_policy
|
|
996
|
+
|
|
997
|
+
options.apply_defaults timeout: @config.timeout,
|
|
998
|
+
metadata: @config.metadata,
|
|
999
|
+
retry_policy: @config.retry_policy
|
|
1000
|
+
|
|
1001
|
+
@agent_anomaly_detection_service_stub.call_rpc :list_agent_anomaly_detection_scopes, request, options: options do |response, operation|
|
|
1002
|
+
response = ::Gapic::PagedEnumerable.new @agent_anomaly_detection_service_stub, :list_agent_anomaly_detection_scopes, request, response, operation, options
|
|
1003
|
+
yield response, operation if block_given?
|
|
1004
|
+
throw :response, response
|
|
1005
|
+
end
|
|
1006
|
+
rescue ::GRPC::BadStatus => e
|
|
1007
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1008
|
+
end
|
|
1009
|
+
|
|
1010
|
+
##
|
|
1011
|
+
# Lists AnalyzedSessions in a MonitoredAgent.
|
|
1012
|
+
#
|
|
1013
|
+
# @overload list_analyzed_sessions(request, options = nil)
|
|
1014
|
+
# Pass arguments to `list_analyzed_sessions` via a request object, either of type
|
|
1015
|
+
# {::Google::Cloud::AIPlatform::V1::ListAnalyzedSessionsRequest} or an equivalent Hash.
|
|
1016
|
+
#
|
|
1017
|
+
# @param request [::Google::Cloud::AIPlatform::V1::ListAnalyzedSessionsRequest, ::Hash]
|
|
1018
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1019
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1020
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1021
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1022
|
+
#
|
|
1023
|
+
# @overload list_analyzed_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, view: nil, order_by: nil)
|
|
1024
|
+
# Pass arguments to `list_analyzed_sessions` via keyword arguments. Note that at
|
|
1025
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1026
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1027
|
+
#
|
|
1028
|
+
# @param parent [::String]
|
|
1029
|
+
# Required. The parent MonitoredAgent resource.
|
|
1030
|
+
# Format:
|
|
1031
|
+
# `projects/{project}/locations/{location}/monitoredAgents/{monitored_agent}`
|
|
1032
|
+
# @param page_size [::Integer]
|
|
1033
|
+
# Optional. The maximum number of analyzed sessions to return.
|
|
1034
|
+
# @param page_token [::String]
|
|
1035
|
+
# Optional. A page token, received from a previous `ListAnalyzedSessions`
|
|
1036
|
+
# call.
|
|
1037
|
+
# @param filter [::String]
|
|
1038
|
+
# Optional. Filter expression restricting which AnalyzedSessions are
|
|
1039
|
+
# returned. Supports a subset of AIP-160: a closed `detection_time` window
|
|
1040
|
+
# (both bounds required), an equality on `severity`, an equality on
|
|
1041
|
+
# `agent_type`, and an equality on `session_id`, joined by `AND`. Each
|
|
1042
|
+
# clause is optional, may appear at most once, and may appear in any order.
|
|
1043
|
+
#
|
|
1044
|
+
# The `severity` value is the **canonical** `Severity` enum name --
|
|
1045
|
+
# `SEVERITY_CRITICAL`, `SEVERITY_HIGH`, `SEVERITY_MEDIUM` or `SEVERITY_LOW`.
|
|
1046
|
+
# Short forms such as `"CRITICAL"` are rejected, as is
|
|
1047
|
+
# `SEVERITY_UNSPECIFIED`. It matches sessions whose *maximum* severity equals
|
|
1048
|
+
# that bucket: a session that fires at both LOW and CRITICAL matches
|
|
1049
|
+
# `severity = "SEVERITY_CRITICAL"`, not `severity = "SEVERITY_LOW"`.
|
|
1050
|
+
#
|
|
1051
|
+
# The `agent_type` value is the canonical `AgentResource.AgentType` enum name
|
|
1052
|
+
# -- `REASONING_ENGINE`, `CLOUD_RUN_SERVICE`, `GKE_WORKLOAD`, `GCE_INSTANCE`,
|
|
1053
|
+
# `AWS`, `AZURE`, `AGENT_TYPE_OTHER` or `AGENT_TYPE_UNSPECIFIED` -- and
|
|
1054
|
+
# matches sessions run by an agent on that runtime.
|
|
1055
|
+
#
|
|
1056
|
+
# Unlike `severity`, `agent_type` accepts its `UNSPECIFIED` value. The two
|
|
1057
|
+
# are not analogous: a session always has a computed severity bucket, so
|
|
1058
|
+
# `SEVERITY_UNSPECIFIED` is never returned and filtering on it could only
|
|
1059
|
+
# match nothing. `AGENT_TYPE_UNSPECIFIED` *is* returned -- it is what
|
|
1060
|
+
# `AnalyzedSession.agent_type` reports for an agent whose runtime was never
|
|
1061
|
+
# recorded -- so it must remain filterable.
|
|
1062
|
+
#
|
|
1063
|
+
# The `session_id` value is a case-sensitive exact match (no substring or
|
|
1064
|
+
# prefix matching) on `AnalyzedSession.session_id`. Unlike `severity` and
|
|
1065
|
+
# `agent_type` it is not a closed enum, so any non-empty value is accepted;
|
|
1066
|
+
# an empty value (`session_id = ""`) is rejected rather than treated as "no
|
|
1067
|
+
# filter".
|
|
1068
|
+
#
|
|
1069
|
+
# Example (time window, severity and runtime):
|
|
1070
|
+
#
|
|
1071
|
+
# ```
|
|
1072
|
+
# detection_time >= "2024-01-01T00:00:00Z" AND detection_time <=
|
|
1073
|
+
# "2024-01-08T00:00:00Z" AND severity = "SEVERITY_CRITICAL" AND agent_type =
|
|
1074
|
+
# "CLOUD_RUN_SERVICE"
|
|
1075
|
+
# ```
|
|
1076
|
+
#
|
|
1077
|
+
# If empty, results are restricted to the last 7 days with no severity,
|
|
1078
|
+
# runtime, or session restriction. Other fields, additional operators, set
|
|
1079
|
+
# membership (`IN`), and boolean combinations (`OR`, `NOT`, parentheses) are
|
|
1080
|
+
# not yet supported.
|
|
1081
|
+
# @param view [::Google::Cloud::AIPlatform::V1::AnalyzedSessionView]
|
|
1082
|
+
# Optional. Resource view to control which fields are returned.
|
|
1083
|
+
# @param order_by [::String]
|
|
1084
|
+
# Optional. Comma-separated list of fields to sort by, following AIP-132
|
|
1085
|
+
# syntax. The default sort direction is ascending; append " desc" to a
|
|
1086
|
+
# field to sort descending.
|
|
1087
|
+
#
|
|
1088
|
+
# Supported fields (any other field yields INVALID_ARGUMENT):
|
|
1089
|
+
#
|
|
1090
|
+
# * `latest_detection_time` - the session's most-recent flagged detection
|
|
1091
|
+
# time. `latest_detection_time desc` puts the newest sessions first.
|
|
1092
|
+
# * `max_severity_rank` - the session's bucketed maximum severity, ranked
|
|
1093
|
+
# LOW=1 < MEDIUM=2 < HIGH=3 < CRITICAL=4. `max_severity_rank desc` puts
|
|
1094
|
+
# the most-severe sessions first.
|
|
1095
|
+
# * `agent_display_name` - the MonitoredAgent's display name. Sorted as a
|
|
1096
|
+
# STRING (case-sensitive, code-point order).
|
|
1097
|
+
#
|
|
1098
|
+
# If empty, defaults to `latest_detection_time desc`. Multi-field sort
|
|
1099
|
+
# (for example, `max_severity_rank desc, latest_detection_time desc`) is
|
|
1100
|
+
# supported.
|
|
1101
|
+
#
|
|
1102
|
+
# The `order_by` value MUST match the value used on the call that minted any
|
|
1103
|
+
# supplied `page_token` (AIP-158). Mismatches yield INVALID_ARGUMENT.
|
|
1104
|
+
#
|
|
1105
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1106
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::AnalyzedSession>]
|
|
1107
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1108
|
+
#
|
|
1109
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::AnalyzedSession>]
|
|
1110
|
+
#
|
|
1111
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1112
|
+
#
|
|
1113
|
+
# @example Basic example
|
|
1114
|
+
# require "google/cloud/ai_platform/v1"
|
|
1115
|
+
#
|
|
1116
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1117
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
1118
|
+
#
|
|
1119
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1120
|
+
# request = Google::Cloud::AIPlatform::V1::ListAnalyzedSessionsRequest.new
|
|
1121
|
+
#
|
|
1122
|
+
# # Call the list_analyzed_sessions method.
|
|
1123
|
+
# result = client.list_analyzed_sessions request
|
|
1124
|
+
#
|
|
1125
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
1126
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
1127
|
+
# result.each do |item|
|
|
1128
|
+
# # Each element is of type ::Google::Cloud::AIPlatform::V1::AnalyzedSession.
|
|
1129
|
+
# p item
|
|
1130
|
+
# end
|
|
1131
|
+
#
|
|
1132
|
+
def list_analyzed_sessions request, options = nil
|
|
1133
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1134
|
+
|
|
1135
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListAnalyzedSessionsRequest
|
|
1136
|
+
|
|
1137
|
+
# Converts hash and nil to an options object
|
|
1138
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1139
|
+
|
|
1140
|
+
# Customize the options with defaults
|
|
1141
|
+
metadata = @config.rpcs.list_analyzed_sessions.metadata.to_h
|
|
1142
|
+
|
|
1143
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1144
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1145
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1146
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
1147
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1148
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1149
|
+
|
|
1150
|
+
header_params = {}
|
|
1151
|
+
if request.parent
|
|
1152
|
+
header_params["parent"] = request.parent
|
|
1153
|
+
end
|
|
1154
|
+
|
|
1155
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1156
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1157
|
+
|
|
1158
|
+
options.apply_defaults timeout: @config.rpcs.list_analyzed_sessions.timeout,
|
|
1159
|
+
metadata: metadata,
|
|
1160
|
+
retry_policy: @config.rpcs.list_analyzed_sessions.retry_policy
|
|
1161
|
+
|
|
1162
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1163
|
+
metadata: @config.metadata,
|
|
1164
|
+
retry_policy: @config.retry_policy
|
|
1165
|
+
|
|
1166
|
+
@agent_anomaly_detection_service_stub.call_rpc :list_analyzed_sessions, request, options: options do |response, operation|
|
|
1167
|
+
response = ::Gapic::PagedEnumerable.new @agent_anomaly_detection_service_stub, :list_analyzed_sessions, request, response, operation, options
|
|
1168
|
+
yield response, operation if block_given?
|
|
1169
|
+
throw :response, response
|
|
1170
|
+
end
|
|
1171
|
+
rescue ::GRPC::BadStatus => e
|
|
1172
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1173
|
+
end
|
|
1174
|
+
|
|
1175
|
+
##
|
|
1176
|
+
# Gets the details of a specific AnalyzedSession.
|
|
1177
|
+
#
|
|
1178
|
+
# @overload get_analyzed_session(request, options = nil)
|
|
1179
|
+
# Pass arguments to `get_analyzed_session` via a request object, either of type
|
|
1180
|
+
# {::Google::Cloud::AIPlatform::V1::GetAnalyzedSessionRequest} or an equivalent Hash.
|
|
1181
|
+
#
|
|
1182
|
+
# @param request [::Google::Cloud::AIPlatform::V1::GetAnalyzedSessionRequest, ::Hash]
|
|
1183
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1184
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1185
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1186
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1187
|
+
#
|
|
1188
|
+
# @overload get_analyzed_session(name: nil, view: nil)
|
|
1189
|
+
# Pass arguments to `get_analyzed_session` via keyword arguments. Note that at
|
|
1190
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1191
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1192
|
+
#
|
|
1193
|
+
# @param name [::String]
|
|
1194
|
+
# Required. The name of the AnalyzedSession resource.
|
|
1195
|
+
# Format:
|
|
1196
|
+
# `projects/{project}/locations/{location}/monitoredAgents/{monitored_agent}/analyzedSessions/{analyzed_session}`
|
|
1197
|
+
# @param view [::Google::Cloud::AIPlatform::V1::AnalyzedSessionView]
|
|
1198
|
+
# Optional. Resource view to control which fields are returned.
|
|
1199
|
+
#
|
|
1200
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1201
|
+
# @yieldparam response [::Google::Cloud::AIPlatform::V1::AnalyzedSession]
|
|
1202
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1203
|
+
#
|
|
1204
|
+
# @return [::Google::Cloud::AIPlatform::V1::AnalyzedSession]
|
|
1205
|
+
#
|
|
1206
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1207
|
+
#
|
|
1208
|
+
# @example Basic example
|
|
1209
|
+
# require "google/cloud/ai_platform/v1"
|
|
1210
|
+
#
|
|
1211
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1212
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
1213
|
+
#
|
|
1214
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1215
|
+
# request = Google::Cloud::AIPlatform::V1::GetAnalyzedSessionRequest.new
|
|
1216
|
+
#
|
|
1217
|
+
# # Call the get_analyzed_session method.
|
|
1218
|
+
# result = client.get_analyzed_session request
|
|
1219
|
+
#
|
|
1220
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::AnalyzedSession.
|
|
1221
|
+
# p result
|
|
1222
|
+
#
|
|
1223
|
+
def get_analyzed_session request, options = nil
|
|
1224
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1225
|
+
|
|
1226
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetAnalyzedSessionRequest
|
|
1227
|
+
|
|
1228
|
+
# Converts hash and nil to an options object
|
|
1229
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1230
|
+
|
|
1231
|
+
# Customize the options with defaults
|
|
1232
|
+
metadata = @config.rpcs.get_analyzed_session.metadata.to_h
|
|
1233
|
+
|
|
1234
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1235
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1236
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1237
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
1238
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1239
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1240
|
+
|
|
1241
|
+
header_params = {}
|
|
1242
|
+
if request.name
|
|
1243
|
+
header_params["name"] = request.name
|
|
1244
|
+
end
|
|
1245
|
+
|
|
1246
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1247
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1248
|
+
|
|
1249
|
+
options.apply_defaults timeout: @config.rpcs.get_analyzed_session.timeout,
|
|
1250
|
+
metadata: metadata,
|
|
1251
|
+
retry_policy: @config.rpcs.get_analyzed_session.retry_policy
|
|
1252
|
+
|
|
1253
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1254
|
+
metadata: @config.metadata,
|
|
1255
|
+
retry_policy: @config.retry_policy
|
|
1256
|
+
|
|
1257
|
+
@agent_anomaly_detection_service_stub.call_rpc :get_analyzed_session, request, options: options do |response, operation|
|
|
1258
|
+
yield response, operation if block_given?
|
|
1259
|
+
end
|
|
1260
|
+
rescue ::GRPC::BadStatus => e
|
|
1261
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1262
|
+
end
|
|
1263
|
+
|
|
1264
|
+
##
|
|
1265
|
+
# Lists AnalyzedInvocations in a MonitoredAgent's AnalyzedSession.
|
|
1266
|
+
#
|
|
1267
|
+
# @overload list_analyzed_invocations(request, options = nil)
|
|
1268
|
+
# Pass arguments to `list_analyzed_invocations` via a request object, either of type
|
|
1269
|
+
# {::Google::Cloud::AIPlatform::V1::ListAnalyzedInvocationsRequest} or an equivalent Hash.
|
|
1270
|
+
#
|
|
1271
|
+
# @param request [::Google::Cloud::AIPlatform::V1::ListAnalyzedInvocationsRequest, ::Hash]
|
|
1272
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1273
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1274
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1275
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1276
|
+
#
|
|
1277
|
+
# @overload list_analyzed_invocations(parent: nil, page_size: nil, page_token: nil)
|
|
1278
|
+
# Pass arguments to `list_analyzed_invocations` via keyword arguments. Note that at
|
|
1279
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1280
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1281
|
+
#
|
|
1282
|
+
# @param parent [::String]
|
|
1283
|
+
# Required. The parent AnalyzedSession resource.
|
|
1284
|
+
# Format:
|
|
1285
|
+
# `projects/{project}/locations/{location}/monitoredAgents/{monitored_agent}/analyzedSessions/{analyzed_session}`
|
|
1286
|
+
# @param page_size [::Integer]
|
|
1287
|
+
# Optional. The maximum number of analyzed invocations to return.
|
|
1288
|
+
# @param page_token [::String]
|
|
1289
|
+
# Optional. A page token, received from a previous `ListAnalyzedInvocations`
|
|
1290
|
+
# call.
|
|
1291
|
+
#
|
|
1292
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1293
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::AnalyzedInvocation>]
|
|
1294
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1295
|
+
#
|
|
1296
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::AnalyzedInvocation>]
|
|
1297
|
+
#
|
|
1298
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1299
|
+
#
|
|
1300
|
+
# @example Basic example
|
|
1301
|
+
# require "google/cloud/ai_platform/v1"
|
|
1302
|
+
#
|
|
1303
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1304
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
1305
|
+
#
|
|
1306
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1307
|
+
# request = Google::Cloud::AIPlatform::V1::ListAnalyzedInvocationsRequest.new
|
|
1308
|
+
#
|
|
1309
|
+
# # Call the list_analyzed_invocations method.
|
|
1310
|
+
# result = client.list_analyzed_invocations request
|
|
1311
|
+
#
|
|
1312
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
1313
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
1314
|
+
# result.each do |item|
|
|
1315
|
+
# # Each element is of type ::Google::Cloud::AIPlatform::V1::AnalyzedInvocation.
|
|
1316
|
+
# p item
|
|
1317
|
+
# end
|
|
1318
|
+
#
|
|
1319
|
+
def list_analyzed_invocations request, options = nil
|
|
1320
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1321
|
+
|
|
1322
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListAnalyzedInvocationsRequest
|
|
1323
|
+
|
|
1324
|
+
# Converts hash and nil to an options object
|
|
1325
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1326
|
+
|
|
1327
|
+
# Customize the options with defaults
|
|
1328
|
+
metadata = @config.rpcs.list_analyzed_invocations.metadata.to_h
|
|
1329
|
+
|
|
1330
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1331
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1332
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1333
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
1334
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1335
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1336
|
+
|
|
1337
|
+
header_params = {}
|
|
1338
|
+
if request.parent
|
|
1339
|
+
header_params["parent"] = request.parent
|
|
1340
|
+
end
|
|
1341
|
+
|
|
1342
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1343
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1344
|
+
|
|
1345
|
+
options.apply_defaults timeout: @config.rpcs.list_analyzed_invocations.timeout,
|
|
1346
|
+
metadata: metadata,
|
|
1347
|
+
retry_policy: @config.rpcs.list_analyzed_invocations.retry_policy
|
|
1348
|
+
|
|
1349
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1350
|
+
metadata: @config.metadata,
|
|
1351
|
+
retry_policy: @config.retry_policy
|
|
1352
|
+
|
|
1353
|
+
@agent_anomaly_detection_service_stub.call_rpc :list_analyzed_invocations, request, options: options do |response, operation|
|
|
1354
|
+
response = ::Gapic::PagedEnumerable.new @agent_anomaly_detection_service_stub, :list_analyzed_invocations, request, response, operation, options
|
|
1355
|
+
yield response, operation if block_given?
|
|
1356
|
+
throw :response, response
|
|
1357
|
+
end
|
|
1358
|
+
rescue ::GRPC::BadStatus => e
|
|
1359
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1360
|
+
end
|
|
1361
|
+
|
|
1362
|
+
##
|
|
1363
|
+
# Gets the details of a specific AnalyzedInvocation.
|
|
1364
|
+
#
|
|
1365
|
+
# @overload get_analyzed_invocation(request, options = nil)
|
|
1366
|
+
# Pass arguments to `get_analyzed_invocation` via a request object, either of type
|
|
1367
|
+
# {::Google::Cloud::AIPlatform::V1::GetAnalyzedInvocationRequest} or an equivalent Hash.
|
|
1368
|
+
#
|
|
1369
|
+
# @param request [::Google::Cloud::AIPlatform::V1::GetAnalyzedInvocationRequest, ::Hash]
|
|
1370
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1371
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1372
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1373
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1374
|
+
#
|
|
1375
|
+
# @overload get_analyzed_invocation(name: nil)
|
|
1376
|
+
# Pass arguments to `get_analyzed_invocation` via keyword arguments. Note that at
|
|
1377
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1378
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1379
|
+
#
|
|
1380
|
+
# @param name [::String]
|
|
1381
|
+
# Required. The name of the AnalyzedInvocation resource.
|
|
1382
|
+
# Format:
|
|
1383
|
+
# `projects/{project}/locations/{location}/monitoredAgents/{monitored_agent}/analyzedSessions/{analyzed_session}/analyzedInvocations/{analyzed_invocation}`
|
|
1384
|
+
#
|
|
1385
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1386
|
+
# @yieldparam response [::Google::Cloud::AIPlatform::V1::AnalyzedInvocation]
|
|
1387
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1388
|
+
#
|
|
1389
|
+
# @return [::Google::Cloud::AIPlatform::V1::AnalyzedInvocation]
|
|
1390
|
+
#
|
|
1391
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1392
|
+
#
|
|
1393
|
+
# @example Basic example
|
|
1394
|
+
# require "google/cloud/ai_platform/v1"
|
|
1395
|
+
#
|
|
1396
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1397
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
1398
|
+
#
|
|
1399
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1400
|
+
# request = Google::Cloud::AIPlatform::V1::GetAnalyzedInvocationRequest.new
|
|
1401
|
+
#
|
|
1402
|
+
# # Call the get_analyzed_invocation method.
|
|
1403
|
+
# result = client.get_analyzed_invocation request
|
|
1404
|
+
#
|
|
1405
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::AnalyzedInvocation.
|
|
1406
|
+
# p result
|
|
1407
|
+
#
|
|
1408
|
+
def get_analyzed_invocation request, options = nil
|
|
1409
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1410
|
+
|
|
1411
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetAnalyzedInvocationRequest
|
|
1412
|
+
|
|
1413
|
+
# Converts hash and nil to an options object
|
|
1414
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1415
|
+
|
|
1416
|
+
# Customize the options with defaults
|
|
1417
|
+
metadata = @config.rpcs.get_analyzed_invocation.metadata.to_h
|
|
1418
|
+
|
|
1419
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1420
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1421
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1422
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
1423
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1424
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1425
|
+
|
|
1426
|
+
header_params = {}
|
|
1427
|
+
if request.name
|
|
1428
|
+
header_params["name"] = request.name
|
|
1429
|
+
end
|
|
1430
|
+
|
|
1431
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1432
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1433
|
+
|
|
1434
|
+
options.apply_defaults timeout: @config.rpcs.get_analyzed_invocation.timeout,
|
|
1435
|
+
metadata: metadata,
|
|
1436
|
+
retry_policy: @config.rpcs.get_analyzed_invocation.retry_policy
|
|
1437
|
+
|
|
1438
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1439
|
+
metadata: @config.metadata,
|
|
1440
|
+
retry_policy: @config.retry_policy
|
|
1441
|
+
|
|
1442
|
+
@agent_anomaly_detection_service_stub.call_rpc :get_analyzed_invocation, request, options: options do |response, operation|
|
|
1443
|
+
yield response, operation if block_given?
|
|
1444
|
+
end
|
|
1445
|
+
rescue ::GRPC::BadStatus => e
|
|
1446
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1447
|
+
end
|
|
1448
|
+
|
|
1449
|
+
##
|
|
1450
|
+
# Aggregates AnalyzedSessions across MonitoredAgents.
|
|
1451
|
+
#
|
|
1452
|
+
# To aggregate across all MonitoredAgents in a
|
|
1453
|
+
# location, use the following format for the parent field:
|
|
1454
|
+
# `projects/{project}/locations/{location}/monitoredAgents/-`
|
|
1455
|
+
#
|
|
1456
|
+
# @overload aggregate_analyzed_sessions(request, options = nil)
|
|
1457
|
+
# Pass arguments to `aggregate_analyzed_sessions` via a request object, either of type
|
|
1458
|
+
# {::Google::Cloud::AIPlatform::V1::AggregateAnalyzedSessionsRequest} or an equivalent Hash.
|
|
1459
|
+
#
|
|
1460
|
+
# @param request [::Google::Cloud::AIPlatform::V1::AggregateAnalyzedSessionsRequest, ::Hash]
|
|
1461
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1462
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1463
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1464
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1465
|
+
#
|
|
1466
|
+
# @overload aggregate_analyzed_sessions(parent: nil, filter: nil, page_size: nil, page_token: nil)
|
|
1467
|
+
# Pass arguments to `aggregate_analyzed_sessions` via keyword arguments. Note that at
|
|
1468
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1469
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1470
|
+
#
|
|
1471
|
+
# @param parent [::String]
|
|
1472
|
+
# Required. The parent MonitoredAgent resource. Use the `-` wildcard
|
|
1473
|
+
# for the monitored_agent segment to aggregate across multiple agents in the
|
|
1474
|
+
# location.
|
|
1475
|
+
# Format:
|
|
1476
|
+
# `projects/{project}/locations/{location}/monitoredAgents/{monitored_agent}`
|
|
1477
|
+
# @param filter [::String]
|
|
1478
|
+
# Optional. Filter expression restricting which AnalyzedSessions are included
|
|
1479
|
+
# in the aggregation. Supports a subset of the
|
|
1480
|
+
# `ListAnalyzedSessionsRequest.filter` grammar: a closed `detection_time`
|
|
1481
|
+
# window with both bounds required. The `severity` clause is not supported
|
|
1482
|
+
# here. If empty, the aggregation covers the last 3 days.
|
|
1483
|
+
#
|
|
1484
|
+
# Example:
|
|
1485
|
+
#
|
|
1486
|
+
# ```
|
|
1487
|
+
# detection_time >= "2024-01-01T00:00:00Z" AND detection_time <=
|
|
1488
|
+
# "2024-01-08T00:00:00Z"
|
|
1489
|
+
# ```
|
|
1490
|
+
# @param page_size [::Integer]
|
|
1491
|
+
# Optional. The standard list page size. The maximum value is 100; values
|
|
1492
|
+
# above 100 will be coerced to 100. If unspecified, at most 10
|
|
1493
|
+
# MonitoredAgents will be returned.
|
|
1494
|
+
# @param page_token [::String]
|
|
1495
|
+
# Optional. The standard list page token.
|
|
1496
|
+
#
|
|
1497
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1498
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::AggregateAnalyzedSessionsResponse::AgentAggregate>]
|
|
1499
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1500
|
+
#
|
|
1501
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::AIPlatform::V1::AggregateAnalyzedSessionsResponse::AgentAggregate>]
|
|
1502
|
+
#
|
|
1503
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1504
|
+
#
|
|
1505
|
+
# @example Basic example
|
|
1506
|
+
# require "google/cloud/ai_platform/v1"
|
|
1507
|
+
#
|
|
1508
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1509
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
1510
|
+
#
|
|
1511
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1512
|
+
# request = Google::Cloud::AIPlatform::V1::AggregateAnalyzedSessionsRequest.new
|
|
1513
|
+
#
|
|
1514
|
+
# # Call the aggregate_analyzed_sessions method.
|
|
1515
|
+
# result = client.aggregate_analyzed_sessions request
|
|
1516
|
+
#
|
|
1517
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
|
1518
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
|
1519
|
+
# result.each do |item|
|
|
1520
|
+
# # Each element is of type ::Google::Cloud::AIPlatform::V1::AggregateAnalyzedSessionsResponse::AgentAggregate.
|
|
1521
|
+
# p item
|
|
1522
|
+
# end
|
|
1523
|
+
#
|
|
1524
|
+
def aggregate_analyzed_sessions request, options = nil
|
|
1525
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1526
|
+
|
|
1527
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::AggregateAnalyzedSessionsRequest
|
|
1528
|
+
|
|
1529
|
+
# Converts hash and nil to an options object
|
|
1530
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1531
|
+
|
|
1532
|
+
# Customize the options with defaults
|
|
1533
|
+
metadata = @config.rpcs.aggregate_analyzed_sessions.metadata.to_h
|
|
1534
|
+
|
|
1535
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1536
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1537
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1538
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
1539
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1540
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1541
|
+
|
|
1542
|
+
header_params = {}
|
|
1543
|
+
if request.parent
|
|
1544
|
+
header_params["parent"] = request.parent
|
|
1545
|
+
end
|
|
1546
|
+
|
|
1547
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1548
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1549
|
+
|
|
1550
|
+
options.apply_defaults timeout: @config.rpcs.aggregate_analyzed_sessions.timeout,
|
|
1551
|
+
metadata: metadata,
|
|
1552
|
+
retry_policy: @config.rpcs.aggregate_analyzed_sessions.retry_policy
|
|
1553
|
+
|
|
1554
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1555
|
+
metadata: @config.metadata,
|
|
1556
|
+
retry_policy: @config.retry_policy
|
|
1557
|
+
|
|
1558
|
+
@agent_anomaly_detection_service_stub.call_rpc :aggregate_analyzed_sessions, request, options: options do |response, operation|
|
|
1559
|
+
response = ::Gapic::PagedEnumerable.new @agent_anomaly_detection_service_stub, :aggregate_analyzed_sessions, request, response, operation, options
|
|
1560
|
+
yield response, operation if block_given?
|
|
1561
|
+
throw :response, response
|
|
1562
|
+
end
|
|
1563
|
+
rescue ::GRPC::BadStatus => e
|
|
1564
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1565
|
+
end
|
|
1566
|
+
|
|
1567
|
+
##
|
|
1568
|
+
# Clears (purges) the trained model artifacts derived from a MonitoredAgent's
|
|
1569
|
+
# data. The purged model is rebuilt by the next scheduled training run.
|
|
1570
|
+
#
|
|
1571
|
+
# To clear every MonitoredAgent in a location's scope, use the `-` wildcard
|
|
1572
|
+
# agent segment for the name field:
|
|
1573
|
+
# `projects/{project}/locations/{location}/monitoredAgents/-`
|
|
1574
|
+
#
|
|
1575
|
+
# This is the on-demand data-deletion path for customers who have deleted the
|
|
1576
|
+
# underlying logs / observability data a model was trained on. It deletes
|
|
1577
|
+
# only the derived model artifacts (it does NOT delete the scope or stop
|
|
1578
|
+
# monitoring). To stop monitoring an agent entirely, disable it via
|
|
1579
|
+
# DisableMonitoredAgent.
|
|
1580
|
+
#
|
|
1581
|
+
# @overload clear_training_data(request, options = nil)
|
|
1582
|
+
# Pass arguments to `clear_training_data` via a request object, either of type
|
|
1583
|
+
# {::Google::Cloud::AIPlatform::V1::ClearTrainingDataRequest} or an equivalent Hash.
|
|
1584
|
+
#
|
|
1585
|
+
# @param request [::Google::Cloud::AIPlatform::V1::ClearTrainingDataRequest, ::Hash]
|
|
1586
|
+
# A request object representing the call parameters. Required. To specify no
|
|
1587
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
1588
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
1589
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
1590
|
+
#
|
|
1591
|
+
# @overload clear_training_data(name: nil)
|
|
1592
|
+
# Pass arguments to `clear_training_data` via keyword arguments. Note that at
|
|
1593
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
1594
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
1595
|
+
#
|
|
1596
|
+
# @param name [::String]
|
|
1597
|
+
# Required. The MonitoredAgent whose trained model artifacts to purge. Use
|
|
1598
|
+
# the
|
|
1599
|
+
# `-` wildcard agent segment to purge every MonitoredAgent in the scope.
|
|
1600
|
+
# Format:
|
|
1601
|
+
# `projects/{project}/locations/{location}/monitoredAgents/{monitored_agent}`
|
|
1602
|
+
#
|
|
1603
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
1604
|
+
# @yieldparam response [::Gapic::Operation]
|
|
1605
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
1606
|
+
#
|
|
1607
|
+
# @return [::Gapic::Operation]
|
|
1608
|
+
#
|
|
1609
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
1610
|
+
#
|
|
1611
|
+
# @example Basic example
|
|
1612
|
+
# require "google/cloud/ai_platform/v1"
|
|
1613
|
+
#
|
|
1614
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
1615
|
+
# client = Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new
|
|
1616
|
+
#
|
|
1617
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
1618
|
+
# request = Google::Cloud::AIPlatform::V1::ClearTrainingDataRequest.new
|
|
1619
|
+
#
|
|
1620
|
+
# # Call the clear_training_data method.
|
|
1621
|
+
# result = client.clear_training_data request
|
|
1622
|
+
#
|
|
1623
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
|
1624
|
+
# # check the status of an operation, cancel it, or wait for results.
|
|
1625
|
+
# # Here is how to wait for a response.
|
|
1626
|
+
# result.wait_until_done! timeout: 60
|
|
1627
|
+
# if result.response?
|
|
1628
|
+
# p result.response
|
|
1629
|
+
# else
|
|
1630
|
+
# puts "No response received."
|
|
1631
|
+
# end
|
|
1632
|
+
#
|
|
1633
|
+
def clear_training_data request, options = nil
|
|
1634
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
1635
|
+
|
|
1636
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ClearTrainingDataRequest
|
|
1637
|
+
|
|
1638
|
+
# Converts hash and nil to an options object
|
|
1639
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
1640
|
+
|
|
1641
|
+
# Customize the options with defaults
|
|
1642
|
+
metadata = @config.rpcs.clear_training_data.metadata.to_h
|
|
1643
|
+
|
|
1644
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
1645
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
1646
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
1647
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION
|
|
1648
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
1649
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
1650
|
+
|
|
1651
|
+
header_params = {}
|
|
1652
|
+
if request.name
|
|
1653
|
+
header_params["name"] = request.name
|
|
1654
|
+
end
|
|
1655
|
+
|
|
1656
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
1657
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
1658
|
+
|
|
1659
|
+
options.apply_defaults timeout: @config.rpcs.clear_training_data.timeout,
|
|
1660
|
+
metadata: metadata,
|
|
1661
|
+
retry_policy: @config.rpcs.clear_training_data.retry_policy
|
|
1662
|
+
|
|
1663
|
+
options.apply_defaults timeout: @config.timeout,
|
|
1664
|
+
metadata: @config.metadata,
|
|
1665
|
+
retry_policy: @config.retry_policy
|
|
1666
|
+
|
|
1667
|
+
@agent_anomaly_detection_service_stub.call_rpc :clear_training_data, request, options: options do |response, operation|
|
|
1668
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
|
1669
|
+
yield response, operation if block_given?
|
|
1670
|
+
throw :response, response
|
|
1671
|
+
end
|
|
1672
|
+
rescue ::GRPC::BadStatus => e
|
|
1673
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
1674
|
+
end
|
|
1675
|
+
|
|
1676
|
+
##
|
|
1677
|
+
# Configuration class for the AgentAnomalyDetectionService API.
|
|
1678
|
+
#
|
|
1679
|
+
# This class represents the configuration for AgentAnomalyDetectionService,
|
|
1680
|
+
# providing control over timeouts, retry behavior, logging, transport
|
|
1681
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
|
1682
|
+
# applied individually to specific RPCs. See
|
|
1683
|
+
# {::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client::Configuration::Rpcs}
|
|
1684
|
+
# for a list of RPCs that can be configured independently.
|
|
1685
|
+
#
|
|
1686
|
+
# Configuration can be applied globally to all clients, or to a single client
|
|
1687
|
+
# on construction.
|
|
1688
|
+
#
|
|
1689
|
+
# @example
|
|
1690
|
+
#
|
|
1691
|
+
# # Modify the global config, setting the timeout for
|
|
1692
|
+
# # get_agent_anomaly_detection_scope to 20 seconds,
|
|
1693
|
+
# # and all remaining timeouts to 10 seconds.
|
|
1694
|
+
# ::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.configure do |config|
|
|
1695
|
+
# config.timeout = 10.0
|
|
1696
|
+
# config.rpcs.get_agent_anomaly_detection_scope.timeout = 20.0
|
|
1697
|
+
# end
|
|
1698
|
+
#
|
|
1699
|
+
# # Apply the above configuration only to a new client.
|
|
1700
|
+
# client = ::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new do |config|
|
|
1701
|
+
# config.timeout = 10.0
|
|
1702
|
+
# config.rpcs.get_agent_anomaly_detection_scope.timeout = 20.0
|
|
1703
|
+
# end
|
|
1704
|
+
#
|
|
1705
|
+
# @!attribute [rw] endpoint
|
|
1706
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
|
1707
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
|
1708
|
+
# @return [::String,nil]
|
|
1709
|
+
# @!attribute [rw] credentials
|
|
1710
|
+
# Credentials to send with calls. You may provide any of the following types:
|
|
1711
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
|
1712
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
|
1713
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
|
1714
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
|
1715
|
+
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
|
1716
|
+
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
|
1717
|
+
# * (`nil`) indicating no credentials
|
|
1718
|
+
#
|
|
1719
|
+
# @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
|
|
1720
|
+
# is deprecated. Providing an unvalidated credential configuration to
|
|
1721
|
+
# Google APIs can compromise the security of your systems and data.
|
|
1722
|
+
#
|
|
1723
|
+
# @example
|
|
1724
|
+
#
|
|
1725
|
+
# # The recommended way to provide credentials is to use the `make_creds` method
|
|
1726
|
+
# # on the appropriate credentials class for your environment.
|
|
1727
|
+
#
|
|
1728
|
+
# require "googleauth"
|
|
1729
|
+
#
|
|
1730
|
+
# credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
|
|
1731
|
+
# json_key_io: ::File.open("/path/to/keyfile.json")
|
|
1732
|
+
# )
|
|
1733
|
+
#
|
|
1734
|
+
# client = ::Google::Cloud::AIPlatform::V1::AgentAnomalyDetectionService::Client.new do |config|
|
|
1735
|
+
# config.credentials = credentials
|
|
1736
|
+
# end
|
|
1737
|
+
#
|
|
1738
|
+
# @note Warning: If you accept a credential configuration (JSON file or Hash) from an
|
|
1739
|
+
# external source for authentication to Google Cloud, you must validate it before
|
|
1740
|
+
# providing it to a Google API client library. Providing an unvalidated credential
|
|
1741
|
+
# configuration to Google APIs can compromise the security of your systems and data.
|
|
1742
|
+
# For more information, refer to [Validate credential configurations from external
|
|
1743
|
+
# sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
|
|
1744
|
+
# @return [::Object]
|
|
1745
|
+
# @!attribute [rw] scope
|
|
1746
|
+
# The OAuth scopes
|
|
1747
|
+
# @return [::Array<::String>]
|
|
1748
|
+
# @!attribute [rw] lib_name
|
|
1749
|
+
# The library name as recorded in instrumentation and logging
|
|
1750
|
+
# @return [::String]
|
|
1751
|
+
# @!attribute [rw] lib_version
|
|
1752
|
+
# The library version as recorded in instrumentation and logging
|
|
1753
|
+
# @return [::String]
|
|
1754
|
+
# @!attribute [rw] channel_args
|
|
1755
|
+
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
|
1756
|
+
# `GRPC::Core::Channel` object is provided as the credential.
|
|
1757
|
+
# @return [::Hash]
|
|
1758
|
+
# @!attribute [rw] interceptors
|
|
1759
|
+
# An array of interceptors that are run before calls are executed.
|
|
1760
|
+
# @return [::Array<::GRPC::ClientInterceptor>]
|
|
1761
|
+
# @!attribute [rw] timeout
|
|
1762
|
+
# The call timeout in seconds.
|
|
1763
|
+
# @return [::Numeric]
|
|
1764
|
+
# @!attribute [rw] metadata
|
|
1765
|
+
# Additional gRPC headers to be sent with the call.
|
|
1766
|
+
# @return [::Hash{::Symbol=>::String}]
|
|
1767
|
+
# @!attribute [rw] retry_policy
|
|
1768
|
+
# The retry policy. The value is a hash with the following keys:
|
|
1769
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
|
1770
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
|
1771
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
|
1772
|
+
# * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
|
|
1773
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
|
1774
|
+
# trigger a retry.
|
|
1775
|
+
# @return [::Hash]
|
|
1776
|
+
# @!attribute [rw] quota_project
|
|
1777
|
+
# A separate project against which to charge quota.
|
|
1778
|
+
# @return [::String]
|
|
1779
|
+
# @!attribute [rw] universe_domain
|
|
1780
|
+
# The universe domain within which to make requests. This determines the
|
|
1781
|
+
# default endpoint URL. The default value of nil uses the environment
|
|
1782
|
+
# universe (usually the default "googleapis.com" universe).
|
|
1783
|
+
# @return [::String,nil]
|
|
1784
|
+
# @!attribute [rw] logger
|
|
1785
|
+
# A custom logger to use for request/response debug logging, or the value
|
|
1786
|
+
# `:default` (the default) to construct a default logger, or `nil` to
|
|
1787
|
+
# explicitly disable logging.
|
|
1788
|
+
# @return [::Logger,:default,nil]
|
|
1789
|
+
#
|
|
1790
|
+
class Configuration
|
|
1791
|
+
extend ::Gapic::Config
|
|
1792
|
+
|
|
1793
|
+
# @private
|
|
1794
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
|
1795
|
+
DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
|
|
1796
|
+
|
|
1797
|
+
config_attr :endpoint, nil, ::String, nil
|
|
1798
|
+
config_attr :credentials, nil do |value|
|
|
1799
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
|
|
1800
|
+
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
|
|
1801
|
+
allowed.any? { |klass| klass === value }
|
|
1802
|
+
end
|
|
1803
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
|
1804
|
+
config_attr :lib_name, nil, ::String, nil
|
|
1805
|
+
config_attr :lib_version, nil, ::String, nil
|
|
1806
|
+
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
|
1807
|
+
config_attr :interceptors, nil, ::Array, nil
|
|
1808
|
+
config_attr :timeout, nil, ::Numeric, nil
|
|
1809
|
+
config_attr :metadata, nil, ::Hash, nil
|
|
1810
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
|
1811
|
+
config_attr :quota_project, nil, ::String, nil
|
|
1812
|
+
config_attr :universe_domain, nil, ::String, nil
|
|
1813
|
+
config_attr :logger, :default, ::Logger, nil, :default
|
|
1814
|
+
|
|
1815
|
+
# @private
|
|
1816
|
+
def initialize parent_config = nil
|
|
1817
|
+
@parent_config = parent_config unless parent_config.nil?
|
|
1818
|
+
|
|
1819
|
+
yield self if block_given?
|
|
1820
|
+
end
|
|
1821
|
+
|
|
1822
|
+
##
|
|
1823
|
+
# Configurations for individual RPCs
|
|
1824
|
+
# @return [Rpcs]
|
|
1825
|
+
#
|
|
1826
|
+
def rpcs
|
|
1827
|
+
@rpcs ||= begin
|
|
1828
|
+
parent_rpcs = nil
|
|
1829
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
|
1830
|
+
Rpcs.new parent_rpcs
|
|
1831
|
+
end
|
|
1832
|
+
end
|
|
1833
|
+
|
|
1834
|
+
##
|
|
1835
|
+
# Configuration for the channel pool
|
|
1836
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
|
1837
|
+
#
|
|
1838
|
+
def channel_pool
|
|
1839
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
|
1840
|
+
end
|
|
1841
|
+
|
|
1842
|
+
##
|
|
1843
|
+
# Configuration RPC class for the AgentAnomalyDetectionService API.
|
|
1844
|
+
#
|
|
1845
|
+
# Includes fields providing the configuration for each RPC in this service.
|
|
1846
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
|
1847
|
+
# the following configuration fields:
|
|
1848
|
+
#
|
|
1849
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
|
1850
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
|
1851
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
|
1852
|
+
# include the following keys:
|
|
1853
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
|
1854
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
|
1855
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
|
1856
|
+
# * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
|
|
1857
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
|
1858
|
+
# trigger a retry.
|
|
1859
|
+
#
|
|
1860
|
+
class Rpcs
|
|
1861
|
+
##
|
|
1862
|
+
# RPC-specific configuration for `get_agent_anomaly_detection_scope`
|
|
1863
|
+
# @return [::Gapic::Config::Method]
|
|
1864
|
+
#
|
|
1865
|
+
attr_reader :get_agent_anomaly_detection_scope
|
|
1866
|
+
##
|
|
1867
|
+
# RPC-specific configuration for `get_monitored_agent`
|
|
1868
|
+
# @return [::Gapic::Config::Method]
|
|
1869
|
+
#
|
|
1870
|
+
attr_reader :get_monitored_agent
|
|
1871
|
+
##
|
|
1872
|
+
# RPC-specific configuration for `list_monitored_agents`
|
|
1873
|
+
# @return [::Gapic::Config::Method]
|
|
1874
|
+
#
|
|
1875
|
+
attr_reader :list_monitored_agents
|
|
1876
|
+
##
|
|
1877
|
+
# RPC-specific configuration for `enable_monitored_agent`
|
|
1878
|
+
# @return [::Gapic::Config::Method]
|
|
1879
|
+
#
|
|
1880
|
+
attr_reader :enable_monitored_agent
|
|
1881
|
+
##
|
|
1882
|
+
# RPC-specific configuration for `disable_monitored_agent`
|
|
1883
|
+
# @return [::Gapic::Config::Method]
|
|
1884
|
+
#
|
|
1885
|
+
attr_reader :disable_monitored_agent
|
|
1886
|
+
##
|
|
1887
|
+
# RPC-specific configuration for `delete_agent_anomaly_detection_scope`
|
|
1888
|
+
# @return [::Gapic::Config::Method]
|
|
1889
|
+
#
|
|
1890
|
+
attr_reader :delete_agent_anomaly_detection_scope
|
|
1891
|
+
##
|
|
1892
|
+
# RPC-specific configuration for `create_agent_anomaly_detection_scope`
|
|
1893
|
+
# @return [::Gapic::Config::Method]
|
|
1894
|
+
#
|
|
1895
|
+
attr_reader :create_agent_anomaly_detection_scope
|
|
1896
|
+
##
|
|
1897
|
+
# RPC-specific configuration for `list_agent_anomaly_detection_scopes`
|
|
1898
|
+
# @return [::Gapic::Config::Method]
|
|
1899
|
+
#
|
|
1900
|
+
attr_reader :list_agent_anomaly_detection_scopes
|
|
1901
|
+
##
|
|
1902
|
+
# RPC-specific configuration for `list_analyzed_sessions`
|
|
1903
|
+
# @return [::Gapic::Config::Method]
|
|
1904
|
+
#
|
|
1905
|
+
attr_reader :list_analyzed_sessions
|
|
1906
|
+
##
|
|
1907
|
+
# RPC-specific configuration for `get_analyzed_session`
|
|
1908
|
+
# @return [::Gapic::Config::Method]
|
|
1909
|
+
#
|
|
1910
|
+
attr_reader :get_analyzed_session
|
|
1911
|
+
##
|
|
1912
|
+
# RPC-specific configuration for `list_analyzed_invocations`
|
|
1913
|
+
# @return [::Gapic::Config::Method]
|
|
1914
|
+
#
|
|
1915
|
+
attr_reader :list_analyzed_invocations
|
|
1916
|
+
##
|
|
1917
|
+
# RPC-specific configuration for `get_analyzed_invocation`
|
|
1918
|
+
# @return [::Gapic::Config::Method]
|
|
1919
|
+
#
|
|
1920
|
+
attr_reader :get_analyzed_invocation
|
|
1921
|
+
##
|
|
1922
|
+
# RPC-specific configuration for `aggregate_analyzed_sessions`
|
|
1923
|
+
# @return [::Gapic::Config::Method]
|
|
1924
|
+
#
|
|
1925
|
+
attr_reader :aggregate_analyzed_sessions
|
|
1926
|
+
##
|
|
1927
|
+
# RPC-specific configuration for `clear_training_data`
|
|
1928
|
+
# @return [::Gapic::Config::Method]
|
|
1929
|
+
#
|
|
1930
|
+
attr_reader :clear_training_data
|
|
1931
|
+
|
|
1932
|
+
# @private
|
|
1933
|
+
def initialize parent_rpcs = nil
|
|
1934
|
+
get_agent_anomaly_detection_scope_config = parent_rpcs.get_agent_anomaly_detection_scope if parent_rpcs.respond_to? :get_agent_anomaly_detection_scope
|
|
1935
|
+
@get_agent_anomaly_detection_scope = ::Gapic::Config::Method.new get_agent_anomaly_detection_scope_config
|
|
1936
|
+
get_monitored_agent_config = parent_rpcs.get_monitored_agent if parent_rpcs.respond_to? :get_monitored_agent
|
|
1937
|
+
@get_monitored_agent = ::Gapic::Config::Method.new get_monitored_agent_config
|
|
1938
|
+
list_monitored_agents_config = parent_rpcs.list_monitored_agents if parent_rpcs.respond_to? :list_monitored_agents
|
|
1939
|
+
@list_monitored_agents = ::Gapic::Config::Method.new list_monitored_agents_config
|
|
1940
|
+
enable_monitored_agent_config = parent_rpcs.enable_monitored_agent if parent_rpcs.respond_to? :enable_monitored_agent
|
|
1941
|
+
@enable_monitored_agent = ::Gapic::Config::Method.new enable_monitored_agent_config
|
|
1942
|
+
disable_monitored_agent_config = parent_rpcs.disable_monitored_agent if parent_rpcs.respond_to? :disable_monitored_agent
|
|
1943
|
+
@disable_monitored_agent = ::Gapic::Config::Method.new disable_monitored_agent_config
|
|
1944
|
+
delete_agent_anomaly_detection_scope_config = parent_rpcs.delete_agent_anomaly_detection_scope if parent_rpcs.respond_to? :delete_agent_anomaly_detection_scope
|
|
1945
|
+
@delete_agent_anomaly_detection_scope = ::Gapic::Config::Method.new delete_agent_anomaly_detection_scope_config
|
|
1946
|
+
create_agent_anomaly_detection_scope_config = parent_rpcs.create_agent_anomaly_detection_scope if parent_rpcs.respond_to? :create_agent_anomaly_detection_scope
|
|
1947
|
+
@create_agent_anomaly_detection_scope = ::Gapic::Config::Method.new create_agent_anomaly_detection_scope_config
|
|
1948
|
+
list_agent_anomaly_detection_scopes_config = parent_rpcs.list_agent_anomaly_detection_scopes if parent_rpcs.respond_to? :list_agent_anomaly_detection_scopes
|
|
1949
|
+
@list_agent_anomaly_detection_scopes = ::Gapic::Config::Method.new list_agent_anomaly_detection_scopes_config
|
|
1950
|
+
list_analyzed_sessions_config = parent_rpcs.list_analyzed_sessions if parent_rpcs.respond_to? :list_analyzed_sessions
|
|
1951
|
+
@list_analyzed_sessions = ::Gapic::Config::Method.new list_analyzed_sessions_config
|
|
1952
|
+
get_analyzed_session_config = parent_rpcs.get_analyzed_session if parent_rpcs.respond_to? :get_analyzed_session
|
|
1953
|
+
@get_analyzed_session = ::Gapic::Config::Method.new get_analyzed_session_config
|
|
1954
|
+
list_analyzed_invocations_config = parent_rpcs.list_analyzed_invocations if parent_rpcs.respond_to? :list_analyzed_invocations
|
|
1955
|
+
@list_analyzed_invocations = ::Gapic::Config::Method.new list_analyzed_invocations_config
|
|
1956
|
+
get_analyzed_invocation_config = parent_rpcs.get_analyzed_invocation if parent_rpcs.respond_to? :get_analyzed_invocation
|
|
1957
|
+
@get_analyzed_invocation = ::Gapic::Config::Method.new get_analyzed_invocation_config
|
|
1958
|
+
aggregate_analyzed_sessions_config = parent_rpcs.aggregate_analyzed_sessions if parent_rpcs.respond_to? :aggregate_analyzed_sessions
|
|
1959
|
+
@aggregate_analyzed_sessions = ::Gapic::Config::Method.new aggregate_analyzed_sessions_config
|
|
1960
|
+
clear_training_data_config = parent_rpcs.clear_training_data if parent_rpcs.respond_to? :clear_training_data
|
|
1961
|
+
@clear_training_data = ::Gapic::Config::Method.new clear_training_data_config
|
|
1962
|
+
|
|
1963
|
+
yield self if block_given?
|
|
1964
|
+
end
|
|
1965
|
+
end
|
|
1966
|
+
end
|
|
1967
|
+
end
|
|
1968
|
+
end
|
|
1969
|
+
end
|
|
1970
|
+
end
|
|
1971
|
+
end
|
|
1972
|
+
end
|