Skip to content

Commit d08baa6

Browse files
committed
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-python into return_none_for_offset_length_v3
* 'master' of https://github.com/Azure/azure-sdk-for-python: [text analytics] add string-index-type support (Azure#13378) [text analytics] fix error response if pii entities is called from v3.0 client (Azure#13383) Send spec (Azure#13143) Anomaly Detector 3.0.0b2 release (Azure#13351) azure-keyvault-administration generated code (Azure#12098) fixed bug in querying by page using continuation token (Azure#13298)
2 parents f0bc964 + 3891c08 commit d08baa6

File tree

554 files changed

+10337
-1923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

554 files changed

+10337
-1923
lines changed

sdk/anomalydetector/azure-ai-anomalydetector/CHANGELOG.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
11
# Release History
22

3-
## 3.0.0b2 (Unreleased)
3+
## 3.0.0b2 (2020-08-27)
4+
5+
**Bug Fixes**
6+
- Fixed an issue with ChangePointDetect
7+
8+
**Breaking Changes**
9+
- Renamed `entire_detect` to `detect_entire_series`
10+
- Renamed `APIError` to `AnomalyDetectorError`
11+
- Renamed `Request` to `DetectRequest`
12+
- Renamed `LastDetect` to `DetectLastPoint`
13+
- Renamed `ChangePointDetect` to `DetectChangePoint`
14+
- Renamed `Granularity` to `TimeGranularity`
15+
- Renamed `minutely` and `secondly` to `per_minute` and `per_second`
16+
- Renamed `Point` to `TimeSeriesPoint`
417

518

619
## 3.0.0b1 (2020-08-17)

sdk/anomalydetector/azure-ai-anomalydetector/azure/ai/anomalydetector/aio/operations_async/_anomaly_detector_client_operations_async.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
class AnomalyDetectorClientOperationsMixin:
2121

22-
async def entire_detect(
22+
async def detect_entire_series(
2323
self,
24-
body: "models.Request",
24+
body: "models.DetectRequest",
2525
**kwargs
2626
) -> "models.EntireDetectResponse":
2727
"""Detect anomalies for the entire series in batch.
@@ -32,7 +32,7 @@ async def entire_detect(
3232
3333
:param body: Time series points and period if needed. Advanced model parameters can also be set
3434
in the request.
35-
:type body: ~azure.ai.anomalydetector.models.Request
35+
:type body: ~azure.ai.anomalydetector.models.DetectRequest
3636
:keyword callable cls: A custom type or function that will be passed the direct response
3737
:return: EntireDetectResponse, or the result of cls(response)
3838
:rtype: ~azure.ai.anomalydetector.models.EntireDetectResponse
@@ -44,7 +44,7 @@ async def entire_detect(
4444
content_type = kwargs.pop("content_type", "application/json")
4545

4646
# Construct URL
47-
url = self.entire_detect.metadata['url'] # type: ignore
47+
url = self.detect_entire_series.metadata['url'] # type: ignore
4848
path_format_arguments = {
4949
'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
5050
}
@@ -59,7 +59,7 @@ async def entire_detect(
5959
header_parameters['Accept'] = 'application/json'
6060

6161
body_content_kwargs = {} # type: Dict[str, Any]
62-
body_content = self._serialize.body(body, 'Request')
62+
body_content = self._serialize.body(body, 'DetectRequest')
6363
body_content_kwargs['content'] = body_content
6464
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
6565

@@ -68,7 +68,7 @@ async def entire_detect(
6868

6969
if response.status_code not in [200]:
7070
map_error(status_code=response.status_code, response=response, error_map=error_map)
71-
error = self._deserialize(models.APIError, response)
71+
error = self._deserialize(models.AnomalyDetectorError, response)
7272
raise HttpResponseError(response=response, model=error)
7373

7474
deserialized = self._deserialize('EntireDetectResponse', pipeline_response)
@@ -77,11 +77,11 @@ async def entire_detect(
7777
return cls(pipeline_response, deserialized, {})
7878

7979
return deserialized
80-
entire_detect.metadata = {'url': '/timeseries/entire/detect'} # type: ignore
80+
detect_entire_series.metadata = {'url': '/timeseries/entire/detect'} # type: ignore
8181

82-
async def last_detect(
82+
async def detect_last_point(
8383
self,
84-
body: "models.Request",
84+
body: "models.DetectRequest",
8585
**kwargs
8686
) -> "models.LastDetectResponse":
8787
"""Detect anomaly status of the latest point in time series.
@@ -92,7 +92,7 @@ async def last_detect(
9292
9393
:param body: Time series points and period if needed. Advanced model parameters can also be set
9494
in the request.
95-
:type body: ~azure.ai.anomalydetector.models.Request
95+
:type body: ~azure.ai.anomalydetector.models.DetectRequest
9696
:keyword callable cls: A custom type or function that will be passed the direct response
9797
:return: LastDetectResponse, or the result of cls(response)
9898
:rtype: ~azure.ai.anomalydetector.models.LastDetectResponse
@@ -104,7 +104,7 @@ async def last_detect(
104104
content_type = kwargs.pop("content_type", "application/json")
105105

106106
# Construct URL
107-
url = self.last_detect.metadata['url'] # type: ignore
107+
url = self.detect_last_point.metadata['url'] # type: ignore
108108
path_format_arguments = {
109109
'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
110110
}
@@ -119,7 +119,7 @@ async def last_detect(
119119
header_parameters['Accept'] = 'application/json'
120120

121121
body_content_kwargs = {} # type: Dict[str, Any]
122-
body_content = self._serialize.body(body, 'Request')
122+
body_content = self._serialize.body(body, 'DetectRequest')
123123
body_content_kwargs['content'] = body_content
124124
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
125125

@@ -128,7 +128,7 @@ async def last_detect(
128128

129129
if response.status_code not in [200]:
130130
map_error(status_code=response.status_code, response=response, error_map=error_map)
131-
error = self._deserialize(models.APIError, response)
131+
error = self._deserialize(models.AnomalyDetectorError, response)
132132
raise HttpResponseError(response=response, model=error)
133133

134134
deserialized = self._deserialize('LastDetectResponse', pipeline_response)
@@ -137,9 +137,9 @@ async def last_detect(
137137
return cls(pipeline_response, deserialized, {})
138138

139139
return deserialized
140-
last_detect.metadata = {'url': '/timeseries/last/detect'} # type: ignore
140+
detect_last_point.metadata = {'url': '/timeseries/last/detect'} # type: ignore
141141

142-
async def change_point_detect(
142+
async def detect_change_point(
143143
self,
144144
body: "models.ChangePointDetectRequest",
145145
**kwargs
@@ -162,7 +162,7 @@ async def change_point_detect(
162162
content_type = kwargs.pop("content_type", "application/json")
163163

164164
# Construct URL
165-
url = self.change_point_detect.metadata['url'] # type: ignore
165+
url = self.detect_change_point.metadata['url'] # type: ignore
166166
path_format_arguments = {
167167
'Endpoint': self._serialize.url("self._config.endpoint", self._config.endpoint, 'str', skip_quote=True),
168168
}
@@ -186,7 +186,7 @@ async def change_point_detect(
186186

187187
if response.status_code not in [200]:
188188
map_error(status_code=response.status_code, response=response, error_map=error_map)
189-
error = self._deserialize(models.APIError, response)
189+
error = self._deserialize(models.AnomalyDetectorError, response)
190190
raise HttpResponseError(response=response, model=error)
191191

192192
deserialized = self._deserialize('ChangePointDetectResponse', pipeline_response)
@@ -195,4 +195,4 @@ async def change_point_detect(
195195
return cls(pipeline_response, deserialized, {})
196196

197197
return deserialized
198-
change_point_detect.metadata = {'url': '/timeseries/changePoint/detect'} # type: ignore
198+
detect_change_point.metadata = {'url': '/timeseries/changepoint/detect'} # type: ignore

sdk/anomalydetector/azure-ai-anomalydetector/azure/ai/anomalydetector/models/__init__.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,35 @@
77
# --------------------------------------------------------------------------
88

99
try:
10-
from ._models_py3 import APIError
10+
from ._models_py3 import AnomalyDetectorError
1111
from ._models_py3 import ChangePointDetectRequest
1212
from ._models_py3 import ChangePointDetectResponse
13+
from ._models_py3 import DetectRequest
1314
from ._models_py3 import EntireDetectResponse
1415
from ._models_py3 import LastDetectResponse
15-
from ._models_py3 import Point
16-
from ._models_py3 import Request
16+
from ._models_py3 import TimeSeriesPoint
1717
except (SyntaxError, ImportError):
18-
from ._models import APIError # type: ignore
18+
from ._models import AnomalyDetectorError # type: ignore
1919
from ._models import ChangePointDetectRequest # type: ignore
2020
from ._models import ChangePointDetectResponse # type: ignore
21+
from ._models import DetectRequest # type: ignore
2122
from ._models import EntireDetectResponse # type: ignore
2223
from ._models import LastDetectResponse # type: ignore
23-
from ._models import Point # type: ignore
24-
from ._models import Request # type: ignore
24+
from ._models import TimeSeriesPoint # type: ignore
2525

2626
from ._anomaly_detector_client_enums import (
2727
AnomalyDetectorErrorCodes,
28-
Granularity,
28+
TimeGranularity,
2929
)
3030

3131
__all__ = [
32-
'APIError',
32+
'AnomalyDetectorError',
3333
'ChangePointDetectRequest',
3434
'ChangePointDetectResponse',
35+
'DetectRequest',
3536
'EntireDetectResponse',
3637
'LastDetectResponse',
37-
'Point',
38-
'Request',
38+
'TimeSeriesPoint',
3939
'AnomalyDetectorErrorCodes',
40-
'Granularity',
40+
'TimeGranularity',
4141
]

sdk/anomalydetector/azure-ai-anomalydetector/azure/ai/anomalydetector/models/_anomaly_detector_client_enums.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class AnomalyDetectorErrorCodes(with_metaclass(_CaseInsensitiveEnumMeta, str, En
4040
REQUIRED_GRANULARITY = "RequiredGranularity"
4141
REQUIRED_SERIES = "RequiredSeries"
4242

43-
class Granularity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
43+
class TimeGranularity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
4444
"""Can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is
4545
used for verify whether input series is valid.
4646
"""
@@ -50,5 +50,5 @@ class Granularity(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)):
5050
WEEKLY = "weekly"
5151
DAILY = "daily"
5252
HOURLY = "hourly"
53-
MINUTELY = "minutely"
54-
SECONDLY = "secondly"
53+
PER_MINUTE = "minutely"
54+
PER_SECOND = "secondly"

sdk/anomalydetector/azure-ai-anomalydetector/azure/ai/anomalydetector/models/_models.py

+64-64
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import msrest.serialization
1111

1212

13-
class APIError(msrest.serialization.Model):
13+
class AnomalyDetectorError(msrest.serialization.Model):
1414
"""Error information returned by the API.
1515
1616
:param code: The error code. Possible values include: "InvalidCustomInterval", "BadArgument",
@@ -30,7 +30,7 @@ def __init__(
3030
self,
3131
**kwargs
3232
):
33-
super(APIError, self).__init__(**kwargs)
33+
super(AnomalyDetectorError, self).__init__(**kwargs)
3434
self.code = kwargs.get('code', None)
3535
self.message = kwargs.get('message', None)
3636

@@ -42,11 +42,11 @@ class ChangePointDetectRequest(msrest.serialization.Model):
4242
4343
:param series: Required. Time series data points. Points should be sorted by timestamp in
4444
ascending order to match the change point detection result.
45-
:type series: list[~azure.ai.anomalydetector.models.Point]
45+
:type series: list[~azure.ai.anomalydetector.models.TimeSeriesPoint]
4646
:param granularity: Required. Can only be one of yearly, monthly, weekly, daily, hourly,
4747
minutely or secondly. Granularity is used for verify whether input series is valid. Possible
4848
values include: "yearly", "monthly", "weekly", "daily", "hourly", "minutely", "secondly".
49-
:type granularity: str or ~azure.ai.anomalydetector.models.Granularity
49+
:type granularity: str or ~azure.ai.anomalydetector.models.TimeGranularity
5050
:param custom_interval: Custom Interval is used to set non-standard time interval, for example,
5151
if the series is 5 minutes, request can be set as {"granularity":"minutely",
5252
"customInterval":5}.
@@ -68,7 +68,7 @@ class ChangePointDetectRequest(msrest.serialization.Model):
6868
}
6969

7070
_attribute_map = {
71-
'series': {'key': 'series', 'type': '[Point]'},
71+
'series': {'key': 'series', 'type': '[TimeSeriesPoint]'},
7272
'granularity': {'key': 'granularity', 'type': 'str'},
7373
'custom_interval': {'key': 'customInterval', 'type': 'int'},
7474
'period': {'key': 'period', 'type': 'int'},
@@ -127,6 +127,62 @@ def __init__(
127127
self.confidence_scores = kwargs['confidence_scores']
128128

129129

130+
class DetectRequest(msrest.serialization.Model):
131+
"""DetectRequest.
132+
133+
All required parameters must be populated in order to send to Azure.
134+
135+
:param series: Required. Time series data points. Points should be sorted by timestamp in
136+
ascending order to match the anomaly detection result. If the data is not sorted correctly or
137+
there is duplicated timestamp, the API will not work. In such case, an error message will be
138+
returned.
139+
:type series: list[~azure.ai.anomalydetector.models.TimeSeriesPoint]
140+
:param granularity: Required. Can only be one of yearly, monthly, weekly, daily, hourly,
141+
minutely or secondly. Granularity is used for verify whether input series is valid. Possible
142+
values include: "yearly", "monthly", "weekly", "daily", "hourly", "minutely", "secondly".
143+
:type granularity: str or ~azure.ai.anomalydetector.models.TimeGranularity
144+
:param custom_interval: Custom Interval is used to set non-standard time interval, for example,
145+
if the series is 5 minutes, request can be set as {"granularity":"minutely",
146+
"customInterval":5}.
147+
:type custom_interval: int
148+
:param period: Optional argument, periodic value of a time series. If the value is null or does
149+
not present, the API will determine the period automatically.
150+
:type period: int
151+
:param max_anomaly_ratio: Optional argument, advanced model parameter, max anomaly ratio in a
152+
time series.
153+
:type max_anomaly_ratio: float
154+
:param sensitivity: Optional argument, advanced model parameter, between 0-99, the lower the
155+
value is, the larger the margin value will be which means less anomalies will be accepted.
156+
:type sensitivity: int
157+
"""
158+
159+
_validation = {
160+
'series': {'required': True},
161+
'granularity': {'required': True},
162+
}
163+
164+
_attribute_map = {
165+
'series': {'key': 'series', 'type': '[TimeSeriesPoint]'},
166+
'granularity': {'key': 'granularity', 'type': 'str'},
167+
'custom_interval': {'key': 'customInterval', 'type': 'int'},
168+
'period': {'key': 'period', 'type': 'int'},
169+
'max_anomaly_ratio': {'key': 'maxAnomalyRatio', 'type': 'float'},
170+
'sensitivity': {'key': 'sensitivity', 'type': 'int'},
171+
}
172+
173+
def __init__(
174+
self,
175+
**kwargs
176+
):
177+
super(DetectRequest, self).__init__(**kwargs)
178+
self.series = kwargs['series']
179+
self.granularity = kwargs['granularity']
180+
self.custom_interval = kwargs.get('custom_interval', None)
181+
self.period = kwargs.get('period', None)
182+
self.max_anomaly_ratio = kwargs.get('max_anomaly_ratio', None)
183+
self.sensitivity = kwargs.get('sensitivity', None)
184+
185+
130186
class EntireDetectResponse(msrest.serialization.Model):
131187
"""EntireDetectResponse.
132188
@@ -268,8 +324,8 @@ def __init__(
268324
self.is_positive_anomaly = kwargs['is_positive_anomaly']
269325

270326

271-
class Point(msrest.serialization.Model):
272-
"""Point.
327+
class TimeSeriesPoint(msrest.serialization.Model):
328+
"""TimeSeriesPoint.
273329
274330
All required parameters must be populated in order to send to Azure.
275331
@@ -293,62 +349,6 @@ def __init__(
293349
self,
294350
**kwargs
295351
):
296-
super(Point, self).__init__(**kwargs)
352+
super(TimeSeriesPoint, self).__init__(**kwargs)
297353
self.timestamp = kwargs['timestamp']
298354
self.value = kwargs['value']
299-
300-
301-
class Request(msrest.serialization.Model):
302-
"""Request.
303-
304-
All required parameters must be populated in order to send to Azure.
305-
306-
:param series: Required. Time series data points. Points should be sorted by timestamp in
307-
ascending order to match the anomaly detection result. If the data is not sorted correctly or
308-
there is duplicated timestamp, the API will not work. In such case, an error message will be
309-
returned.
310-
:type series: list[~azure.ai.anomalydetector.models.Point]
311-
:param granularity: Required. Can only be one of yearly, monthly, weekly, daily, hourly,
312-
minutely or secondly. Granularity is used for verify whether input series is valid. Possible
313-
values include: "yearly", "monthly", "weekly", "daily", "hourly", "minutely", "secondly".
314-
:type granularity: str or ~azure.ai.anomalydetector.models.Granularity
315-
:param custom_interval: Custom Interval is used to set non-standard time interval, for example,
316-
if the series is 5 minutes, request can be set as {"granularity":"minutely",
317-
"customInterval":5}.
318-
:type custom_interval: int
319-
:param period: Optional argument, periodic value of a time series. If the value is null or does
320-
not present, the API will determine the period automatically.
321-
:type period: int
322-
:param max_anomaly_ratio: Optional argument, advanced model parameter, max anomaly ratio in a
323-
time series.
324-
:type max_anomaly_ratio: float
325-
:param sensitivity: Optional argument, advanced model parameter, between 0-99, the lower the
326-
value is, the larger the margin value will be which means less anomalies will be accepted.
327-
:type sensitivity: int
328-
"""
329-
330-
_validation = {
331-
'series': {'required': True},
332-
'granularity': {'required': True},
333-
}
334-
335-
_attribute_map = {
336-
'series': {'key': 'series', 'type': '[Point]'},
337-
'granularity': {'key': 'granularity', 'type': 'str'},
338-
'custom_interval': {'key': 'customInterval', 'type': 'int'},
339-
'period': {'key': 'period', 'type': 'int'},
340-
'max_anomaly_ratio': {'key': 'maxAnomalyRatio', 'type': 'float'},
341-
'sensitivity': {'key': 'sensitivity', 'type': 'int'},
342-
}
343-
344-
def __init__(
345-
self,
346-
**kwargs
347-
):
348-
super(Request, self).__init__(**kwargs)
349-
self.series = kwargs['series']
350-
self.granularity = kwargs['granularity']
351-
self.custom_interval = kwargs.get('custom_interval', None)
352-
self.period = kwargs.get('period', None)
353-
self.max_anomaly_ratio = kwargs.get('max_anomaly_ratio', None)
354-
self.sensitivity = kwargs.get('sensitivity', None)

0 commit comments

Comments
 (0)