diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/anomaly_detector_client.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/anomaly_detector_client.py index bdb12fab2ca5..5d75385a9a1d 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/anomaly_detector_client.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/anomaly_detector_client.py @@ -14,7 +14,6 @@ from .version import VERSION from msrest.pipeline import ClientRawResponse from .operations.time_series_operations import TimeSeriesOperations -from .operations.time_series_group_operations import TimeSeriesGroupOperations from . import models @@ -56,8 +55,6 @@ class AnomalyDetectorClient(SDKClient): :ivar time_series: TimeSeries operations :vartype time_series: azure.cognitiveservices.anomalydetector.operations.TimeSeriesOperations - :ivar time_series_group: TimeSeriesGroup operations - :vartype time_series_group: azure.cognitiveservices.anomalydetector.operations.TimeSeriesGroupOperations :param endpoint: Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus2.api.cognitive.microsoft.com). @@ -80,8 +77,6 @@ def __init__( self.time_series = TimeSeriesOperations( self._client, self.config, self._serialize, self._deserialize) - self.time_series_group = TimeSeriesGroupOperations( - self._client, self.config, self._serialize, self._deserialize) def entire_detect( self, body, custom_headers=None, raw=False, **operation_config): diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/__init__.py index 7530b5c62986..0b5029328374 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/__init__.py @@ -18,12 +18,8 @@ from .time_series_py3 import TimeSeries from .time_series_create_request_py3 import TimeSeriesCreateRequest from .time_series_list_py3 import TimeSeriesList - from .time_series_group_py3 import TimeSeriesGroup - from .time_series_group_create_request_py3 import TimeSeriesGroupCreateRequest - from .time_series_group_list_py3 import TimeSeriesGroupList from .inconsistency_detect_request_py3 import InconsistencyDetectRequest from .inconsistency_py3 import Inconsistency - from .inconsistency_query_request_py3 import InconsistencyQueryRequest from .change_point_detect_request_py3 import ChangePointDetectRequest from .change_point_detect_response_py3 import ChangePointDetectResponse from .change_point_detect_on_timestamp_request_py3 import ChangePointDetectOnTimestampRequest @@ -42,12 +38,8 @@ from .time_series import TimeSeries from .time_series_create_request import TimeSeriesCreateRequest from .time_series_list import TimeSeriesList - from .time_series_group import TimeSeriesGroup - from .time_series_group_create_request import TimeSeriesGroupCreateRequest - from .time_series_group_list import TimeSeriesGroupList from .inconsistency_detect_request import InconsistencyDetectRequest from .inconsistency import Inconsistency - from .inconsistency_query_request import InconsistencyQueryRequest from .change_point_detect_request import ChangePointDetectRequest from .change_point_detect_response import ChangePointDetectResponse from .change_point_detect_on_timestamp_request import ChangePointDetectOnTimestampRequest @@ -73,12 +65,8 @@ 'TimeSeries', 'TimeSeriesCreateRequest', 'TimeSeriesList', - 'TimeSeriesGroup', - 'TimeSeriesGroupCreateRequest', - 'TimeSeriesGroupList', 'InconsistencyDetectRequest', 'Inconsistency', - 'InconsistencyQueryRequest', 'ChangePointDetectRequest', 'ChangePointDetectResponse', 'ChangePointDetectOnTimestampRequest', diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detect_on_timestamp_response.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detect_on_timestamp_response.py index 7e34b827714e..5e2d6734be8c 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detect_on_timestamp_response.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detect_on_timestamp_response.py @@ -51,6 +51,9 @@ class AnomalyDetectOnTimestampResponse(Model): positive anomaly means the point is detected as an anomaly and its real value is larger than the expected one. :type is_positive_anomaly: bool + :param confidence_score: Required. Confidence score of the anomaly, + significiant anomalies will get higher score. + :type confidence_score: float """ _validation = { @@ -63,6 +66,7 @@ class AnomalyDetectOnTimestampResponse(Model): 'is_anomaly': {'required': True}, 'is_negative_anomaly': {'required': True}, 'is_positive_anomaly': {'required': True}, + 'confidence_score': {'required': True}, } _attribute_map = { @@ -75,6 +79,7 @@ class AnomalyDetectOnTimestampResponse(Model): 'is_anomaly': {'key': 'isAnomaly', 'type': 'bool'}, 'is_negative_anomaly': {'key': 'isNegativeAnomaly', 'type': 'bool'}, 'is_positive_anomaly': {'key': 'isPositiveAnomaly', 'type': 'bool'}, + 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, } def __init__(self, **kwargs): @@ -88,3 +93,4 @@ def __init__(self, **kwargs): self.is_anomaly = kwargs.get('is_anomaly', None) self.is_negative_anomaly = kwargs.get('is_negative_anomaly', None) self.is_positive_anomaly = kwargs.get('is_positive_anomaly', None) + self.confidence_score = kwargs.get('confidence_score', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detect_on_timestamp_response_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detect_on_timestamp_response_py3.py index 4332778a9316..07bb7a051816 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detect_on_timestamp_response_py3.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detect_on_timestamp_response_py3.py @@ -51,6 +51,9 @@ class AnomalyDetectOnTimestampResponse(Model): positive anomaly means the point is detected as an anomaly and its real value is larger than the expected one. :type is_positive_anomaly: bool + :param confidence_score: Required. Confidence score of the anomaly, + significiant anomalies will get higher score. + :type confidence_score: float """ _validation = { @@ -63,6 +66,7 @@ class AnomalyDetectOnTimestampResponse(Model): 'is_anomaly': {'required': True}, 'is_negative_anomaly': {'required': True}, 'is_positive_anomaly': {'required': True}, + 'confidence_score': {'required': True}, } _attribute_map = { @@ -75,9 +79,10 @@ class AnomalyDetectOnTimestampResponse(Model): 'is_anomaly': {'key': 'isAnomaly', 'type': 'bool'}, 'is_negative_anomaly': {'key': 'isNegativeAnomaly', 'type': 'bool'}, 'is_positive_anomaly': {'key': 'isPositiveAnomaly', 'type': 'bool'}, + 'confidence_score': {'key': 'confidenceScore', 'type': 'float'}, } - def __init__(self, *, period: int, timestamp, value: float, expected_value: float, upper_margin: float, lower_margin: float, is_anomaly: bool, is_negative_anomaly: bool, is_positive_anomaly: bool, **kwargs) -> None: + def __init__(self, *, period: int, timestamp, value: float, expected_value: float, upper_margin: float, lower_margin: float, is_anomaly: bool, is_negative_anomaly: bool, is_positive_anomaly: bool, confidence_score: float, **kwargs) -> None: super(AnomalyDetectOnTimestampResponse, self).__init__(**kwargs) self.period = period self.timestamp = timestamp @@ -88,3 +93,4 @@ def __init__(self, *, period: int, timestamp, value: float, expected_value: floa self.is_anomaly = is_anomaly self.is_negative_anomaly = is_negative_anomaly self.is_positive_anomaly = is_positive_anomaly + self.confidence_score = confidence_score diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detector_client_enums.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detector_client_enums.py index f75ee194cc10..98bb194628fd 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detector_client_enums.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/anomaly_detector_client_enums.py @@ -43,5 +43,7 @@ class LabelType(str, Enum): class LabelValue(str, Enum): - true = "true" - false = "false" + positive_anomaly = "positiveAnomaly" + negative_anomaly = "negativeAnomaly" + positive_change_point = "positiveChangePoint" + negative_change_point = "negativeChangePoint" diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency.py index 684b096fcdd3..5ae1d35432db 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency.py @@ -23,28 +23,25 @@ class Inconsistency(Model): :param confidence_scores: Required. Scores of inconsistent series in the time series group. :type confidence_scores: list[float] - :param timestamp: Required. Inconsistency detect timestamp. - :type timestamp: datetime - :param epsilon: Parameter to be tuned to get inconsistency. - :type epsilon: float + :param principle_trend: Required. The principle trend of the group of time + series. + :type principle_trend: list[float] """ _validation = { 'inconsistent_series_ids': {'required': True}, 'confidence_scores': {'required': True}, - 'timestamp': {'required': True}, + 'principle_trend': {'required': True}, } _attribute_map = { 'inconsistent_series_ids': {'key': 'inconsistentSeriesIds', 'type': '[str]'}, 'confidence_scores': {'key': 'confidenceScores', 'type': '[float]'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'epsilon': {'key': 'epsilon', 'type': 'float'}, + 'principle_trend': {'key': 'principleTrend', 'type': '[float]'}, } def __init__(self, **kwargs): super(Inconsistency, self).__init__(**kwargs) self.inconsistent_series_ids = kwargs.get('inconsistent_series_ids', None) self.confidence_scores = kwargs.get('confidence_scores', None) - self.timestamp = kwargs.get('timestamp', None) - self.epsilon = kwargs.get('epsilon', None) + self.principle_trend = kwargs.get('principle_trend', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_detect_request.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_detect_request.py index f480521ac6be..abc7b91f2061 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_detect_request.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_detect_request.py @@ -21,6 +21,8 @@ class InconsistencyDetectRequest(Model): :type timestamp: datetime :param epsilon: Parameter to be tuned to get inconsistency. :type epsilon: float + :param time_series_ids: IDs of time series need to be detected. + :type time_series_ids: list[str] """ _validation = { @@ -30,9 +32,11 @@ class InconsistencyDetectRequest(Model): _attribute_map = { 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, 'epsilon': {'key': 'epsilon', 'type': 'float'}, + 'time_series_ids': {'key': 'timeSeriesIds', 'type': '[str]'}, } def __init__(self, **kwargs): super(InconsistencyDetectRequest, self).__init__(**kwargs) self.timestamp = kwargs.get('timestamp', None) self.epsilon = kwargs.get('epsilon', None) + self.time_series_ids = kwargs.get('time_series_ids', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_detect_request_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_detect_request_py3.py index dc2e5b0e631e..554b3672a4be 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_detect_request_py3.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_detect_request_py3.py @@ -21,6 +21,8 @@ class InconsistencyDetectRequest(Model): :type timestamp: datetime :param epsilon: Parameter to be tuned to get inconsistency. :type epsilon: float + :param time_series_ids: IDs of time series need to be detected. + :type time_series_ids: list[str] """ _validation = { @@ -30,9 +32,11 @@ class InconsistencyDetectRequest(Model): _attribute_map = { 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, 'epsilon': {'key': 'epsilon', 'type': 'float'}, + 'time_series_ids': {'key': 'timeSeriesIds', 'type': '[str]'}, } - def __init__(self, *, timestamp, epsilon: float=None, **kwargs) -> None: + def __init__(self, *, timestamp, epsilon: float=None, time_series_ids=None, **kwargs) -> None: super(InconsistencyDetectRequest, self).__init__(**kwargs) self.timestamp = timestamp self.epsilon = epsilon + self.time_series_ids = time_series_ids diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_py3.py index ce543fe5da8b..cbb74140178a 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_py3.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_py3.py @@ -23,28 +23,25 @@ class Inconsistency(Model): :param confidence_scores: Required. Scores of inconsistent series in the time series group. :type confidence_scores: list[float] - :param timestamp: Required. Inconsistency detect timestamp. - :type timestamp: datetime - :param epsilon: Parameter to be tuned to get inconsistency. - :type epsilon: float + :param principle_trend: Required. The principle trend of the group of time + series. + :type principle_trend: list[float] """ _validation = { 'inconsistent_series_ids': {'required': True}, 'confidence_scores': {'required': True}, - 'timestamp': {'required': True}, + 'principle_trend': {'required': True}, } _attribute_map = { 'inconsistent_series_ids': {'key': 'inconsistentSeriesIds', 'type': '[str]'}, 'confidence_scores': {'key': 'confidenceScores', 'type': '[float]'}, - 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, - 'epsilon': {'key': 'epsilon', 'type': 'float'}, + 'principle_trend': {'key': 'principleTrend', 'type': '[float]'}, } - def __init__(self, *, inconsistent_series_ids, confidence_scores, timestamp, epsilon: float=None, **kwargs) -> None: + def __init__(self, *, inconsistent_series_ids, confidence_scores, principle_trend, **kwargs) -> None: super(Inconsistency, self).__init__(**kwargs) self.inconsistent_series_ids = inconsistent_series_ids self.confidence_scores = confidence_scores - self.timestamp = timestamp - self.epsilon = epsilon + self.principle_trend = principle_trend diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_query_request.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_query_request.py deleted file mode 100644 index ab943794912c..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_query_request.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InconsistencyQueryRequest(Model): - """InconsistencyQueryRequest. - - All required parameters must be populated in order to send to Azure. - - :param begin: Required. Start time of the time series group. - :type begin: datetime - :param end: Required. End time of the time series group. - :type end: datetime - """ - - _validation = { - 'begin': {'required': True}, - 'end': {'required': True}, - } - - _attribute_map = { - 'begin': {'key': 'begin', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(InconsistencyQueryRequest, self).__init__(**kwargs) - self.begin = kwargs.get('begin', None) - self.end = kwargs.get('end', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_query_request_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_query_request_py3.py deleted file mode 100644 index 8d26a6cd1b5f..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/inconsistency_query_request_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class InconsistencyQueryRequest(Model): - """InconsistencyQueryRequest. - - All required parameters must be populated in order to send to Azure. - - :param begin: Required. Start time of the time series group. - :type begin: datetime - :param end: Required. End time of the time series group. - :type end: datetime - """ - - _validation = { - 'begin': {'required': True}, - 'end': {'required': True}, - } - - _attribute_map = { - 'begin': {'key': 'begin', 'type': 'iso-8601'}, - 'end': {'key': 'end', 'type': 'iso-8601'}, - } - - def __init__(self, *, begin, end, **kwargs) -> None: - super(InconsistencyQueryRequest, self).__init__(**kwargs) - self.begin = begin - self.end = end diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/label_request.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/label_request.py index 6d5de2f2e75f..0b64beae43ac 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/label_request.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/label_request.py @@ -24,7 +24,8 @@ class LabelRequest(Model): :param type: Required. Possible values include: 'changePoint', 'anomaly' :type type: str or ~azure.cognitiveservices.anomalydetector.models.LabelType - :param value: Required. Possible values include: 'true', 'false' + :param value: Required. Possible values include: 'positiveAnomaly', + 'negativeAnomaly', 'positiveChangePoint', 'negativeChangePoint' :type value: str or ~azure.cognitiveservices.anomalydetector.models.LabelValue """ diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/label_request_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/label_request_py3.py index 2a571d90d844..c4dbee5e9743 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/label_request_py3.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/label_request_py3.py @@ -24,7 +24,8 @@ class LabelRequest(Model): :param type: Required. Possible values include: 'changePoint', 'anomaly' :type type: str or ~azure.cognitiveservices.anomalydetector.models.LabelType - :param value: Required. Possible values include: 'true', 'false' + :param value: Required. Possible values include: 'positiveAnomaly', + 'negativeAnomaly', 'positiveChangePoint', 'negativeChangePoint' :type value: str or ~azure.cognitiveservices.anomalydetector.models.LabelValue """ diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series.py index c889aeb1e9a9..be0e061516ca 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series.py @@ -25,18 +25,12 @@ class TimeSeries(Model): 'daily', 'hourly', 'minutely' :type granularity: str or ~azure.cognitiveservices.anomalydetector.models.Granularity - :param dimensions: Property of a time series - :type dimensions: dict[str, str] :param custom_interval: Custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. :type custom_interval: int :param retention_duration_in_hours: Hours that the data is kept. :type retention_duration_in_hours: int - :param description: Description for the time series. - :type description: str - :param name: Name of the time series. - :type name: str """ _validation = { @@ -47,19 +41,13 @@ class TimeSeries(Model): _attribute_map = { 'series_id': {'key': 'seriesId', 'type': 'str'}, 'granularity': {'key': 'granularity', 'type': 'Granularity'}, - 'dimensions': {'key': 'dimensions', 'type': '{str}'}, 'custom_interval': {'key': 'customInterval', 'type': 'int'}, 'retention_duration_in_hours': {'key': 'retentionDurationInHours', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, } def __init__(self, **kwargs): super(TimeSeries, self).__init__(**kwargs) self.series_id = kwargs.get('series_id', None) self.granularity = kwargs.get('granularity', None) - self.dimensions = kwargs.get('dimensions', None) self.custom_interval = kwargs.get('custom_interval', None) self.retention_duration_in_hours = kwargs.get('retention_duration_in_hours', None) - self.description = kwargs.get('description', None) - self.name = kwargs.get('name', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_create_request.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_create_request.py index 220be44c29c0..7d7d751eccc6 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_create_request.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_create_request.py @@ -23,18 +23,12 @@ class TimeSeriesCreateRequest(Model): 'daily', 'hourly', 'minutely' :type granularity: str or ~azure.cognitiveservices.anomalydetector.models.Granularity - :param dimensions: Property of a time series - :type dimensions: dict[str, str] :param custom_interval: Custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. :type custom_interval: int :param retention_duration_in_hours: Hours that the data is kept. :type retention_duration_in_hours: int - :param description: Description for the time series. - :type description: str - :param name: Name of the time series. - :type name: str """ _validation = { @@ -43,18 +37,12 @@ class TimeSeriesCreateRequest(Model): _attribute_map = { 'granularity': {'key': 'granularity', 'type': 'Granularity'}, - 'dimensions': {'key': 'dimensions', 'type': '{str}'}, 'custom_interval': {'key': 'customInterval', 'type': 'int'}, 'retention_duration_in_hours': {'key': 'retentionDurationInHours', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, } def __init__(self, **kwargs): super(TimeSeriesCreateRequest, self).__init__(**kwargs) self.granularity = kwargs.get('granularity', None) - self.dimensions = kwargs.get('dimensions', None) self.custom_interval = kwargs.get('custom_interval', None) self.retention_duration_in_hours = kwargs.get('retention_duration_in_hours', None) - self.description = kwargs.get('description', None) - self.name = kwargs.get('name', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_create_request_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_create_request_py3.py index 06d46819e9a0..0e237450be3c 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_create_request_py3.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_create_request_py3.py @@ -23,18 +23,12 @@ class TimeSeriesCreateRequest(Model): 'daily', 'hourly', 'minutely' :type granularity: str or ~azure.cognitiveservices.anomalydetector.models.Granularity - :param dimensions: Property of a time series - :type dimensions: dict[str, str] :param custom_interval: Custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. :type custom_interval: int :param retention_duration_in_hours: Hours that the data is kept. :type retention_duration_in_hours: int - :param description: Description for the time series. - :type description: str - :param name: Name of the time series. - :type name: str """ _validation = { @@ -43,18 +37,12 @@ class TimeSeriesCreateRequest(Model): _attribute_map = { 'granularity': {'key': 'granularity', 'type': 'Granularity'}, - 'dimensions': {'key': 'dimensions', 'type': '{str}'}, 'custom_interval': {'key': 'customInterval', 'type': 'int'}, 'retention_duration_in_hours': {'key': 'retentionDurationInHours', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, granularity, dimensions=None, custom_interval: int=None, retention_duration_in_hours: int=None, description: str=None, name: str=None, **kwargs) -> None: + def __init__(self, *, granularity, custom_interval: int=None, retention_duration_in_hours: int=None, **kwargs) -> None: super(TimeSeriesCreateRequest, self).__init__(**kwargs) self.granularity = granularity - self.dimensions = dimensions self.custom_interval = custom_interval self.retention_duration_in_hours = retention_duration_in_hours - self.description = description - self.name = name diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group.py deleted file mode 100644 index 738e9c9603c6..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class TimeSeriesGroup(Model): - """TimeSeriesGroup. - - All required parameters must be populated in order to send to Azure. - - :param group_id: Required. Unique id for time series group. - :type group_id: str - :param description: Description of the time series group - :type description: str - :param name: Name of the time series group - :type name: str - :param granularity: Required. Can only be one of yearly, monthly, weekly, - daily, hourly or minutely. Granularity is used for verify whether input - series is valid. Possible values include: 'yearly', 'monthly', 'weekly', - 'daily', 'hourly', 'minutely' - :type granularity: str or - ~azure.cognitiveservices.anomalydetector.models.Granularity - :param custom_interval: Custom Interval is used to set non-standard time - interval, for example, if the series is 5 minutes, request can be set as - {"granularity":"minutely", "customInterval":5}. - :type custom_interval: int - """ - - _validation = { - 'group_id': {'required': True}, - 'granularity': {'required': True}, - } - - _attribute_map = { - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'granularity': {'key': 'granularity', 'type': 'Granularity'}, - 'custom_interval': {'key': 'customInterval', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(TimeSeriesGroup, self).__init__(**kwargs) - self.group_id = kwargs.get('group_id', None) - self.description = kwargs.get('description', None) - self.name = kwargs.get('name', None) - self.granularity = kwargs.get('granularity', None) - self.custom_interval = kwargs.get('custom_interval', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_create_request.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_create_request.py deleted file mode 100644 index acee4c17a65f..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_create_request.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class TimeSeriesGroupCreateRequest(Model): - """TimeSeriesGroupCreateRequest. - - All required parameters must be populated in order to send to Azure. - - :param description: Description of the time series group - :type description: str - :param name: Name of the time series group - :type name: str - :param granularity: Required. Can only be one of yearly, monthly, weekly, - daily, hourly or minutely. Granularity is used for verify whether input - series is valid. Possible values include: 'yearly', 'monthly', 'weekly', - 'daily', 'hourly', 'minutely' - :type granularity: str or - ~azure.cognitiveservices.anomalydetector.models.Granularity - :param custom_interval: Custom Interval is used to set non-standard time - interval, for example, if the series is 5 minutes, request can be set as - {"granularity":"minutely", "customInterval":5}. - :type custom_interval: int - """ - - _validation = { - 'granularity': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'granularity': {'key': 'granularity', 'type': 'Granularity'}, - 'custom_interval': {'key': 'customInterval', 'type': 'int'}, - } - - def __init__(self, **kwargs): - super(TimeSeriesGroupCreateRequest, self).__init__(**kwargs) - self.description = kwargs.get('description', None) - self.name = kwargs.get('name', None) - self.granularity = kwargs.get('granularity', None) - self.custom_interval = kwargs.get('custom_interval', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_create_request_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_create_request_py3.py deleted file mode 100644 index 37a942319d76..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_create_request_py3.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class TimeSeriesGroupCreateRequest(Model): - """TimeSeriesGroupCreateRequest. - - All required parameters must be populated in order to send to Azure. - - :param description: Description of the time series group - :type description: str - :param name: Name of the time series group - :type name: str - :param granularity: Required. Can only be one of yearly, monthly, weekly, - daily, hourly or minutely. Granularity is used for verify whether input - series is valid. Possible values include: 'yearly', 'monthly', 'weekly', - 'daily', 'hourly', 'minutely' - :type granularity: str or - ~azure.cognitiveservices.anomalydetector.models.Granularity - :param custom_interval: Custom Interval is used to set non-standard time - interval, for example, if the series is 5 minutes, request can be set as - {"granularity":"minutely", "customInterval":5}. - :type custom_interval: int - """ - - _validation = { - 'granularity': {'required': True}, - } - - _attribute_map = { - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'granularity': {'key': 'granularity', 'type': 'Granularity'}, - 'custom_interval': {'key': 'customInterval', 'type': 'int'}, - } - - def __init__(self, *, granularity, description: str=None, name: str=None, custom_interval: int=None, **kwargs) -> None: - super(TimeSeriesGroupCreateRequest, self).__init__(**kwargs) - self.description = description - self.name = name - self.granularity = granularity - self.custom_interval = custom_interval diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_list.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_list.py deleted file mode 100644 index a00bc266d602..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_list.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class TimeSeriesGroupList(Model): - """TimeSeriesGroupList. - - All required parameters must be populated in order to send to Azure. - - :param groups: Required. A list of TimeSeriesGroup. - :type groups: - list[~azure.cognitiveservices.anomalydetector.models.TimeSeriesGroup] - :param next: - :type next: str - """ - - _validation = { - 'groups': {'required': True}, - } - - _attribute_map = { - 'groups': {'key': 'groups', 'type': '[TimeSeriesGroup]'}, - 'next': {'key': 'next', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(TimeSeriesGroupList, self).__init__(**kwargs) - self.groups = kwargs.get('groups', None) - self.next = kwargs.get('next', None) diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_list_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_list_py3.py deleted file mode 100644 index 7db94b814505..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_list_py3.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class TimeSeriesGroupList(Model): - """TimeSeriesGroupList. - - All required parameters must be populated in order to send to Azure. - - :param groups: Required. A list of TimeSeriesGroup. - :type groups: - list[~azure.cognitiveservices.anomalydetector.models.TimeSeriesGroup] - :param next: - :type next: str - """ - - _validation = { - 'groups': {'required': True}, - } - - _attribute_map = { - 'groups': {'key': 'groups', 'type': '[TimeSeriesGroup]'}, - 'next': {'key': 'next', 'type': 'str'}, - } - - def __init__(self, *, groups, next: str=None, **kwargs) -> None: - super(TimeSeriesGroupList, self).__init__(**kwargs) - self.groups = groups - self.next = next diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_py3.py deleted file mode 100644 index 34583b6490da..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_group_py3.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.serialization import Model - - -class TimeSeriesGroup(Model): - """TimeSeriesGroup. - - All required parameters must be populated in order to send to Azure. - - :param group_id: Required. Unique id for time series group. - :type group_id: str - :param description: Description of the time series group - :type description: str - :param name: Name of the time series group - :type name: str - :param granularity: Required. Can only be one of yearly, monthly, weekly, - daily, hourly or minutely. Granularity is used for verify whether input - series is valid. Possible values include: 'yearly', 'monthly', 'weekly', - 'daily', 'hourly', 'minutely' - :type granularity: str or - ~azure.cognitiveservices.anomalydetector.models.Granularity - :param custom_interval: Custom Interval is used to set non-standard time - interval, for example, if the series is 5 minutes, request can be set as - {"granularity":"minutely", "customInterval":5}. - :type custom_interval: int - """ - - _validation = { - 'group_id': {'required': True}, - 'granularity': {'required': True}, - } - - _attribute_map = { - 'group_id': {'key': 'groupId', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'granularity': {'key': 'granularity', 'type': 'Granularity'}, - 'custom_interval': {'key': 'customInterval', 'type': 'int'}, - } - - def __init__(self, *, group_id: str, granularity, description: str=None, name: str=None, custom_interval: int=None, **kwargs) -> None: - super(TimeSeriesGroup, self).__init__(**kwargs) - self.group_id = group_id - self.description = description - self.name = name - self.granularity = granularity - self.custom_interval = custom_interval diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_py3.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_py3.py index 67e98ace7730..b46c7a9c075b 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_py3.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/models/time_series_py3.py @@ -25,18 +25,12 @@ class TimeSeries(Model): 'daily', 'hourly', 'minutely' :type granularity: str or ~azure.cognitiveservices.anomalydetector.models.Granularity - :param dimensions: Property of a time series - :type dimensions: dict[str, str] :param custom_interval: Custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. :type custom_interval: int :param retention_duration_in_hours: Hours that the data is kept. :type retention_duration_in_hours: int - :param description: Description for the time series. - :type description: str - :param name: Name of the time series. - :type name: str """ _validation = { @@ -47,19 +41,13 @@ class TimeSeries(Model): _attribute_map = { 'series_id': {'key': 'seriesId', 'type': 'str'}, 'granularity': {'key': 'granularity', 'type': 'Granularity'}, - 'dimensions': {'key': 'dimensions', 'type': '{str}'}, 'custom_interval': {'key': 'customInterval', 'type': 'int'}, 'retention_duration_in_hours': {'key': 'retentionDurationInHours', 'type': 'int'}, - 'description': {'key': 'description', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, } - def __init__(self, *, series_id: str, granularity, dimensions=None, custom_interval: int=None, retention_duration_in_hours: int=None, description: str=None, name: str=None, **kwargs) -> None: + def __init__(self, *, series_id: str, granularity, custom_interval: int=None, retention_duration_in_hours: int=None, **kwargs) -> None: super(TimeSeries, self).__init__(**kwargs) self.series_id = series_id self.granularity = granularity - self.dimensions = dimensions self.custom_interval = custom_interval self.retention_duration_in_hours = retention_duration_in_hours - self.description = description - self.name = name diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/operations/__init__.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/operations/__init__.py index 5f59ccfca0b6..b5d47d494a3e 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/operations/__init__.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/operations/__init__.py @@ -10,9 +10,7 @@ # -------------------------------------------------------------------------- from .time_series_operations import TimeSeriesOperations -from .time_series_group_operations import TimeSeriesGroupOperations __all__ = [ 'TimeSeriesOperations', - 'TimeSeriesGroupOperations', ] diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/operations/time_series_group_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/operations/time_series_group_operations.py deleted file mode 100644 index 8aad82925098..000000000000 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/operations/time_series_group_operations.py +++ /dev/null @@ -1,541 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class TimeSeriesGroupOperations(object): - """TimeSeriesGroupOperations operations. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - - self.config = config - - def get( - self, time_series_group_id, custom_headers=None, raw=False, **operation_config): - """Get meta information of the specified time series group. - - This operation fetches detailed information about the specified time - series group. - - :param time_series_group_id: Unique id for time series group. - :type time_series_group_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: TimeSeriesGroup or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.anomalydetector.models.TimeSeriesGroup or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`APIErrorException` - """ - # Construct URL - url = self.get.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'timeSeriesGroupId': self._serialize.url("time_series_group_id", time_series_group_id, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.APIErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('TimeSeriesGroup', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get.metadata = {'url': '/timeseriesgroups/{timeSeriesGroupId}'} - - def create( - self, time_series_group_id, body, custom_headers=None, raw=False, **operation_config): - """Create a time series group. - - Create a time series group. - - :param time_series_group_id: Unique id for time series group. - :type time_series_group_id: str - :param body: GroupId and granularity are needed to create a time - series group - :type body: - ~azure.cognitiveservices.anomalydetector.models.TimeSeriesGroupCreateRequest - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`APIErrorException` - """ - # Construct URL - url = self.create.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'timeSeriesGroupId': self._serialize.url("time_series_group_id", time_series_group_id, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(body, 'TimeSeriesGroupCreateRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.APIErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - create.metadata = {'url': '/timeseriesgroups/{timeSeriesGroupId}'} - - def delete( - self, time_series_group_id, custom_headers=None, raw=False, **operation_config): - """Delete a time series group. - - Delete a time series group. - - :param time_series_group_id: Unique id for time series group. - :type time_series_group_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`APIErrorException` - """ - # Construct URL - url = self.delete.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'timeSeriesGroupId': self._serialize.url("time_series_group_id", time_series_group_id, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.APIErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete.metadata = {'url': '/timeseriesgroups/{timeSeriesGroupId}'} - - def list( - self, next=None, custom_headers=None, raw=False, **operation_config): - """List time series groups. - - List time series groups page by page using the "next" field. It means - that all time series groups have been returned when the "next" field is - null. - - :param next: Use "next" as query parameter to get next page data. - :type next: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: TimeSeriesGroupList or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.anomalydetector.models.TimeSeriesGroupList or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`APIErrorException` - """ - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if next is not None: - query_parameters['next'] = self._serialize.query("next", next, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.APIErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('TimeSeriesGroupList', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list.metadata = {'url': '/timeseriesgroups'} - - def inconsistency_detect( - self, time_series_group_id, timestamp, epsilon=None, custom_headers=None, raw=False, **operation_config): - """Detect inconsistent time series from a group of similar time series. - - This operation helps detect the inconsistent series among a group - series with similar trend. - - :param time_series_group_id: Unique id for time series group. - :type time_series_group_id: str - :param timestamp: Inconsistency detect timestamp. - :type timestamp: datetime - :param epsilon: Parameter to be tuned to get inconsistency. - :type epsilon: float - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: Inconsistency or ClientRawResponse if raw=true - :rtype: ~azure.cognitiveservices.anomalydetector.models.Inconsistency - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`APIErrorException` - """ - body = models.InconsistencyDetectRequest(timestamp=timestamp, epsilon=epsilon) - - # Construct URL - url = self.inconsistency_detect.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'timeSeriesGroupId': self._serialize.url("time_series_group_id", time_series_group_id, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(body, 'InconsistencyDetectRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.APIErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('Inconsistency', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - inconsistency_detect.metadata = {'url': '/timeseriesgroups/{timeSeriesGroupId}/inconsistency/detect'} - - def inconsistency_query( - self, time_series_group_id, begin, end, custom_headers=None, raw=False, **operation_config): - """Query time series properties from a group of similar time series. - - This operation helps query properties of one group, for example the - inconsistent series among a group series with similar trend. - - :param time_series_group_id: Unique id for time series group. - :type time_series_group_id: str - :param begin: Start time of the time series group. - :type begin: datetime - :param end: End time of the time series group. - :type end: datetime - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: list or ClientRawResponse if raw=true - :rtype: - list[~azure.cognitiveservices.anomalydetector.models.Inconsistency] or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`APIErrorException` - """ - body = models.InconsistencyQueryRequest(begin=begin, end=end) - - # Construct URL - url = self.inconsistency_query.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'timeSeriesGroupId': self._serialize.url("time_series_group_id", time_series_group_id, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct body - body_content = self._serialize.body(body, 'InconsistencyQueryRequest') - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.APIErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('[Inconsistency]', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - inconsistency_query.metadata = {'url': '/timeseriesgroups/{timeSeriesGroupId}/inconsistency/query'} - - def list_series( - self, time_series_group_id, next=None, custom_headers=None, raw=False, **operation_config): - """List TimeSeries that belongs to a TimeSeriesGroup. - - List TimeSeries that belongs to a TimeSeriesGroup. One TimeSeriesGroup - could have multiple TimeSeries. - - :param time_series_group_id: Unique id for time series group. - :type time_series_group_id: str - :param next: Use "next" as query parameter to get next page data. - :type next: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: TimeSeriesList or ClientRawResponse if raw=true - :rtype: ~azure.cognitiveservices.anomalydetector.models.TimeSeriesList - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`APIErrorException` - """ - # Construct URL - url = self.list_series.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'timeSeriesGroupId': self._serialize.url("time_series_group_id", time_series_group_id, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - if next is not None: - query_parameters['next'] = self._serialize.query("next", next, 'str') - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.APIErrorException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('TimeSeriesList', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - list_series.metadata = {'url': '/timeseriesgroups/{timeSeriesGroupId}/timeseries'} - - def add_time_series( - self, time_series_group_id, time_series_id, custom_headers=None, raw=False, **operation_config): - """Add a TimeSeries to TimeSeriesGroup. - - Add a TimeSeries to TimeSeriesGroup. - - :param time_series_group_id: Unique id for time series group. - :type time_series_group_id: str - :param time_series_id: Unique id for time series. - :type time_series_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`APIErrorException` - """ - # Construct URL - url = self.add_time_series.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'timeSeriesGroupId': self._serialize.url("time_series_group_id", time_series_group_id, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$'), - 'timeSeriesId': self._serialize.url("time_series_id", time_series_id, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.APIErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - add_time_series.metadata = {'url': '/timeseriesgroups/{timeSeriesGroupId}/timeseries/{timeSeriesId}'} - - def delete_time_series( - self, time_series_group_id, time_series_id, custom_headers=None, raw=False, **operation_config): - """Remove a TimeSeries from TimeSeriesGroup. - - Remove a TimeSeries from TimeSeriesGroup. - - :param time_series_group_id: Unique id for time series group. - :type time_series_group_id: str - :param time_series_id: Unique id for time series. - :type time_series_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`APIErrorException` - """ - # Construct URL - url = self.delete_time_series.metadata['url'] - path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'timeSeriesGroupId': self._serialize.url("time_series_group_id", time_series_group_id, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$'), - 'timeSeriesId': self._serialize.url("time_series_id", time_series_id, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - - # Construct headers - header_parameters = {} - if custom_headers: - header_parameters.update(custom_headers) - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.APIErrorException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - delete_time_series.metadata = {'url': '/timeseriesgroups/{timeSeriesGroupId}/timeseries/{timeSeriesId}'} diff --git a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/operations/time_series_operations.py b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/operations/time_series_operations.py index 93d85b4da771..b9cecf602abf 100644 --- a/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/operations/time_series_operations.py +++ b/sdk/cognitiveservices/azure-cognitiveservices-anomalydetector/azure/cognitiveservices/anomalydetector/operations/time_series_operations.py @@ -46,9 +46,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: TimeSeries or ClientRawResponse if raw=true - :rtype: ~azure.cognitiveservices.anomalydetector.models.TimeSeries or - ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`APIErrorException` """ @@ -73,13 +72,15 @@ def get( request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 404]: raise models.APIErrorException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('TimeSeries', response) + if response.status_code == 404: + deserialized = self._deserialize('APIError', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -106,8 +107,9 @@ def create( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: APIError or ClientRawResponse if raw=true + :rtype: ~azure.cognitiveservices.anomalydetector.models.APIError or + ~msrest.pipeline.ClientRawResponse :raises: :class:`APIErrorException` """ @@ -124,6 +126,7 @@ def create( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) @@ -132,15 +135,22 @@ def create( body_content = self._serialize.body(body, 'TimeSeriesCreateRequest') # Construct and send request - request = self._client.post(url, query_parameters, header_parameters, body_content) + request = self._client.put(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [201, 204, 409]: raise models.APIErrorException(self._deserialize, response) + deserialized = None + + if response.status_code == 409: + deserialized = self._deserialize('APIError', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response + + return deserialized create.metadata = {'url': '/timeseries/{timeSeriesId}'} def delete( @@ -181,7 +191,7 @@ def delete( request = self._client.delete(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [204]: raise models.APIErrorException(self._deserialize, response) if raw: @@ -260,8 +270,9 @@ def write( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: APIError or ClientRawResponse if raw=true + :rtype: ~azure.cognitiveservices.anomalydetector.models.APIError or + ~msrest.pipeline.ClientRawResponse :raises: :class:`APIErrorException` """ @@ -278,6 +289,7 @@ def write( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) @@ -286,15 +298,22 @@ def write( body_content = self._serialize.body(body, '[Point]') # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [204, 404]: raise models.APIErrorException(self._deserialize, response) + deserialized = None + + if response.status_code == 404: + deserialized = self._deserialize('APIError', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response + + return deserialized write.metadata = {'url': '/timeseries/{timeSeriesId}/write'} def detect_on_timestamp( @@ -318,11 +337,8 @@ def detect_on_timestamp( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: AnomalyDetectOnTimestampResponse or ClientRawResponse if - raw=true - :rtype: - ~azure.cognitiveservices.anomalydetector.models.AnomalyDetectOnTimestampResponse - or ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`APIErrorException` """ @@ -351,13 +367,15 @@ def detect_on_timestamp( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 404]: raise models.APIErrorException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('AnomalyDetectOnTimestampResponse', response) + if response.status_code == 404: + deserialized = self._deserialize('APIError', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -384,11 +402,8 @@ def change_point_detect_on_timestamp( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: ChangePointDetectOnTimestampResponse or ClientRawResponse if - raw=true - :rtype: - ~azure.cognitiveservices.anomalydetector.models.ChangePointDetectOnTimestampResponse - or ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`APIErrorException` """ @@ -417,13 +432,15 @@ def change_point_detect_on_timestamp( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 404]: raise models.APIErrorException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('ChangePointDetectOnTimestampResponse', response) + if response.status_code == 404: + deserialized = self._deserialize('APIError', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -452,8 +469,9 @@ def label( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: None or ClientRawResponse if raw=true - :rtype: None or ~msrest.pipeline.ClientRawResponse + :return: APIError or ClientRawResponse if raw=true + :rtype: ~azure.cognitiveservices.anomalydetector.models.APIError or + ~msrest.pipeline.ClientRawResponse :raises: :class:`APIErrorException` """ @@ -470,6 +488,7 @@ def label( # Construct headers header_parameters = {} + header_parameters['Accept'] = 'application/json' header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) @@ -481,12 +500,19 @@ def label( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 404]: raise models.APIErrorException(self._deserialize, response) + deserialized = None + + if response.status_code == 404: + deserialized = self._deserialize('APIError', response) + if raw: - client_raw_response = ClientRawResponse(None, response) + client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response + + return deserialized label.metadata = {'url': '/timeseries/{timeSeriesId}/label'} def query( @@ -503,10 +529,8 @@ def query( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: TimeSeriesQueryResponse or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.anomalydetector.models.TimeSeriesQueryResponse - or ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`APIErrorException` """ @@ -535,13 +559,15 @@ def query( request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 404]: raise models.APIErrorException(self._deserialize, response) deserialized = None if response.status_code == 200: deserialized = self._deserialize('TimeSeriesQueryResponse', response) + if response.status_code == 404: + deserialized = self._deserialize('APIError', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) @@ -550,63 +576,65 @@ def query( return deserialized query.metadata = {'url': '/timeseries/{timeSeriesId}/query'} - def list_groups( - self, time_series_id, next=None, custom_headers=None, raw=False, **operation_config): - """List TimeSeriesGroups that a TimeSeries belongs to. + def inconsistency_detect( + self, body, custom_headers=None, raw=False, **operation_config): + """Detect inconsistent time series from a group of similar time series. - List TimeSeriesGroups that a TimeSeries belongs to. One TimeSeries - could belong to multiple TimeSeriesGroups. + This operation helps detect the inconsistent series among a group + series with similar trend. - :param time_series_id: Unique id for time series. - :type time_series_id: str - :param next: Use "next" as query parameter to get next page data. - :type next: str + :param body: Timestamp is necessary, and a parameter called epsilon is + needed to tune the result. Epsilon should be within 0 and 1. A list of + time series ids need to be provided to the service. + :type body: + ~azure.cognitiveservices.anomalydetector.models.InconsistencyDetectRequest :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: TimeSeriesGroupList or ClientRawResponse if raw=true - :rtype: - ~azure.cognitiveservices.anomalydetector.models.TimeSeriesGroupList or - ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`APIErrorException` """ # Construct URL - url = self.list_groups.metadata['url'] + url = self.inconsistency_detect.metadata['url'] path_format_arguments = { - 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True), - 'timeSeriesId': self._serialize.url("time_series_id", time_series_id, 'str', max_length=64, pattern=r'^[a-z0-9-_]+$') + 'Endpoint': self._serialize.url("self.config.endpoint", self.config.endpoint, 'str', skip_quote=True) } url = self._client.format_url(url, **path_format_arguments) # Construct parameters query_parameters = {} - if next is not None: - query_parameters['next'] = self._serialize.query("next", next, 'str') # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if custom_headers: header_parameters.update(custom_headers) + # Construct body + body_content = self._serialize.body(body, 'InconsistencyDetectRequest') + # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 404]: raise models.APIErrorException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('TimeSeriesGroupList', response) + deserialized = self._deserialize('Inconsistency', response) + if response.status_code == 404: + deserialized = self._deserialize('APIError', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) return client_raw_response return deserialized - list_groups.metadata = {'url': '/timeseries/{timeSeriesId}/timeseriesgroups'} + inconsistency_detect.metadata = {'url': '/timeseries/inconsistency/detect'}