azure_cognitiveservices_anomalydetector 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/lib/1.0/generated/azure_cognitiveservices_anomalydetector.rb +33 -0
- data/lib/1.0/generated/azure_cognitiveservices_anomalydetector/anomaly_detector_client.rb +349 -0
- data/lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/apierror.rb +58 -0
- data/lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/entire_detect_response.rb +183 -0
- data/lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/granularity.rb +20 -0
- data/lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/last_detect_response.rb +139 -0
- data/lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/point.rb +58 -0
- data/lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/request.rb +125 -0
- data/lib/1.0/generated/azure_cognitiveservices_anomalydetector/module_definition.rb +9 -0
- data/lib/azure_cognitiveservices_anomalydetector.rb +6 -0
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/latest/anomalydetector_latest_profile_client.rb +38 -0
- data/lib/profiles/latest/anomalydetector_module_definition.rb +8 -0
- data/lib/profiles/latest/modules/anomalydetector_profile_module.rb +81 -0
- data/lib/version.rb +7 -0
- metadata +136 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 7e42daee11375052da90aee65ba69bcd1f8887a28b9bc669dfb081cfe00ab95f
|
4
|
+
data.tar.gz: 159006fa4459921bee9a0607ffc0d1cd15340c6f02efd20aca083e46243e472d
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 489745f9b1c20783ee5d071f019abe29a1ce6fd1f7a1706e6c3e70e7b0e34748ddadd3dbc56117e45da9caa6a3584fc7d0e0d417678de61b8fc905949335c82e
|
7
|
+
data.tar.gz: 1b9fd493514be4ea12307a17ab60d03b6b76ec0357943676ad4f5ba530a8f58b35076cafd566a8e181cf577a69b5fd5d61b0e2e5201e208a25d46458a2b97a6d
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Microsoft Corporation
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
require 'uri'
|
7
|
+
require 'cgi'
|
8
|
+
require 'date'
|
9
|
+
require 'json'
|
10
|
+
require 'base64'
|
11
|
+
require 'erb'
|
12
|
+
require 'securerandom'
|
13
|
+
require 'time'
|
14
|
+
require 'timeliness'
|
15
|
+
require 'faraday'
|
16
|
+
require 'faraday-cookie_jar'
|
17
|
+
require 'concurrent'
|
18
|
+
require 'ms_rest'
|
19
|
+
require '1.0/generated/azure_cognitiveservices_anomalydetector/module_definition'
|
20
|
+
require 'ms_rest_azure'
|
21
|
+
|
22
|
+
module Azure::CognitiveServices::AnomalyDetector::V1_0
|
23
|
+
autoload :AnomalyDetectorClient, '1.0/generated/azure_cognitiveservices_anomalydetector/anomaly_detector_client.rb'
|
24
|
+
|
25
|
+
module Models
|
26
|
+
autoload :Request, '1.0/generated/azure_cognitiveservices_anomalydetector/models/request.rb'
|
27
|
+
autoload :EntireDetectResponse, '1.0/generated/azure_cognitiveservices_anomalydetector/models/entire_detect_response.rb'
|
28
|
+
autoload :Point, '1.0/generated/azure_cognitiveservices_anomalydetector/models/point.rb'
|
29
|
+
autoload :LastDetectResponse, '1.0/generated/azure_cognitiveservices_anomalydetector/models/last_detect_response.rb'
|
30
|
+
autoload :APIError, '1.0/generated/azure_cognitiveservices_anomalydetector/models/apierror.rb'
|
31
|
+
autoload :Granularity, '1.0/generated/azure_cognitiveservices_anomalydetector/models/granularity.rb'
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,349 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::CognitiveServices::AnomalyDetector::V1_0
|
7
|
+
#
|
8
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class AnomalyDetectorClient < MsRestAzure::AzureServiceClient
|
11
|
+
include MsRestAzure
|
12
|
+
include MsRestAzure::Serialization
|
13
|
+
|
14
|
+
# @return [String] the base URI of the service.
|
15
|
+
attr_reader :base_url
|
16
|
+
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
18
|
+
attr_reader :credentials1
|
19
|
+
|
20
|
+
# @return [String] Supported Cognitive Services endpoints (protocol and
|
21
|
+
# hostname, for example: https://westus2.api.cognitive.microsoft.com).
|
22
|
+
attr_accessor :endpoint
|
23
|
+
|
24
|
+
# @return Subscription credentials which uniquely identify client
|
25
|
+
# subscription.
|
26
|
+
attr_accessor :credentials
|
27
|
+
|
28
|
+
# @return [String] The preferred language for the response.
|
29
|
+
attr_accessor :accept_language
|
30
|
+
|
31
|
+
# @return [Integer] The retry timeout in seconds for Long Running
|
32
|
+
# Operations. Default value is 30.
|
33
|
+
attr_accessor :long_running_operation_retry_timeout
|
34
|
+
|
35
|
+
# @return [Boolean] Whether a unique x-ms-client-request-id should be
|
36
|
+
# generated. When set to true a unique x-ms-client-request-id value is
|
37
|
+
# generated and included in each request. Default is true.
|
38
|
+
attr_accessor :generate_client_request_id
|
39
|
+
|
40
|
+
#
|
41
|
+
# Creates initializes a new instance of the AnomalyDetectorClient class.
|
42
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
43
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
44
|
+
#
|
45
|
+
def initialize(credentials = nil, options = nil)
|
46
|
+
super(credentials, options)
|
47
|
+
@base_url = '{Endpoint}/anomalydetector/v1.0'
|
48
|
+
|
49
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
50
|
+
@credentials = credentials
|
51
|
+
|
52
|
+
@accept_language = 'en-US'
|
53
|
+
@long_running_operation_retry_timeout = 30
|
54
|
+
@generate_client_request_id = true
|
55
|
+
add_telemetry
|
56
|
+
end
|
57
|
+
|
58
|
+
#
|
59
|
+
# Makes a request and returns the body of the response.
|
60
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
61
|
+
# @param path [String] the path, relative to {base_url}.
|
62
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
63
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
64
|
+
# Example:
|
65
|
+
#
|
66
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
67
|
+
# path = "/path"
|
68
|
+
# options = {
|
69
|
+
# body: request_content,
|
70
|
+
# query_params: {'api-version' => '2016-02-01'}
|
71
|
+
# }
|
72
|
+
# result = @client.make_request(:put, path, options)
|
73
|
+
#
|
74
|
+
def make_request(method, path, options = {})
|
75
|
+
result = make_request_with_http_info(method, path, options)
|
76
|
+
result.body unless result.nil?
|
77
|
+
end
|
78
|
+
|
79
|
+
#
|
80
|
+
# Makes a request and returns the operation response.
|
81
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
82
|
+
# @param path [String] the path, relative to {base_url}.
|
83
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
84
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
85
|
+
#
|
86
|
+
def make_request_with_http_info(method, path, options = {})
|
87
|
+
result = make_request_async(method, path, options).value!
|
88
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
89
|
+
result
|
90
|
+
end
|
91
|
+
|
92
|
+
#
|
93
|
+
# Makes a request asynchronously.
|
94
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
95
|
+
# @param path [String] the path, relative to {base_url}.
|
96
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
97
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
98
|
+
#
|
99
|
+
def make_request_async(method, path, options = {})
|
100
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
101
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
102
|
+
|
103
|
+
request_url = options[:base_url] || @base_url
|
104
|
+
if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
|
105
|
+
@request_headers['Content-Type'] = options[:headers]['Content-Type']
|
106
|
+
end
|
107
|
+
|
108
|
+
request_headers = @request_headers
|
109
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
110
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
111
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
112
|
+
|
113
|
+
super(request_url, method, path, options)
|
114
|
+
end
|
115
|
+
|
116
|
+
#
|
117
|
+
# Detect anomalies for the entire series in batch.
|
118
|
+
#
|
119
|
+
# This operation generates a model using an entire series, each point is
|
120
|
+
# detected with the same model. With this method, points before and after a
|
121
|
+
# certain point are used to determine whether it is an anomaly. The entire
|
122
|
+
# detection can give user an overall status of the time series.
|
123
|
+
#
|
124
|
+
# @param body [Request] Time series points and period if needed. Advanced model
|
125
|
+
# parameters can also be set in the request.
|
126
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
127
|
+
# will be added to the HTTP request.
|
128
|
+
#
|
129
|
+
# @return [EntireDetectResponse] operation results.
|
130
|
+
#
|
131
|
+
def entire_detect(body, custom_headers:nil)
|
132
|
+
response = entire_detect_async(body, custom_headers:custom_headers).value!
|
133
|
+
response.body unless response.nil?
|
134
|
+
end
|
135
|
+
|
136
|
+
#
|
137
|
+
# Detect anomalies for the entire series in batch.
|
138
|
+
#
|
139
|
+
# This operation generates a model using an entire series, each point is
|
140
|
+
# detected with the same model. With this method, points before and after a
|
141
|
+
# certain point are used to determine whether it is an anomaly. The entire
|
142
|
+
# detection can give user an overall status of the time series.
|
143
|
+
#
|
144
|
+
# @param body [Request] Time series points and period if needed. Advanced model
|
145
|
+
# parameters can also be set in the request.
|
146
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
147
|
+
# will be added to the HTTP request.
|
148
|
+
#
|
149
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
150
|
+
#
|
151
|
+
def entire_detect_with_http_info(body, custom_headers:nil)
|
152
|
+
entire_detect_async(body, custom_headers:custom_headers).value!
|
153
|
+
end
|
154
|
+
|
155
|
+
#
|
156
|
+
# Detect anomalies for the entire series in batch.
|
157
|
+
#
|
158
|
+
# This operation generates a model using an entire series, each point is
|
159
|
+
# detected with the same model. With this method, points before and after a
|
160
|
+
# certain point are used to determine whether it is an anomaly. The entire
|
161
|
+
# detection can give user an overall status of the time series.
|
162
|
+
#
|
163
|
+
# @param body [Request] Time series points and period if needed. Advanced model
|
164
|
+
# parameters can also be set in the request.
|
165
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
166
|
+
# to the HTTP request.
|
167
|
+
#
|
168
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
169
|
+
#
|
170
|
+
def entire_detect_async(body, custom_headers:nil)
|
171
|
+
fail ArgumentError, 'endpoint is nil' if endpoint.nil?
|
172
|
+
fail ArgumentError, 'body is nil' if body.nil?
|
173
|
+
|
174
|
+
|
175
|
+
request_headers = {}
|
176
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
177
|
+
|
178
|
+
# Set Headers
|
179
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
180
|
+
request_headers['accept-language'] = accept_language unless accept_language.nil?
|
181
|
+
|
182
|
+
# Serialize Request
|
183
|
+
request_mapper = Azure::CognitiveServices::AnomalyDetector::V1_0::Models::Request.mapper()
|
184
|
+
request_content = self.serialize(request_mapper, body)
|
185
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
186
|
+
|
187
|
+
path_template = 'timeseries/entire/detect'
|
188
|
+
|
189
|
+
request_url = @base_url || self.base_url
|
190
|
+
request_url = request_url.gsub('{Endpoint}', endpoint)
|
191
|
+
|
192
|
+
options = {
|
193
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
194
|
+
body: request_content,
|
195
|
+
headers: request_headers.merge(custom_headers || {}),
|
196
|
+
base_url: request_url
|
197
|
+
}
|
198
|
+
promise = self.make_request_async(:post, path_template, options)
|
199
|
+
|
200
|
+
promise = promise.then do |result|
|
201
|
+
http_response = result.response
|
202
|
+
status_code = http_response.status
|
203
|
+
response_content = http_response.body
|
204
|
+
unless status_code == 200
|
205
|
+
error_model = JSON.load(response_content)
|
206
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
207
|
+
end
|
208
|
+
|
209
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
210
|
+
# Deserialize Response
|
211
|
+
if status_code == 200
|
212
|
+
begin
|
213
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
214
|
+
result_mapper = Azure::CognitiveServices::AnomalyDetector::V1_0::Models::EntireDetectResponse.mapper()
|
215
|
+
result.body = self.deserialize(result_mapper, parsed_response)
|
216
|
+
rescue Exception => e
|
217
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
result
|
222
|
+
end
|
223
|
+
|
224
|
+
promise.execute
|
225
|
+
end
|
226
|
+
|
227
|
+
#
|
228
|
+
# Detect anomaly status of the latest point in time series.
|
229
|
+
#
|
230
|
+
# This operation generates a model using points before the latest one. With
|
231
|
+
# this method, only historical points are used to determine whether the target
|
232
|
+
# point is an anomaly. The latest point detecting operation matches the
|
233
|
+
# scenario of real-time monitoring of business metrics.
|
234
|
+
#
|
235
|
+
# @param body [Request] Time series points and period if needed. Advanced model
|
236
|
+
# parameters can also be set in the request.
|
237
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
238
|
+
# will be added to the HTTP request.
|
239
|
+
#
|
240
|
+
# @return [LastDetectResponse] operation results.
|
241
|
+
#
|
242
|
+
def last_detect(body, custom_headers:nil)
|
243
|
+
response = last_detect_async(body, custom_headers:custom_headers).value!
|
244
|
+
response.body unless response.nil?
|
245
|
+
end
|
246
|
+
|
247
|
+
#
|
248
|
+
# Detect anomaly status of the latest point in time series.
|
249
|
+
#
|
250
|
+
# This operation generates a model using points before the latest one. With
|
251
|
+
# this method, only historical points are used to determine whether the target
|
252
|
+
# point is an anomaly. The latest point detecting operation matches the
|
253
|
+
# scenario of real-time monitoring of business metrics.
|
254
|
+
#
|
255
|
+
# @param body [Request] Time series points and period if needed. Advanced model
|
256
|
+
# parameters can also be set in the request.
|
257
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
258
|
+
# will be added to the HTTP request.
|
259
|
+
#
|
260
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
261
|
+
#
|
262
|
+
def last_detect_with_http_info(body, custom_headers:nil)
|
263
|
+
last_detect_async(body, custom_headers:custom_headers).value!
|
264
|
+
end
|
265
|
+
|
266
|
+
#
|
267
|
+
# Detect anomaly status of the latest point in time series.
|
268
|
+
#
|
269
|
+
# This operation generates a model using points before the latest one. With
|
270
|
+
# this method, only historical points are used to determine whether the target
|
271
|
+
# point is an anomaly. The latest point detecting operation matches the
|
272
|
+
# scenario of real-time monitoring of business metrics.
|
273
|
+
#
|
274
|
+
# @param body [Request] Time series points and period if needed. Advanced model
|
275
|
+
# parameters can also be set in the request.
|
276
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
277
|
+
# to the HTTP request.
|
278
|
+
#
|
279
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
280
|
+
#
|
281
|
+
def last_detect_async(body, custom_headers:nil)
|
282
|
+
fail ArgumentError, 'endpoint is nil' if endpoint.nil?
|
283
|
+
fail ArgumentError, 'body is nil' if body.nil?
|
284
|
+
|
285
|
+
|
286
|
+
request_headers = {}
|
287
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
288
|
+
|
289
|
+
# Set Headers
|
290
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
291
|
+
request_headers['accept-language'] = accept_language unless accept_language.nil?
|
292
|
+
|
293
|
+
# Serialize Request
|
294
|
+
request_mapper = Azure::CognitiveServices::AnomalyDetector::V1_0::Models::Request.mapper()
|
295
|
+
request_content = self.serialize(request_mapper, body)
|
296
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
297
|
+
|
298
|
+
path_template = 'timeseries/last/detect'
|
299
|
+
|
300
|
+
request_url = @base_url || self.base_url
|
301
|
+
request_url = request_url.gsub('{Endpoint}', endpoint)
|
302
|
+
|
303
|
+
options = {
|
304
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
305
|
+
body: request_content,
|
306
|
+
headers: request_headers.merge(custom_headers || {}),
|
307
|
+
base_url: request_url
|
308
|
+
}
|
309
|
+
promise = self.make_request_async(:post, path_template, options)
|
310
|
+
|
311
|
+
promise = promise.then do |result|
|
312
|
+
http_response = result.response
|
313
|
+
status_code = http_response.status
|
314
|
+
response_content = http_response.body
|
315
|
+
unless status_code == 200
|
316
|
+
error_model = JSON.load(response_content)
|
317
|
+
fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
|
318
|
+
end
|
319
|
+
|
320
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
321
|
+
# Deserialize Response
|
322
|
+
if status_code == 200
|
323
|
+
begin
|
324
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
325
|
+
result_mapper = Azure::CognitiveServices::AnomalyDetector::V1_0::Models::LastDetectResponse.mapper()
|
326
|
+
result.body = self.deserialize(result_mapper, parsed_response)
|
327
|
+
rescue Exception => e
|
328
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
329
|
+
end
|
330
|
+
end
|
331
|
+
|
332
|
+
result
|
333
|
+
end
|
334
|
+
|
335
|
+
promise.execute
|
336
|
+
end
|
337
|
+
|
338
|
+
|
339
|
+
private
|
340
|
+
#
|
341
|
+
# Adds telemetry information.
|
342
|
+
#
|
343
|
+
def add_telemetry
|
344
|
+
sdk_information = 'azure_cognitiveservices_anomalydetector'
|
345
|
+
sdk_information = "#{sdk_information}/0.17.0"
|
346
|
+
add_user_agent_information(sdk_information)
|
347
|
+
end
|
348
|
+
end
|
349
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::CognitiveServices::AnomalyDetector::V1_0
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Error information returned by the API.
|
10
|
+
#
|
11
|
+
class APIError
|
12
|
+
|
13
|
+
include MsRestAzure
|
14
|
+
|
15
|
+
# @return The error code.
|
16
|
+
attr_accessor :code
|
17
|
+
|
18
|
+
# @return [String] A message explaining the error reported by the
|
19
|
+
# service.
|
20
|
+
attr_accessor :message
|
21
|
+
|
22
|
+
|
23
|
+
#
|
24
|
+
# Mapper for APIError class as Ruby Hash.
|
25
|
+
# This will be used for serialization/deserialization.
|
26
|
+
#
|
27
|
+
def self.mapper()
|
28
|
+
{
|
29
|
+
client_side_validation: true,
|
30
|
+
required: false,
|
31
|
+
serialized_name: 'APIError',
|
32
|
+
type: {
|
33
|
+
name: 'Composite',
|
34
|
+
class_name: 'APIError',
|
35
|
+
model_properties: {
|
36
|
+
code: {
|
37
|
+
client_side_validation: true,
|
38
|
+
required: false,
|
39
|
+
serialized_name: 'code',
|
40
|
+
type: {
|
41
|
+
name: 'Object'
|
42
|
+
}
|
43
|
+
},
|
44
|
+
message: {
|
45
|
+
client_side_validation: true,
|
46
|
+
required: false,
|
47
|
+
serialized_name: 'message',
|
48
|
+
type: {
|
49
|
+
name: 'String'
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
data/lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/entire_detect_response.rb
ADDED
@@ -0,0 +1,183 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::CognitiveServices::AnomalyDetector::V1_0
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Model object.
|
10
|
+
#
|
11
|
+
#
|
12
|
+
class EntireDetectResponse
|
13
|
+
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
# @return [Integer] Frequency extracted from the series, zero means no
|
17
|
+
# recurrent pattern has been found.
|
18
|
+
attr_accessor :period
|
19
|
+
|
20
|
+
# @return [Array<Float>] ExpectedValues contain expected value for each
|
21
|
+
# input point. The index of the array is consistent with the input
|
22
|
+
# series.
|
23
|
+
attr_accessor :expected_values
|
24
|
+
|
25
|
+
# @return [Array<Float>] UpperMargins contain upper margin of each input
|
26
|
+
# point. UpperMargin is used to calculate upperBoundary, which equals to
|
27
|
+
# expectedValue + (100 - marginScale)*upperMargin. Anomalies in response
|
28
|
+
# can be filtered by upperBoundary and lowerBoundary. By adjusting
|
29
|
+
# marginScale value, less significant anomalies can be filtered in client
|
30
|
+
# side. The index of the array is consistent with the input series.
|
31
|
+
attr_accessor :upper_margins
|
32
|
+
|
33
|
+
# @return [Array<Float>] LowerMargins contain lower margin of each input
|
34
|
+
# point. LowerMargin is used to calculate lowerBoundary, which equals to
|
35
|
+
# expectedValue - (100 - marginScale)*lowerMargin. Points between the
|
36
|
+
# boundary can be marked as normal ones in client side. The index of the
|
37
|
+
# array is consistent with the input series.
|
38
|
+
attr_accessor :lower_margins
|
39
|
+
|
40
|
+
# @return [Array<Boolean>] IsAnomaly contains anomaly properties for each
|
41
|
+
# input point. True means an anomaly either negative or positive has been
|
42
|
+
# detected. The index of the array is consistent with the input series.
|
43
|
+
attr_accessor :is_anomaly
|
44
|
+
|
45
|
+
# @return [Array<Boolean>] IsNegativeAnomaly contains anomaly status in
|
46
|
+
# negative direction for each input point. True means a negative anomaly
|
47
|
+
# has been detected. A negative anomaly means the point is detected as an
|
48
|
+
# anomaly and its real value is smaller than the expected one. The index
|
49
|
+
# of the array is consistent with the input series.
|
50
|
+
attr_accessor :is_negative_anomaly
|
51
|
+
|
52
|
+
# @return [Array<Boolean>] IsPositiveAnomaly contain anomaly status in
|
53
|
+
# positive direction for each input point. True means a positive anomaly
|
54
|
+
# has been detected. A positive anomaly means the point is detected as an
|
55
|
+
# anomaly and its real value is larger than the expected one. The index
|
56
|
+
# of the array is consistent with the input series.
|
57
|
+
attr_accessor :is_positive_anomaly
|
58
|
+
|
59
|
+
|
60
|
+
#
|
61
|
+
# Mapper for EntireDetectResponse class as Ruby Hash.
|
62
|
+
# This will be used for serialization/deserialization.
|
63
|
+
#
|
64
|
+
def self.mapper()
|
65
|
+
{
|
66
|
+
client_side_validation: true,
|
67
|
+
required: false,
|
68
|
+
serialized_name: 'EntireDetectResponse',
|
69
|
+
type: {
|
70
|
+
name: 'Composite',
|
71
|
+
class_name: 'EntireDetectResponse',
|
72
|
+
model_properties: {
|
73
|
+
period: {
|
74
|
+
client_side_validation: true,
|
75
|
+
required: true,
|
76
|
+
serialized_name: 'period',
|
77
|
+
type: {
|
78
|
+
name: 'Number'
|
79
|
+
}
|
80
|
+
},
|
81
|
+
expected_values: {
|
82
|
+
client_side_validation: true,
|
83
|
+
required: true,
|
84
|
+
serialized_name: 'expectedValues',
|
85
|
+
type: {
|
86
|
+
name: 'Sequence',
|
87
|
+
element: {
|
88
|
+
client_side_validation: true,
|
89
|
+
required: false,
|
90
|
+
serialized_name: 'FloatElementType',
|
91
|
+
type: {
|
92
|
+
name: 'Double'
|
93
|
+
}
|
94
|
+
}
|
95
|
+
}
|
96
|
+
},
|
97
|
+
upper_margins: {
|
98
|
+
client_side_validation: true,
|
99
|
+
required: true,
|
100
|
+
serialized_name: 'upperMargins',
|
101
|
+
type: {
|
102
|
+
name: 'Sequence',
|
103
|
+
element: {
|
104
|
+
client_side_validation: true,
|
105
|
+
required: false,
|
106
|
+
serialized_name: 'FloatElementType',
|
107
|
+
type: {
|
108
|
+
name: 'Double'
|
109
|
+
}
|
110
|
+
}
|
111
|
+
}
|
112
|
+
},
|
113
|
+
lower_margins: {
|
114
|
+
client_side_validation: true,
|
115
|
+
required: true,
|
116
|
+
serialized_name: 'lowerMargins',
|
117
|
+
type: {
|
118
|
+
name: 'Sequence',
|
119
|
+
element: {
|
120
|
+
client_side_validation: true,
|
121
|
+
required: false,
|
122
|
+
serialized_name: 'FloatElementType',
|
123
|
+
type: {
|
124
|
+
name: 'Double'
|
125
|
+
}
|
126
|
+
}
|
127
|
+
}
|
128
|
+
},
|
129
|
+
is_anomaly: {
|
130
|
+
client_side_validation: true,
|
131
|
+
required: true,
|
132
|
+
serialized_name: 'isAnomaly',
|
133
|
+
type: {
|
134
|
+
name: 'Sequence',
|
135
|
+
element: {
|
136
|
+
client_side_validation: true,
|
137
|
+
required: false,
|
138
|
+
serialized_name: 'BooleanElementType',
|
139
|
+
type: {
|
140
|
+
name: 'Boolean'
|
141
|
+
}
|
142
|
+
}
|
143
|
+
}
|
144
|
+
},
|
145
|
+
is_negative_anomaly: {
|
146
|
+
client_side_validation: true,
|
147
|
+
required: true,
|
148
|
+
serialized_name: 'isNegativeAnomaly',
|
149
|
+
type: {
|
150
|
+
name: 'Sequence',
|
151
|
+
element: {
|
152
|
+
client_side_validation: true,
|
153
|
+
required: false,
|
154
|
+
serialized_name: 'BooleanElementType',
|
155
|
+
type: {
|
156
|
+
name: 'Boolean'
|
157
|
+
}
|
158
|
+
}
|
159
|
+
}
|
160
|
+
},
|
161
|
+
is_positive_anomaly: {
|
162
|
+
client_side_validation: true,
|
163
|
+
required: true,
|
164
|
+
serialized_name: 'isPositiveAnomaly',
|
165
|
+
type: {
|
166
|
+
name: 'Sequence',
|
167
|
+
element: {
|
168
|
+
client_side_validation: true,
|
169
|
+
required: false,
|
170
|
+
serialized_name: 'BooleanElementType',
|
171
|
+
type: {
|
172
|
+
name: 'Boolean'
|
173
|
+
}
|
174
|
+
}
|
175
|
+
}
|
176
|
+
}
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::CognitiveServices::AnomalyDetector::V1_0
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Defines values for Granularity
|
10
|
+
#
|
11
|
+
module Granularity
|
12
|
+
Yearly = "yearly"
|
13
|
+
Monthly = "monthly"
|
14
|
+
Weekly = "weekly"
|
15
|
+
Daily = "daily"
|
16
|
+
Hourly = "hourly"
|
17
|
+
Minutely = "minutely"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,139 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::CognitiveServices::AnomalyDetector::V1_0
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Model object.
|
10
|
+
#
|
11
|
+
#
|
12
|
+
class LastDetectResponse
|
13
|
+
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
# @return [Integer] Frequency extracted from the series, zero means no
|
17
|
+
# recurrent pattern has been found.
|
18
|
+
attr_accessor :period
|
19
|
+
|
20
|
+
# @return [Integer] Suggested input series points needed for detecting
|
21
|
+
# the latest point.
|
22
|
+
attr_accessor :suggested_window
|
23
|
+
|
24
|
+
# @return [Float] Expected value of the latest point.
|
25
|
+
attr_accessor :expected_value
|
26
|
+
|
27
|
+
# @return [Float] Upper margin of the latest point. UpperMargin is used
|
28
|
+
# to calculate upperBoundary, which equals to expectedValue + (100 -
|
29
|
+
# marginScale)*upperMargin. If the value of latest point is between
|
30
|
+
# upperBoundary and lowerBoundary, it should be treated as normal value.
|
31
|
+
# By adjusting marginScale value, anomaly status of latest point can be
|
32
|
+
# changed.
|
33
|
+
attr_accessor :upper_margin
|
34
|
+
|
35
|
+
# @return [Float] Lower margin of the latest point. LowerMargin is used
|
36
|
+
# to calculate lowerBoundary, which equals to expectedValue - (100 -
|
37
|
+
# marginScale)*lowerMargin.
|
38
|
+
attr_accessor :lower_margin
|
39
|
+
|
40
|
+
# @return [Boolean] Anomaly status of the latest point, true means the
|
41
|
+
# latest point is an anomaly either in negative direction or positive
|
42
|
+
# direction.
|
43
|
+
attr_accessor :is_anomaly
|
44
|
+
|
45
|
+
# @return [Boolean] Anomaly status in negative direction of the latest
|
46
|
+
# point. True means the latest point is an anomaly and its real value is
|
47
|
+
# smaller than the expected one.
|
48
|
+
attr_accessor :is_negative_anomaly
|
49
|
+
|
50
|
+
# @return [Boolean] Anomaly status in positive direction of the latest
|
51
|
+
# point. True means the latest point is an anomaly and its real value is
|
52
|
+
# larger than the expected one.
|
53
|
+
attr_accessor :is_positive_anomaly
|
54
|
+
|
55
|
+
|
56
|
+
#
|
57
|
+
# Mapper for LastDetectResponse class as Ruby Hash.
|
58
|
+
# This will be used for serialization/deserialization.
|
59
|
+
#
|
60
|
+
def self.mapper()
|
61
|
+
{
|
62
|
+
client_side_validation: true,
|
63
|
+
required: false,
|
64
|
+
serialized_name: 'LastDetectResponse',
|
65
|
+
type: {
|
66
|
+
name: 'Composite',
|
67
|
+
class_name: 'LastDetectResponse',
|
68
|
+
model_properties: {
|
69
|
+
period: {
|
70
|
+
client_side_validation: true,
|
71
|
+
required: true,
|
72
|
+
serialized_name: 'period',
|
73
|
+
type: {
|
74
|
+
name: 'Number'
|
75
|
+
}
|
76
|
+
},
|
77
|
+
suggested_window: {
|
78
|
+
client_side_validation: true,
|
79
|
+
required: true,
|
80
|
+
serialized_name: 'suggestedWindow',
|
81
|
+
type: {
|
82
|
+
name: 'Number'
|
83
|
+
}
|
84
|
+
},
|
85
|
+
expected_value: {
|
86
|
+
client_side_validation: true,
|
87
|
+
required: true,
|
88
|
+
serialized_name: 'expectedValue',
|
89
|
+
type: {
|
90
|
+
name: 'Double'
|
91
|
+
}
|
92
|
+
},
|
93
|
+
upper_margin: {
|
94
|
+
client_side_validation: true,
|
95
|
+
required: true,
|
96
|
+
serialized_name: 'upperMargin',
|
97
|
+
type: {
|
98
|
+
name: 'Double'
|
99
|
+
}
|
100
|
+
},
|
101
|
+
lower_margin: {
|
102
|
+
client_side_validation: true,
|
103
|
+
required: true,
|
104
|
+
serialized_name: 'lowerMargin',
|
105
|
+
type: {
|
106
|
+
name: 'Double'
|
107
|
+
}
|
108
|
+
},
|
109
|
+
is_anomaly: {
|
110
|
+
client_side_validation: true,
|
111
|
+
required: true,
|
112
|
+
serialized_name: 'isAnomaly',
|
113
|
+
type: {
|
114
|
+
name: 'Boolean'
|
115
|
+
}
|
116
|
+
},
|
117
|
+
is_negative_anomaly: {
|
118
|
+
client_side_validation: true,
|
119
|
+
required: true,
|
120
|
+
serialized_name: 'isNegativeAnomaly',
|
121
|
+
type: {
|
122
|
+
name: 'Boolean'
|
123
|
+
}
|
124
|
+
},
|
125
|
+
is_positive_anomaly: {
|
126
|
+
client_side_validation: true,
|
127
|
+
required: true,
|
128
|
+
serialized_name: 'isPositiveAnomaly',
|
129
|
+
type: {
|
130
|
+
name: 'Boolean'
|
131
|
+
}
|
132
|
+
}
|
133
|
+
}
|
134
|
+
}
|
135
|
+
}
|
136
|
+
end
|
137
|
+
end
|
138
|
+
end
|
139
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::CognitiveServices::AnomalyDetector::V1_0
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Model object.
|
10
|
+
#
|
11
|
+
#
|
12
|
+
class Point
|
13
|
+
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
# @return [DateTime] Timestamp of a data point (ISO8601 format).
|
17
|
+
attr_accessor :timestamp
|
18
|
+
|
19
|
+
# @return [Float] The measurement of that point, should be float.
|
20
|
+
attr_accessor :value
|
21
|
+
|
22
|
+
|
23
|
+
#
|
24
|
+
# Mapper for Point class as Ruby Hash.
|
25
|
+
# This will be used for serialization/deserialization.
|
26
|
+
#
|
27
|
+
def self.mapper()
|
28
|
+
{
|
29
|
+
client_side_validation: true,
|
30
|
+
required: false,
|
31
|
+
serialized_name: 'Point',
|
32
|
+
type: {
|
33
|
+
name: 'Composite',
|
34
|
+
class_name: 'Point',
|
35
|
+
model_properties: {
|
36
|
+
timestamp: {
|
37
|
+
client_side_validation: true,
|
38
|
+
required: true,
|
39
|
+
serialized_name: 'timestamp',
|
40
|
+
type: {
|
41
|
+
name: 'DateTime'
|
42
|
+
}
|
43
|
+
},
|
44
|
+
value: {
|
45
|
+
client_side_validation: true,
|
46
|
+
required: true,
|
47
|
+
serialized_name: 'value',
|
48
|
+
type: {
|
49
|
+
name: 'Double'
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,125 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::CognitiveServices::AnomalyDetector::V1_0
|
7
|
+
module Models
|
8
|
+
#
|
9
|
+
# Model object.
|
10
|
+
#
|
11
|
+
#
|
12
|
+
class Request
|
13
|
+
|
14
|
+
include MsRestAzure
|
15
|
+
|
16
|
+
# @return [Array<Point>] Time series data points. Points should be sorted
|
17
|
+
# by timestamp in ascending order to match the anomaly detection result.
|
18
|
+
# If the data is not sorted correctly or there is duplicated timestamp,
|
19
|
+
# the API will not work. In such case, an error message will be returned.
|
20
|
+
attr_accessor :series
|
21
|
+
|
22
|
+
# @return [Granularity] Can only be one of yearly, monthly, weekly,
|
23
|
+
# daily, hourly or minutely. Granularity is used for verify whether input
|
24
|
+
# series is valid. Possible values include: 'yearly', 'monthly',
|
25
|
+
# 'weekly', 'daily', 'hourly', 'minutely'
|
26
|
+
attr_accessor :granularity
|
27
|
+
|
28
|
+
# @return [Integer] Custom Interval is used to set non-standard time
|
29
|
+
# interval, for example, if the series is 5 minutes, request can be set
|
30
|
+
# as {"granularity":"minutely", "customInterval":5}.
|
31
|
+
attr_accessor :custom_interval
|
32
|
+
|
33
|
+
# @return [Integer] Optional argument, periodic value of a time series.
|
34
|
+
# If the value is null or does not present, the API will determine the
|
35
|
+
# period automatically.
|
36
|
+
attr_accessor :period
|
37
|
+
|
38
|
+
# @return [Float] Optional argument, advanced model parameter, max
|
39
|
+
# anomaly ratio in a time series.
|
40
|
+
attr_accessor :max_anomaly_ratio
|
41
|
+
|
42
|
+
# @return [Integer] Optional argument, advanced model parameter, between
|
43
|
+
# 0-99, the lower the value is, the larger the margin value will be which
|
44
|
+
# means less anomalies will be accepted.
|
45
|
+
attr_accessor :sensitivity
|
46
|
+
|
47
|
+
|
48
|
+
#
|
49
|
+
# Mapper for Request class as Ruby Hash.
|
50
|
+
# This will be used for serialization/deserialization.
|
51
|
+
#
|
52
|
+
def self.mapper()
|
53
|
+
{
|
54
|
+
client_side_validation: true,
|
55
|
+
required: false,
|
56
|
+
serialized_name: 'Request',
|
57
|
+
type: {
|
58
|
+
name: 'Composite',
|
59
|
+
class_name: 'Request',
|
60
|
+
model_properties: {
|
61
|
+
series: {
|
62
|
+
client_side_validation: true,
|
63
|
+
required: true,
|
64
|
+
serialized_name: 'series',
|
65
|
+
type: {
|
66
|
+
name: 'Sequence',
|
67
|
+
element: {
|
68
|
+
client_side_validation: true,
|
69
|
+
required: false,
|
70
|
+
serialized_name: 'PointElementType',
|
71
|
+
type: {
|
72
|
+
name: 'Composite',
|
73
|
+
class_name: 'Point'
|
74
|
+
}
|
75
|
+
}
|
76
|
+
}
|
77
|
+
},
|
78
|
+
granularity: {
|
79
|
+
client_side_validation: true,
|
80
|
+
required: true,
|
81
|
+
serialized_name: 'granularity',
|
82
|
+
type: {
|
83
|
+
name: 'Enum',
|
84
|
+
module: 'Granularity'
|
85
|
+
}
|
86
|
+
},
|
87
|
+
custom_interval: {
|
88
|
+
client_side_validation: true,
|
89
|
+
required: false,
|
90
|
+
serialized_name: 'customInterval',
|
91
|
+
type: {
|
92
|
+
name: 'Number'
|
93
|
+
}
|
94
|
+
},
|
95
|
+
period: {
|
96
|
+
client_side_validation: true,
|
97
|
+
required: false,
|
98
|
+
serialized_name: 'period',
|
99
|
+
type: {
|
100
|
+
name: 'Number'
|
101
|
+
}
|
102
|
+
},
|
103
|
+
max_anomaly_ratio: {
|
104
|
+
client_side_validation: true,
|
105
|
+
required: false,
|
106
|
+
serialized_name: 'maxAnomalyRatio',
|
107
|
+
type: {
|
108
|
+
name: 'Double'
|
109
|
+
}
|
110
|
+
},
|
111
|
+
sensitivity: {
|
112
|
+
client_side_validation: true,
|
113
|
+
required: false,
|
114
|
+
serialized_name: 'sensitivity',
|
115
|
+
type: {
|
116
|
+
name: 'Number'
|
117
|
+
}
|
118
|
+
}
|
119
|
+
}
|
120
|
+
}
|
121
|
+
}
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure end
|
7
|
+
module Azure::CognitiveServices end
|
8
|
+
module Azure::CognitiveServices::AnomalyDetector end
|
9
|
+
module Azure::CognitiveServices::AnomalyDetector::V1_0 end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
require '1.0/generated/azure_cognitiveservices_anomalydetector'
|
6
|
+
require 'profiles/latest/anomalydetector_latest_profile_client'
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
module Azure end
|
6
|
+
module Azure::CognitiveServices end
|
7
|
+
module Azure::CognitiveServices::AnomalyDetector end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
require 'profiles/latest/anomalydetector_module_definition'
|
6
|
+
require 'profiles/latest/modules/anomalydetector_profile_module'
|
7
|
+
|
8
|
+
module Azure::AnomalyDetector::Profiles::Latest
|
9
|
+
#
|
10
|
+
# Client class for the Latest profile SDK.
|
11
|
+
#
|
12
|
+
class Client < AnomalyDetectorDataClass
|
13
|
+
include MsRestAzure::Common::Configurable
|
14
|
+
|
15
|
+
#
|
16
|
+
# Initializes a new instance of the Client class.
|
17
|
+
# @param options [Hash] hash of client options.
|
18
|
+
# options = {
|
19
|
+
# tenant_id: 'YOUR TENANT ID',
|
20
|
+
# client_id: 'YOUR CLIENT ID',
|
21
|
+
# client_secret: 'YOUR CLIENT SECRET',
|
22
|
+
# subscription_id: 'YOUR SUBSCRIPTION ID',
|
23
|
+
# credentials: credentials,
|
24
|
+
# active_directory_settings: active_directory_settings,
|
25
|
+
# base_url: 'YOUR BASE URL',
|
26
|
+
# options: options
|
27
|
+
# }
|
28
|
+
# 'credentials' are optional and if not passed in the hash, will be obtained
|
29
|
+
# from MsRest::TokenCredentials using MsRestAzure::ApplicationTokenProvider.
|
30
|
+
#
|
31
|
+
# Also, base_url, active_directory_settings & options are optional.
|
32
|
+
#
|
33
|
+
def initialize(options = {})
|
34
|
+
super(options)
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
module Azure end
|
6
|
+
module Azure::AnomalyDetector end
|
7
|
+
module Azure::AnomalyDetector::Profiles end
|
8
|
+
module Azure::AnomalyDetector::Profiles::Latest end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
3
|
+
# Licensed under the MIT License. See License.txt in the project root for license information.
|
4
|
+
|
5
|
+
require 'azure_cognitiveservices_anomalydetector'
|
6
|
+
|
7
|
+
module Azure::AnomalyDetector::Profiles::Latest
|
8
|
+
|
9
|
+
module Models
|
10
|
+
Request = Azure::CognitiveServices::AnomalyDetector::V1_0::Models::Request
|
11
|
+
EntireDetectResponse = Azure::CognitiveServices::AnomalyDetector::V1_0::Models::EntireDetectResponse
|
12
|
+
Point = Azure::CognitiveServices::AnomalyDetector::V1_0::Models::Point
|
13
|
+
LastDetectResponse = Azure::CognitiveServices::AnomalyDetector::V1_0::Models::LastDetectResponse
|
14
|
+
APIError = Azure::CognitiveServices::AnomalyDetector::V1_0::Models::APIError
|
15
|
+
Granularity = Azure::CognitiveServices::AnomalyDetector::V1_0::Models::Granularity
|
16
|
+
end
|
17
|
+
|
18
|
+
#
|
19
|
+
# AnomalyDetectorDataClass
|
20
|
+
#
|
21
|
+
class AnomalyDetectorDataClass
|
22
|
+
attr_reader :configurable, :base_url, :options, :model_classes
|
23
|
+
|
24
|
+
def initialize(options = {})
|
25
|
+
if options.is_a?(Hash) && options.length == 0
|
26
|
+
@options = setup_default_options
|
27
|
+
else
|
28
|
+
@options = options
|
29
|
+
end
|
30
|
+
|
31
|
+
reset!(options)
|
32
|
+
|
33
|
+
@configurable = self
|
34
|
+
@base_url = options[:base_url].nil? ? nil:options[:base_url]
|
35
|
+
@options = options[:options].nil? ? nil:options[:options]
|
36
|
+
|
37
|
+
@client_0 = Azure::CognitiveServices::AnomalyDetector::V1_0::AnomalyDetectorClient.new(configurable.credentials, options)
|
38
|
+
if(@client_0.respond_to?(:subscription_id))
|
39
|
+
@client_0.subscription_id = configurable.subscription_id
|
40
|
+
end
|
41
|
+
add_telemetry(@client_0)
|
42
|
+
|
43
|
+
@model_classes = ModelClasses.new
|
44
|
+
end
|
45
|
+
|
46
|
+
def add_telemetry(client)
|
47
|
+
profile_information = 'Profiles/Latest/AnomalyDetector'
|
48
|
+
client.add_user_agent_information(profile_information)
|
49
|
+
end
|
50
|
+
|
51
|
+
def method_missing(method, *args)
|
52
|
+
if @client_0.respond_to?method
|
53
|
+
@client_0.send(method, *args)
|
54
|
+
else
|
55
|
+
super
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
class ModelClasses
|
62
|
+
def request
|
63
|
+
Azure::CognitiveServices::AnomalyDetector::V1_0::Models::Request
|
64
|
+
end
|
65
|
+
def entire_detect_response
|
66
|
+
Azure::CognitiveServices::AnomalyDetector::V1_0::Models::EntireDetectResponse
|
67
|
+
end
|
68
|
+
def point
|
69
|
+
Azure::CognitiveServices::AnomalyDetector::V1_0::Models::Point
|
70
|
+
end
|
71
|
+
def last_detect_response
|
72
|
+
Azure::CognitiveServices::AnomalyDetector::V1_0::Models::LastDetectResponse
|
73
|
+
end
|
74
|
+
def apierror
|
75
|
+
Azure::CognitiveServices::AnomalyDetector::V1_0::Models::APIError
|
76
|
+
end
|
77
|
+
def granularity
|
78
|
+
Azure::CognitiveServices::AnomalyDetector::V1_0::Models::Granularity
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
data/lib/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,136 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: azure_cognitiveservices_anomalydetector
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.17.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Microsoft Corporation
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2019-04-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: dotenv
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: ms_rest_azure
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.11.0
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.11.0
|
83
|
+
description: Microsoft Azure Cognitive Services Anomaly Detector Client Library for
|
84
|
+
Ruby
|
85
|
+
email: azrubyteam@microsoft.com
|
86
|
+
executables: []
|
87
|
+
extensions: []
|
88
|
+
extra_rdoc_files: []
|
89
|
+
files:
|
90
|
+
- LICENSE.txt
|
91
|
+
- lib/1.0/generated/azure_cognitiveservices_anomalydetector.rb
|
92
|
+
- lib/1.0/generated/azure_cognitiveservices_anomalydetector/anomaly_detector_client.rb
|
93
|
+
- lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/apierror.rb
|
94
|
+
- lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/entire_detect_response.rb
|
95
|
+
- lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/granularity.rb
|
96
|
+
- lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/last_detect_response.rb
|
97
|
+
- lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/point.rb
|
98
|
+
- lib/1.0/generated/azure_cognitiveservices_anomalydetector/models/request.rb
|
99
|
+
- lib/1.0/generated/azure_cognitiveservices_anomalydetector/module_definition.rb
|
100
|
+
- lib/azure_cognitiveservices_anomalydetector.rb
|
101
|
+
- lib/module_definition.rb
|
102
|
+
- lib/profiles/latest/anomalydetector_latest_profile_client.rb
|
103
|
+
- lib/profiles/latest/anomalydetector_module_definition.rb
|
104
|
+
- lib/profiles/latest/modules/anomalydetector_profile_module.rb
|
105
|
+
- lib/version.rb
|
106
|
+
homepage: https://aka.ms/azure-sdk-for-ruby
|
107
|
+
licenses:
|
108
|
+
- MIT
|
109
|
+
metadata:
|
110
|
+
bug_tracker_uri: https://github.com/Azure/azure-sdk-for-ruby/issues
|
111
|
+
changelog_uri: https://github.com/Azure/azure-sdk-for-ruby/blob/master/ChangeLog.md
|
112
|
+
documentation_uri: https://azure.microsoft.com/en-us/develop/ruby/
|
113
|
+
homepage_uri: https://aka.ms/azure-sdk-for-ruby
|
114
|
+
source_code_uri: https://github.com/Azure/azure-sdk-for-ruby/tree/master/data/azure_cognitiveservices_anomalydetector
|
115
|
+
post_install_message:
|
116
|
+
rdoc_options: []
|
117
|
+
require_paths:
|
118
|
+
- lib
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: 2.0.0
|
124
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
version: '0'
|
129
|
+
requirements: []
|
130
|
+
rubyforge_project:
|
131
|
+
rubygems_version: 2.7.6
|
132
|
+
signing_key:
|
133
|
+
specification_version: 4
|
134
|
+
summary: Official Ruby client library to consume Microsoft Azure Cognitive Services
|
135
|
+
Anomaly Detector.
|
136
|
+
test_files: []
|