Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release for Cognitive Services - Anomaly Detector #12582

Merged
merged 6 commits into from
Jul 21, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Release History

## 0.3.0 (2020-07-23)

**Features**

- Added operation group AnomalyDetectorClientOperationsMixin
rakshith91 marked this conversation as resolved.
Show resolved Hide resolved
- Added new models `ChangePointDetectRequest` and `ChangePointDetectResponse`

## 0.2.0 (2019-04-12)

**Bugfixes**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
## Microsoft Azure SDK for Python
# Microsoft Azure SDK for Python

This is the Microsoft Azure Cognitive Services Anomaly Detector Client
Library.
This is the Microsoft Azure Cognitive Services Anomaly Detector Client Library.
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
For a more complete view of Azure libraries, see the [Github repo](https://github.com/Azure/azure-sdk-for-python/)

This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

For a more complete set of Azure libraries, see the
[azure](https://pypi.python.org/pypi/azure) bundle package.
# Usage

## Usage

For code examples, see [Cognitive Services Anomaly
Detector](https://docs.microsoft.com/python/api/overview/azure/cognitive-services)
For code examples, see [Cognitive Services Anomaly Detector](https://docs.microsoft.com/python/api/overview/azure/cognitive-services)
on docs.microsoft.com.

## Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in
the [Issues](https://github.com/Azure/azure-sdk-for-python/issues)
# Provide Feedback

If you encounter any bugs or have suggestions, please file an issue in the
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
section of the project.

![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-anomalydetector%2FREADME.png)

![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-cognitiveservices-anomalydetector%2FREADME.png)
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
# regenerated.
# --------------------------------------------------------------------------

from .anomaly_detector_client import AnomalyDetectorClient
from .version import VERSION
from ._configuration import AnomalyDetectorClientConfiguration
from ._anomaly_detector_client import AnomalyDetectorClient
__all__ = ['AnomalyDetectorClient', 'AnomalyDetectorClientConfiguration']

__all__ = ['AnomalyDetectorClient']
from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# 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.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import AnomalyDetectorClientConfiguration
from .operations import AnomalyDetectorClientOperationsMixin
from . import models


class AnomalyDetectorClient(AnomalyDetectorClientOperationsMixin, SDKClient):
"""The Anomaly Detector API detects anomalies automatically in time series data. It supports two kinds of mode, one is for stateless using, another is for stateful using. In stateless mode, there are three functionalities. Entire Detect is for detecting the whole series with model trained by the time series, Last Detect is detecting last point with model trained by points before. ChangePoint Detect is for detecting trend changes in time series. In stateful mode, user can store time series, the stored time series will be used for detection anomalies. Under this mode, user can still use the above three functionalities by only giving a time range without preparing time series in client side. Besides the above three functionalities, stateful model also provide group based detection and labeling service. By leveraging labeling service user can provide labels for each detection result, these labels will be used for retuning or regenerating detection models. Inconsistency detection is a kind of group based detection, this detection will find inconsistency ones in a set of time series. By using anomaly detector service, business customers can discover incidents and establish a logic flow for root cause analysis.

:ivar config: Configuration for client.
:vartype config: AnomalyDetectorClientConfiguration

:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus2.api.cognitive.microsoft.com).
:type endpoint: str
:param credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
"""

def __init__(
self, endpoint, credentials):

self.config = AnomalyDetectorClientConfiguration(endpoint, credentials)
super(AnomalyDetectorClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '1.0'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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 import Configuration

from .version import VERSION


class AnomalyDetectorClientConfiguration(Configuration):
"""Configuration for AnomalyDetectorClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param endpoint: Supported Cognitive Services endpoints (protocol and
hostname, for example: https://westus2.api.cognitive.microsoft.com).
:type endpoint: str
:param credentials: Subscription credentials which uniquely identify
client subscription.
:type credentials: None
"""

def __init__(
self, endpoint, credentials):

if endpoint is None:
raise ValueError("Parameter 'endpoint' must not be None.")
if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
base_url = '{Endpoint}/anomalydetector/v1.0'

super(AnomalyDetectorClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

self.add_user_agent('azure-cognitiveservices-anomalydetector/{}'.format(VERSION))

self.endpoint = endpoint
self.credentials = credentials
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,32 @@
# --------------------------------------------------------------------------

try:
from .api_error_py3 import APIError, APIErrorException
from .point_py3 import Point
from .request_py3 import Request
from .entire_detect_response_py3 import EntireDetectResponse
from .last_detect_response_py3 import LastDetectResponse
from ._models_py3 import APIError, APIErrorException
from ._models_py3 import ChangePointDetectRequest
from ._models_py3 import ChangePointDetectResponse
from ._models_py3 import EntireDetectResponse
from ._models_py3 import LastDetectResponse
from ._models_py3 import Point
from ._models_py3 import Request
except (SyntaxError, ImportError):
from .api_error import APIError, APIErrorException
from .point import Point
from .request import Request
from .entire_detect_response import EntireDetectResponse
from .last_detect_response import LastDetectResponse
from .anomaly_detector_client_enums import (
from ._models import APIError, APIErrorException
from ._models import ChangePointDetectRequest
from ._models import ChangePointDetectResponse
from ._models import EntireDetectResponse
from ._models import LastDetectResponse
from ._models import Point
from ._models import Request
from ._anomaly_detector_client_enums import (
Granularity,
)

__all__ = [
'APIError', 'APIErrorException',
'Point',
'Request',
'ChangePointDetectRequest',
'ChangePointDetectResponse',
'EntireDetectResponse',
'LastDetectResponse',
'Point',
'Request',
'Granularity',
]
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ class Granularity(str, Enum):
daily = "daily"
hourly = "hourly"
minutely = "minutely"
secondly = "secondly"
Loading