Skip to content

Commit

Permalink
Update contract for anomaly detector (Azure#12487)
Browse files Browse the repository at this point in the history
* update contract for anomaly detector

* make severity optional

* contract update

* update according to PR

* update values

* update

* prettier fix

* split the PR into two parts, this pr adds two enum values into the granularity and make timestamp optional

* change preview to stable

* update to stable version

* fix build failure

* update

* update

Co-authored-by: [email protected] <[email protected]>
  • Loading branch information
2 people authored and mkarmark committed Jul 20, 2021
1 parent 44ba5b4 commit a38e6df
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ These settings apply only when `--tag=release_1_0 --go` is specified on the comm
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.

``` yaml $(tag) == 'release_1_0' && $(go)
output-folder: $(go-sdk-folder)/services/preview/cognitiveservices/v1.0/$(namespace)
output-folder: $(go-sdk-folder)/services/cognitiveservices/v1.0/$(namespace)
```
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ openapi-type: data-plane
These settings apply only when `--tag=release_1_0` is specified on the command line.

``` yaml $(tag) == 'release_1_0'
input-file: preview/v1.0/AnomalyDetector.json
input-file: stable/v1.0/AnomalyDetector.json
```

## Swagger to SDK
Expand Down Expand Up @@ -77,7 +77,7 @@ java:
regenerate-manager: true
```

## Multi-API/Profile support for AutoRest v3 generators
## Multi-API/Profile support for AutoRest v3 generators

AutoRest V3 generators require the use of `--tag=all-api-versions` to select api files.

Expand All @@ -89,15 +89,15 @@ require: $(this-folder)/../../../../profiles/readme.md
# all the input files across all versions
input-file:
- $(this-folder)/preview/v1.0/AnomalyDetector.json
- $(this-folder)/stable/v1.0/AnomalyDetector.json
```

If there are files that should not be in the `all-api-versions` set,
If there are files that should not be in the `all-api-versions` set,
uncomment the `exclude-file` section below and add the file paths.

``` yaml $(tag) == 'all-api-versions'
#exclude-file:
#exclude-file:
# - $(this-folder)/Microsoft.Example/stable/2010-01-01/somefile.json
```

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"/timeseries/entire/detect": {
"post": {
"summary": "Detect anomalies for the entire series in batch.",
"description": "This operation generates a model using an entire series, each point is detected with the same model. With this method, points before and after a certain point are used to determine whether it is an anomaly. The entire detection can give user an overall status of the time series.",
"description": "This operation generates a model with an entire series, each point is detected with the same model. With this method, points before and after a certain point are used to determine whether it is an anomaly. The entire detection can give user an overall status of the time series.",
"operationId": "DetectEntireSeries",
"parameters": [
{
Expand Down Expand Up @@ -188,7 +188,7 @@
},
"TimeGranularity": {
"type": "string",
"description": "Can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is used for verify whether input series is valid.",
"description": "Optional argument, can be one of yearly, monthly, weekly, daily, hourly, minutely, secondly, microsecond or none. If granularity is not present, it will be none by default. If granularity is none, the timestamp property in time series point can be absent.",
"x-nullable": false,
"x-ms-enum": {
"name": "TimeGranularity",
Expand Down Expand Up @@ -216,6 +216,12 @@
{
"name": "perSecond",
"value": "secondly"
},
{
"value": "microsecond"
},
{
"value": "none"
}
]
},
Expand All @@ -226,7 +232,9 @@
"daily",
"hourly",
"minutely",
"secondly"
"secondly",
"microsecond",
"none"
]
},
"CustomInterval": {
Expand All @@ -238,7 +246,6 @@
"DetectRequest": {
"type": "object",
"required": [
"granularity",
"series"
],
"properties": {
Expand Down Expand Up @@ -276,14 +283,13 @@
"TimeSeriesPoint": {
"type": "object",
"required": [
"timestamp",
"value"
],
"properties": {
"timestamp": {
"type": "string",
"format": "date-time",
"description": "Timestamp of a data point (ISO8601 format)."
"description": "Optional argument, timestamp of a data point (ISO8601 format)."
},
"value": {
"type": "number",
Expand Down Expand Up @@ -455,22 +461,19 @@
},
"ChangePointDetectResponse": {
"type": "object",
"required": [
"isChangePoint",
"confidenceScores",
"period"
],
"properties": {
"period": {
"type": "integer",
"format": "int32",
"readOnly": true,
"description": "Frequency extracted from the series, zero means no recurrent pattern has been found."
},
"isChangePoint": {
"type": "array",
"description": "isChangePoint contains change point properties for each input point. True means an anomaly either negative or positive has been detected. The index of the array is consistent with the input series.",
"items": {
"type": "boolean",
"readOnly": true,
"x-nullable": false
}
},
Expand All @@ -480,6 +483,7 @@
"items": {
"type": "number",
"format": "float",
"readOnly": true,
"x-nullable": false
}
}
Expand Down

0 comments on commit a38e6df

Please sign in to comment.