Skip to content

Commit

Permalink
CodeGen from PR 12487 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge d61813cee043dd6c6eab26e78b83621cb47109b6 into 2482ad8
  • Loading branch information
SDKAuto committed Feb 8, 2021
1 parent 14eb6f7 commit 8eb9754
Show file tree
Hide file tree
Showing 19 changed files with 1,291 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sdk/anomalydetector/azure-ai-anomalydetector/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Release History

## 0.1.0 (1970-01-01)

* Initial Release
5 changes: 5 additions & 0 deletions sdk/anomalydetector/azure-ai-anomalydetector/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
include azure/ai/__init__.py

21 changes: 21 additions & 0 deletions sdk/anomalydetector/azure-ai-anomalydetector/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Microsoft Azure SDK for Python

This is the Microsoft Azure MyService Management 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 [azure sdk python release](https://aka.ms/azsdk/python/all).


# Usage

For code examples, see [MyService Management](https://docs.microsoft.com/python/api/overview/azure/)
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)
section of the project.


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-ai-anomalydetector%2FREADME.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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 ._configuration import AnomalyDetectorClientConfiguration
from ._anomaly_detector_client import AnomalyDetectorClient
__all__ = ['AnomalyDetectorClient', 'AnomalyDetectorClientConfiguration']

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-ai-anomalydetector/{}'.format(VERSION))

self.endpoint = endpoint
self.credentials = credentials
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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.
# --------------------------------------------------------------------------

try:
from ._models_py3 import AnomalyDetectorError, AnomalyDetectorErrorException
from ._models_py3 import ChangePointDetectRequest
from ._models_py3 import ChangePointDetectResponse
from ._models_py3 import DetectRequest
from ._models_py3 import EntireDetectResponse
from ._models_py3 import LastDetectResponse
from ._models_py3 import TimeSeriesPoint
except (SyntaxError, ImportError):
from ._models import AnomalyDetectorError, AnomalyDetectorErrorException
from ._models import ChangePointDetectRequest
from ._models import ChangePointDetectResponse
from ._models import DetectRequest
from ._models import EntireDetectResponse
from ._models import LastDetectResponse
from ._models import TimeSeriesPoint
from ._anomaly_detector_client_enums import (
TimeGranularity,
)

__all__ = [
'AnomalyDetectorError', 'AnomalyDetectorErrorException',
'ChangePointDetectRequest',
'ChangePointDetectResponse',
'DetectRequest',
'EntireDetectResponse',
'LastDetectResponse',
'TimeSeriesPoint',
'TimeGranularity',
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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 enum import Enum


class TimeGranularity(str, Enum):

yearly = "yearly"
monthly = "monthly"
weekly = "weekly"
daily = "daily"
hourly = "hourly"
per_minute = "minutely"
per_second = "secondly"
microsecond = "microsecond"
none = "none"
Loading

0 comments on commit 8eb9754

Please sign in to comment.