forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 16680 in Azure/azure-rest-api-specs
Merge bcbbe3b9101a764ea868c01d288d23030094c802 into ddda805
- Loading branch information
SDKAuto
committed
Nov 8, 2021
1 parent
3a14782
commit bc03afd
Showing
20 changed files
with
3,251 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Release History | ||
|
||
## 0.1.0 (1970-01-01) | ||
|
||
* Initial Release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include _meta.json | ||
recursive-include tests *.py *.yaml | ||
include *.md | ||
include azure/__init__.py | ||
include azure/ai/__init__.py | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# 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 | ||
|
||
|
||
To learn how to use this package, see the [quickstart guide](https://aka.ms/azsdk/python/mgmt) | ||
|
||
|
||
|
||
For docs and references, see [Python SDK References](https://docs.microsoft.com/python/api/overview/azure/) | ||
Code samples for this package can be found at [MyService Management](https://docs.microsoft.com/samples/browse/?languages=python&term=Getting%20started%20-%20Managing&terms=Getting%20started%20-%20Managing) on docs.microsoft.com. | ||
Additional code samples for different Azure services are available at [Samples Repo](https://aka.ms/azsdk/python/mgmt/samples) | ||
|
||
|
||
# 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. | ||
|
||
|
||
 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"autorest": "V2", | ||
"use": "@microsoft.azure/autorest.python@~4.0.71", | ||
"commit": "a9e4cf01c27f2153eb2c2fc8afaac437d0f75b01", | ||
"repository_url": "https://github.com/Azure/azure-rest-api-specs", | ||
"autorest_command": "autorest specification/cognitiveservices/data-plane/AnomalyDetector/readme.md --keep-version-file --multiapi --no-async --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk [email protected]/autorest.python@~4.0.71 --version=V2", | ||
"readme": "specification/cognitiveservices/data-plane/AnomalyDetector/readme.md" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
1 change: 1 addition & 0 deletions
1
sdk/anomalydetector/azure-ai-anomalydetector/azure/ai/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
19 changes: 19 additions & 0 deletions
19
sdk/anomalydetector/azure-ai-anomalydetector/azure/ai/anomalydetector/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
45 changes: 45 additions & 0 deletions
45
...alydetector/azure-ai-anomalydetector/azure/ai/anomalydetector/_anomaly_detector_client.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# 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 msrest.exceptions import HttpOperationError | ||
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.1-preview' | ||
self._serialize = Serializer(client_models) | ||
self._deserialize = Deserializer(client_models) | ||
|
47 changes: 47 additions & 0 deletions
47
sdk/anomalydetector/azure-ai-anomalydetector/azure/ai/anomalydetector/_configuration.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.1-preview' | ||
|
||
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 |
109 changes: 109 additions & 0 deletions
109
sdk/anomalydetector/azure-ai-anomalydetector/azure/ai/anomalydetector/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
# 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 AlignPolicy | ||
from ._models_py3 import AnomalyContributor | ||
from ._models_py3 import AnomalyDetectorError, AnomalyDetectorErrorException | ||
from ._models_py3 import AnomalyInterpretation | ||
from ._models_py3 import AnomalyState | ||
from ._models_py3 import AnomalyValue | ||
from ._models_py3 import ChangePointDetectRequest | ||
from ._models_py3 import ChangePointDetectResponse | ||
from ._models_py3 import CorrelationChanges | ||
from ._models_py3 import DetectionRequest | ||
from ._models_py3 import DetectionResult | ||
from ._models_py3 import DetectionResultSummary | ||
from ._models_py3 import DetectRequest | ||
from ._models_py3 import DiagnosticsInfo | ||
from ._models_py3 import EntireDetectResponse | ||
from ._models_py3 import ErrorResponse, ErrorResponseException | ||
from ._models_py3 import LastDetectionRequest | ||
from ._models_py3 import LastDetectionResult | ||
from ._models_py3 import LastDetectResponse | ||
from ._models_py3 import Model | ||
from ._models_py3 import ModelInfo | ||
from ._models_py3 import ModelList | ||
from ._models_py3 import ModelSnapshot | ||
from ._models_py3 import ModelState | ||
from ._models_py3 import TimeSeriesPoint | ||
from ._models_py3 import VariableState | ||
from ._models_py3 import VariableValues | ||
except (SyntaxError, ImportError): | ||
from ._models import AlignPolicy | ||
from ._models import AnomalyContributor | ||
from ._models import AnomalyDetectorError, AnomalyDetectorErrorException | ||
from ._models import AnomalyInterpretation | ||
from ._models import AnomalyState | ||
from ._models import AnomalyValue | ||
from ._models import ChangePointDetectRequest | ||
from ._models import ChangePointDetectResponse | ||
from ._models import CorrelationChanges | ||
from ._models import DetectionRequest | ||
from ._models import DetectionResult | ||
from ._models import DetectionResultSummary | ||
from ._models import DetectRequest | ||
from ._models import DiagnosticsInfo | ||
from ._models import EntireDetectResponse | ||
from ._models import ErrorResponse, ErrorResponseException | ||
from ._models import LastDetectionRequest | ||
from ._models import LastDetectionResult | ||
from ._models import LastDetectResponse | ||
from ._models import Model | ||
from ._models import ModelInfo | ||
from ._models import ModelList | ||
from ._models import ModelSnapshot | ||
from ._models import ModelState | ||
from ._models import TimeSeriesPoint | ||
from ._models import VariableState | ||
from ._models import VariableValues | ||
from ._anomaly_detector_client_enums import ( | ||
AlignMode, | ||
DetectionStatus, | ||
FillNAMethod, | ||
ModelStatus, | ||
TimeGranularity, | ||
) | ||
|
||
__all__ = [ | ||
'AlignPolicy', | ||
'AnomalyContributor', | ||
'AnomalyDetectorError', 'AnomalyDetectorErrorException', | ||
'AnomalyInterpretation', | ||
'AnomalyState', | ||
'AnomalyValue', | ||
'ChangePointDetectRequest', | ||
'ChangePointDetectResponse', | ||
'CorrelationChanges', | ||
'DetectionRequest', | ||
'DetectionResult', | ||
'DetectionResultSummary', | ||
'DetectRequest', | ||
'DiagnosticsInfo', | ||
'EntireDetectResponse', | ||
'ErrorResponse', 'ErrorResponseException', | ||
'LastDetectionRequest', | ||
'LastDetectionResult', | ||
'LastDetectResponse', | ||
'Model', | ||
'ModelInfo', | ||
'ModelList', | ||
'ModelSnapshot', | ||
'ModelState', | ||
'TimeSeriesPoint', | ||
'VariableState', | ||
'VariableValues', | ||
'TimeGranularity', | ||
'AlignMode', | ||
'FillNAMethod', | ||
'ModelStatus', | ||
'DetectionStatus', | ||
] |
57 changes: 57 additions & 0 deletions
57
...zure-ai-anomalydetector/azure/ai/anomalydetector/models/_anomaly_detector_client_enums.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# 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" | ||
|
||
|
||
class AlignMode(str, Enum): | ||
|
||
inner = "Inner" | ||
outer = "Outer" | ||
|
||
|
||
class FillNAMethod(str, Enum): | ||
|
||
previous = "Previous" | ||
subsequent = "Subsequent" | ||
linear = "Linear" | ||
zero = "Zero" | ||
pad = "Pad" | ||
not_fill = "NotFill" | ||
|
||
|
||
class ModelStatus(str, Enum): | ||
|
||
created = "CREATED" | ||
running = "RUNNING" | ||
ready = "READY" | ||
failed = "FAILED" | ||
|
||
|
||
class DetectionStatus(str, Enum): | ||
|
||
created = "CREATED" | ||
running = "RUNNING" | ||
ready = "READY" | ||
failed = "FAILED" |
Oops, something went wrong.