Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Use block comment
Browse files Browse the repository at this point in the history
  • Loading branch information
VijayanB committed Aug 12, 2020
1 parent 31b41e4 commit 05c5426
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 60 deletions.
Binary file added cli/esad
Binary file not shown.
120 changes: 60 additions & 60 deletions cli/internal/gateway/ad/ad.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,56 +61,56 @@ func (g *gateway) buildCreateURL() (*url.URL, error) {
return endpoint, nil
}

// CreateDetector Creates an anomaly detector job.
// It calls http request: POST _opendistro/_anomaly_detection/detectors
// Sample Input:
// {
// "name": "test-detector",
// "description": "Test detector",
// "time_field": "timestamp",
// "indices": [
// "order*"
// ],
// "feature_attributes": [
// {
// "feature_name": "total_order",
// "feature_enabled": true,
// "aggregation_query": {
// "total_order": {
// "sum": {
// "field": "value"
// }
// }
// }
// }
// ],
// "filter_query": {
// "bool": {
// "filter": [
// {
// "exists": {
// "field": "value",
// "boost": 1
// }
// }
// ],
// "adjust_pure_negative": true,
// "boost": 1
// }
// },
// "detection_interval": {
// "period": {
// "interval": 1,
// "unit": "Minutes"
// }
// },
// "window_delay": {
// "period": {
// "interval": 1,
// "unit": "Minutes"
// }
// }
//}
/*CreateDetector Creates an anomaly detector job.
It calls http request: POST _opendistro/_anomaly_detection/detectors
Sample Input:
{
"name": "test-detector",
"description": "Test detector",
"time_field": "timestamp",
"indices": [
"order*"
],
"feature_attributes": [
{
"feature_name": "total_order",
"feature_enabled": true,
"aggregation_query": {
"total_order": {
"sum": {
"field": "value"
}
}
}
}
],
"filter_query": {
"bool": {
"filter": [
{
"exists": {
"field": "value",
"boost": 1
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"detection_interval": {
"period": {
"interval": 1,
"unit": "Minutes"
}
},
"window_delay": {
"period": {
"interval": 1,
"unit": "Minutes"
}
}
}*/
func (g *gateway) CreateDetector(ctx context.Context, payload interface{}) ([]byte, error) {
createURL, err := g.buildCreateURL()
if err != nil {
Expand Down Expand Up @@ -190,16 +190,16 @@ func (g *gateway) buildSearchURL() (*url.URL, error) {
return endpoint, nil
}

// SearchDetector Returns all anomaly detectors for a search query.
// It calls http request: POST _opendistro/_anomaly_detection/detectors/_search
// sample input
// Sample Input:
//{
// "query": {
// "match": {
// "name": "test-detector"
// }
// }
/*SearchDetector Returns all anomaly detectors for a search query.
It calls http request: POST _opendistro/_anomaly_detection/detectors/_search
sample input
Sample Input:
{
"query": {
"match": {
"name": "test-detector"
}
}*/
func (g *gateway) SearchDetector(ctx context.Context, payload interface{}) ([]byte, error) {
searchURL, err := g.buildSearchURL()
if err != nil {
Expand Down

0 comments on commit 05c5426

Please sign in to comment.