diff --git a/Gopkg.lock b/Gopkg.lock index 78017f1ee6b6..0435d05bffa5 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -82,6 +82,14 @@ pruneopts = "" revision = "eeefdecb41b842af6dc652aaea4026e8403e62df" +[[projects]] + digest = "1:141cc9fc6279592458b304038bd16a05ef477d125c6dad281216345a11746fd7" + name = "github.com/gofrs/uuid" + packages = ["."] + pruneopts = "" + revision = "6b08a5c5172ba18946672b49749cde22873dd7c2" + version = "v3.2.0" + [[projects]] digest = "1:3dd078fda7500c341bc26cfbc6c6a34614f295a2457149fc1045cab767cbcf18" name = "github.com/golang/protobuf" @@ -383,6 +391,7 @@ "github.com/dnaeon/go-vcr/cassette", "github.com/dnaeon/go-vcr/recorder", "github.com/globalsign/mgo", + "github.com/gofrs/uuid", "github.com/marstr/collection", "github.com/marstr/guid", "github.com/pkg/errors", diff --git a/profiles/latest/cognitiveservices/anomalyfinder/models.go b/profiles/latest/cognitiveservices/anomalyfinder/models.go deleted file mode 100644 index 13cea3644e49..000000000000 --- a/profiles/latest/cognitiveservices/anomalyfinder/models.go +++ /dev/null @@ -1,56 +0,0 @@ -// +build go1.9 - -// Copyright 2019 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This code was auto-generated by: -// github.com/Azure/azure-sdk-for-go/tools/profileBuilder - -package anomalyfinder - -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder" - -type Granularity = original.Granularity - -const ( - Daily Granularity = original.Daily - Hourly Granularity = original.Hourly - Minutely Granularity = original.Minutely - Monthly Granularity = original.Monthly - Weekly Granularity = original.Weekly - Yearly Granularity = original.Yearly -) - -type APIError = original.APIError -type BaseClient = original.BaseClient -type EntireDetectResponse = original.EntireDetectResponse -type LastDetectResponse = original.LastDetectResponse -type Point = original.Point -type Request = original.Request - -func New(endpoint string) BaseClient { - return original.New(endpoint) -} -func NewWithoutDefaults(endpoint string) BaseClient { - return original.NewWithoutDefaults(endpoint) -} -func PossibleGranularityValues() []Granularity { - return original.PossibleGranularityValues() -} -func UserAgent() string { - return original.UserAgent() + " profiles/latest" -} -func Version() string { - return original.Version() -} diff --git a/profiles/preview/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go b/profiles/preview/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go deleted file mode 100644 index 497b8771a7f0..000000000000 --- a/profiles/preview/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build go1.9 - -// Copyright 2019 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This code was auto-generated by: -// github.com/Azure/azure-sdk-for-go/tools/profileBuilder - -package anomalyfinderapi - -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi" - -type BaseClientAPI = original.BaseClientAPI diff --git a/profiles/latest/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go b/profiles/preview/preview/cognitiveservices/anomalydetector/anomalydetectorapi/models.go similarity index 83% rename from profiles/latest/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go rename to profiles/preview/preview/cognitiveservices/anomalydetector/anomalydetectorapi/models.go index 497b8771a7f0..59baf9caf7bb 100644 --- a/profiles/latest/cognitiveservices/anomalyfinder/anomalyfinderapi/models.go +++ b/profiles/preview/preview/cognitiveservices/anomalydetector/anomalydetectorapi/models.go @@ -17,8 +17,8 @@ // This code was auto-generated by: // github.com/Azure/azure-sdk-for-go/tools/profileBuilder -package anomalyfinderapi +package anomalydetectorapi -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/cognitiveservices/v1.0/anomalydetector/anomalydetectorapi" type BaseClientAPI = original.BaseClientAPI diff --git a/profiles/preview/cognitiveservices/anomalyfinder/models.go b/profiles/preview/preview/cognitiveservices/anomalydetector/models.go similarity index 92% rename from profiles/preview/cognitiveservices/anomalyfinder/models.go rename to profiles/preview/preview/cognitiveservices/anomalydetector/models.go index a0cb7dd25a4f..5eb8fb76e4e3 100644 --- a/profiles/preview/cognitiveservices/anomalyfinder/models.go +++ b/profiles/preview/preview/cognitiveservices/anomalydetector/models.go @@ -17,9 +17,9 @@ // This code was auto-generated by: // github.com/Azure/azure-sdk-for-go/tools/profileBuilder -package anomalyfinder +package anomalydetector -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder" +import original "github.com/Azure/azure-sdk-for-go/services/preview/cognitiveservices/v1.0/anomalydetector" type Granularity = original.Granularity diff --git a/profiles/preview/preview/iotspaces/mgmt/iotspaces/models.go b/profiles/preview/preview/iotspaces/mgmt/iotspaces/models.go index 6b6c901de55e..2a3a6894448b 100644 --- a/profiles/preview/preview/iotspaces/mgmt/iotspaces/models.go +++ b/profiles/preview/preview/iotspaces/mgmt/iotspaces/models.go @@ -23,7 +23,7 @@ import ( "context" original "github.com/Azure/azure-sdk-for-go/services/preview/iotspaces/mgmt/2017-10-01-preview/iotspaces" - uuid "github.com/satori/go.uuid" + "github.com/gofrs/uuid" ) const ( diff --git a/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi/interfaces.go b/services/preview/cognitiveservices/v1.0/anomalydetector/anomalydetectorapi/interfaces.go similarity index 68% rename from services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi/interfaces.go rename to services/preview/cognitiveservices/v1.0/anomalydetector/anomalydetectorapi/interfaces.go index 8207746acb0f..f57b8a48443e 100644 --- a/services/cognitiveservices/v2.0/anomalyfinder/anomalyfinderapi/interfaces.go +++ b/services/preview/cognitiveservices/v1.0/anomalydetector/anomalydetectorapi/interfaces.go @@ -1,4 +1,4 @@ -package anomalyfinderapi +package anomalydetectorapi // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -19,13 +19,13 @@ package anomalyfinderapi import ( "context" - "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder" + "github.com/Azure/azure-sdk-for-go/services/preview/cognitiveservices/v1.0/anomalydetector" ) // BaseClientAPI contains the set of methods on the BaseClient type. type BaseClientAPI interface { - EntireDetect(ctx context.Context, body anomalyfinder.Request) (result anomalyfinder.EntireDetectResponse, err error) - LastDetect(ctx context.Context, body anomalyfinder.Request) (result anomalyfinder.LastDetectResponse, err error) + EntireDetect(ctx context.Context, body anomalydetector.Request) (result anomalydetector.EntireDetectResponse, err error) + LastDetect(ctx context.Context, body anomalydetector.Request) (result anomalydetector.LastDetectResponse, err error) } -var _ BaseClientAPI = (*anomalyfinder.BaseClient)(nil) +var _ BaseClientAPI = (*anomalydetector.BaseClient)(nil) diff --git a/services/cognitiveservices/v2.0/anomalyfinder/client.go b/services/preview/cognitiveservices/v1.0/anomalydetector/client.go similarity index 74% rename from services/cognitiveservices/v2.0/anomalyfinder/client.go rename to services/preview/cognitiveservices/v1.0/anomalydetector/client.go index b02ba0768ddd..a7f9c10fc8d4 100644 --- a/services/cognitiveservices/v2.0/anomalyfinder/client.go +++ b/services/preview/cognitiveservices/v1.0/anomalydetector/client.go @@ -1,10 +1,10 @@ -// Package anomalyfinder implements the Azure ARM Anomalyfinder service API version 2.0. +// Package anomalydetector implements the Azure ARM Anomalydetector service API version 1.0. // -// The Anomaly Finder API detects anomalies automatically in time series data. It supports two functionalities, one is -// for detecting the whole series with model trained by the timeseries, another is detecting last point with model +// The Anomaly Detector API detects anomalies automatically in time series data. It supports two functionalities, one +// is for detecting the whole series with model trained by the timeseries, another is detecting last point with model // trained by points before. By using this service, business customers can discover incidents and establish a logic // flow for root cause analysis. -package anomalyfinder +package anomalydetector // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -32,7 +32,7 @@ import ( "net/http" ) -// BaseClient is the base client for Anomalyfinder. +// BaseClient is the base client for Anomalydetector. type BaseClient struct { autorest.Client Endpoint string @@ -51,9 +51,9 @@ func NewWithoutDefaults(endpoint string) BaseClient { } } -// EntireDetect the operation will generate a model using the entire series, each point will be detected with the same -// model. In this method, points before and after a certain point will be used to determine whether it's an anomaly. -// The entire detection can give user an overall status of the time series. +// EntireDetect 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. // Parameters: // body - time series points and period if needed. Advanced model parameters can also be set in the request. func (client BaseClient) EntireDetect(ctx context.Context, body Request) (result EntireDetectResponse, err error) { @@ -70,25 +70,25 @@ func (client BaseClient) EntireDetect(ctx context.Context, body Request) (result if err := validation.Validate([]validation.Validation{ {TargetValue: body, Constraints: []validation.Constraint{{Target: "body.Series", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("anomalyfinder.BaseClient", "EntireDetect", err.Error()) + return result, validation.NewError("anomalydetector.BaseClient", "EntireDetect", err.Error()) } req, err := client.EntireDetectPreparer(ctx, body) if err != nil { - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "EntireDetect", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "anomalydetector.BaseClient", "EntireDetect", nil, "Failure preparing request") return } resp, err := client.EntireDetectSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "EntireDetect", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "anomalydetector.BaseClient", "EntireDetect", resp, "Failure sending request") return } result, err = client.EntireDetectResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "EntireDetect", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "anomalydetector.BaseClient", "EntireDetect", resp, "Failure responding to request") } return @@ -103,7 +103,7 @@ func (client BaseClient) EntireDetectPreparer(ctx context.Context, body Request) preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/anomalyfinder/v2.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/anomalydetector/v1.0", urlParameters), autorest.WithPath("/timeseries/entire/detect"), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) @@ -129,9 +129,9 @@ func (client BaseClient) EntireDetectResponder(resp *http.Response) (result Enti return } -// LastDetect the operation will generate a model using points before the latest one, In this method, only history -// points are used for determine whether the target point is an anomaly. Latest point detecting matches the scenario of -// real-time monitoring of business metrics. +// LastDetect this operation generates a model using points before the latest one. With this method, only historical +// points are used to determine whether the target point is an anomaly. The latest point detecting operation matches +// the scenario of real-time monitoring of business metrics. // Parameters: // body - time series points and period if needed. Advanced model parameters can also be set in the request. func (client BaseClient) LastDetect(ctx context.Context, body Request) (result LastDetectResponse, err error) { @@ -148,25 +148,25 @@ func (client BaseClient) LastDetect(ctx context.Context, body Request) (result L if err := validation.Validate([]validation.Validation{ {TargetValue: body, Constraints: []validation.Constraint{{Target: "body.Series", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { - return result, validation.NewError("anomalyfinder.BaseClient", "LastDetect", err.Error()) + return result, validation.NewError("anomalydetector.BaseClient", "LastDetect", err.Error()) } req, err := client.LastDetectPreparer(ctx, body) if err != nil { - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "LastDetect", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "anomalydetector.BaseClient", "LastDetect", nil, "Failure preparing request") return } resp, err := client.LastDetectSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "LastDetect", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "anomalydetector.BaseClient", "LastDetect", resp, "Failure sending request") return } result, err = client.LastDetectResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "anomalyfinder.BaseClient", "LastDetect", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "anomalydetector.BaseClient", "LastDetect", resp, "Failure responding to request") } return @@ -181,7 +181,7 @@ func (client BaseClient) LastDetectPreparer(ctx context.Context, body Request) ( preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/anomalyfinder/v2.0", urlParameters), + autorest.WithCustomBaseURL("{Endpoint}/anomalydetector/v1.0", urlParameters), autorest.WithPath("/timeseries/last/detect"), autorest.WithJSON(body)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) diff --git a/services/cognitiveservices/v2.0/anomalyfinder/models.go b/services/preview/cognitiveservices/v1.0/anomalydetector/models.go similarity index 93% rename from services/cognitiveservices/v2.0/anomalyfinder/models.go rename to services/preview/cognitiveservices/v1.0/anomalydetector/models.go index 8ea88ea46f2b..e82f87857fdb 100644 --- a/services/cognitiveservices/v2.0/anomalyfinder/models.go +++ b/services/preview/cognitiveservices/v1.0/anomalydetector/models.go @@ -1,4 +1,4 @@ -package anomalyfinder +package anomalydetector // Copyright (c) Microsoft and contributors. All rights reserved. // @@ -23,7 +23,7 @@ import ( ) // The package's fully qualified name. -const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.0/anomalyfinder" +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/cognitiveservices/v1.0/anomalydetector" // Granularity enumerates the values for granularity. type Granularity string @@ -63,9 +63,9 @@ type EntireDetectResponse struct { Period *int32 `json:"period,omitempty"` // ExpectedValues - ExpectedValues contain expected value for each input point. The index of the array is consistent with the input series. ExpectedValues *[]float64 `json:"expectedValues,omitempty"` - // UpperMargins - UpperMargins contain upper margin of each input point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - sensitivity)*upperMargin. Anomalies in response can be filtered by upperBoundary and lowerBoundary. By adjusting sensitivity value, less significant anomalies can be filtered in client side. The index of the array is consistent with the input series. + // UpperMargins - UpperMargins contain upper margin of each input point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin. Anomalies in response can be filtered by upperBoundary and lowerBoundary. By adjusting marginScale value, less significant anomalies can be filtered in client side. The index of the array is consistent with the input series. UpperMargins *[]float64 `json:"upperMargins,omitempty"` - // LowerMargins - LowerMargins contain lower margin of each input point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - sensitivity)*lowerMargin. Points between the boundary can be marked as normal ones in client side. The index of the array is consistent with the input series. + // LowerMargins - LowerMargins contain lower margin of each input point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin. Points between the boundary can be marked as normal ones in client side. The index of the array is consistent with the input series. LowerMargins *[]float64 `json:"lowerMargins,omitempty"` // IsAnomaly - IsAnomaly contains anomaly 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. IsAnomaly *[]bool `json:"isAnomaly,omitempty"` @@ -84,9 +84,9 @@ type LastDetectResponse struct { SuggestedWindow *int32 `json:"suggestedWindow,omitempty"` // ExpectedValue - Expected value of the latest point. ExpectedValue *float64 `json:"expectedValue,omitempty"` - // UpperMargin - Upper margin of the latest point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - sensitivity)*upperMargin. If the value of latest point is between upperBoundary and lowerBoundary, it should be treated as normal value. By adjusting sensitivity value, anomaly status of latest point can be changed. + // UpperMargin - Upper margin of the latest point. UpperMargin is used to calculate upperBoundary, which equals to expectedValue + (100 - marginScale)*upperMargin. If the value of latest point is between upperBoundary and lowerBoundary, it should be treated as normal value. By adjusting marginScale value, anomaly status of latest point can be changed. UpperMargin *float64 `json:"upperMargin,omitempty"` - // LowerMargin - Lower margin of the latest point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - sensitivity)*lowerMargin. + // LowerMargin - Lower margin of the latest point. LowerMargin is used to calculate lowerBoundary, which equals to expectedValue - (100 - marginScale)*lowerMargin. LowerMargin *float64 `json:"lowerMargin,omitempty"` // IsAnomaly - Anomaly status of the latest point, true means the latest point is an anomaly either in negative direction or positive direction. IsAnomaly *bool `json:"isAnomaly,omitempty"` diff --git a/services/cognitiveservices/v2.0/anomalyfinder/version.go b/services/preview/cognitiveservices/v1.0/anomalydetector/version.go similarity index 91% rename from services/cognitiveservices/v2.0/anomalyfinder/version.go rename to services/preview/cognitiveservices/v1.0/anomalydetector/version.go index 1d6689bd944f..7ba25aa0af9e 100644 --- a/services/cognitiveservices/v2.0/anomalyfinder/version.go +++ b/services/preview/cognitiveservices/v1.0/anomalydetector/version.go @@ -1,4 +1,4 @@ -package anomalyfinder +package anomalydetector import "github.com/Azure/azure-sdk-for-go/version" @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " anomalyfinder/2.0" + return "Azure-SDK-For-Go/" + version.Number + " anomalydetector/1.0" } // Version returns the semantic version (see http://semver.org) of the client.