Skip to content

Commit

Permalink
Ethanperry/config changes (#46)
Browse files Browse the repository at this point in the history
Modify payload configuration for anomaly detection tool.
Modify configuration for http grpc callout tool.
  • Loading branch information
ethanperry1 authored Dec 21, 2023
1 parent 6c16704 commit 5eaceed
Show file tree
Hide file tree
Showing 6 changed files with 1,128 additions and 29 deletions.
2 changes: 1 addition & 1 deletion lib/mage/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
var (
linter = bintool.Must(bintool.New(
"golangci-lint{{.BinExt}}",
"1.51.1",
"1.55.2",
"https://github.com/golangci/golangci-lint/releases/download/v{{.Version}}/golangci-lint-{{.Version}}-{{.GOOS}}-{{.GOARCH}}{{.ArchiveExt}}",
))
golines = bintool.Must(bintool.NewGo(
Expand Down
10 changes: 5 additions & 5 deletions samples/anomaly-detection/lib/payload/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ type Payload[T any] struct {
}

type CommonPayload struct {
AssetID string `json:"asset_id"`
AssetName string `json:"asset_name"`
MaintainenceStatus string `json:"maintainence_status"`
AssetID string `json:"assetId"`
AssetName string `json:"assetName"`
MaintainenceStatus string `json:"maintainenceStatus"`
Name string `json:"name"`
SerialNumber string `json:"serialNumber"`
Site string `json:"site"`
SourceTimestamp string `json:"source_timestamp"`
OperatingTime int `json:"operating_time"`
SourceTimestamp string `json:"sourceTimestamp"`
OperatingTime int `json:"operatingTime"`
MachineStatus int `json:"machineStatus"`
Humidity float64 `json:"humidity"`
Temperature float64 `json:"temperature"`
Expand Down
130 changes: 107 additions & 23 deletions samples/http-grpc-callout/manifest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,76 @@ data:
{
"hello": "world"
}
- path: /example
method: POST
- path: /ref_data
method: GET
status: 200
outputs: ["output1"]
response: |
{
"hello": "world1"
}
[
{
"assetID": "Sea_O1",
"serialNumber": "SN001",
"name": "Contoso",
"site": "Seattle",
"maintenanceStatus": "Done"
},
{
"assetID": "Red_O1",
"serialNumber": "SN002",
"name": "Contoso",
"site": "Redmond",
"maintenanceStatus": "Upcoming"
},
{
"assetID": "Tac_O1",
"serialNumber": "SN003",
"name": "Contoso",
"site": "Tacoma",
"maintenanceStatus": "Overdue"
},
{
"assetID": "Sea_S1",
"serialNumber": "SN004",
"name": "Contoso",
"site": "Seattle",
"maintenanceStatus": "Done"
},
{
"assetID": "Red_S1",
"serialNumber": "SN005",
"name": "Contoso",
"site": "Redmond",
"maintenanceStatus": "Done"
},
{
"assetID": "Sea_M1",
"serialNumber": "SN007",
"name": "Contoso",
"site": "Seattle",
"maintenanceStatus": "Done"
},
{
"assetID": "Red_M1",
"serialNumber": "SN008",
"name": "Contoso",
"site": "Redmond",
"maintenanceStatus": "Overdue"
},
{
"assetID": "Tac_M1",
"serialNumber": "SN009",
"name": "Contoso",
"site": "Tacoma",
"maintenanceStatus": "Done"
},
{
"assetID": "Tac_S1",
"serialNumber": "SN010",
"name": "Contoso",
"site": "Tacoma",
"maintenanceStatus": "Upcoming"
}
]
- path: /ts
method: GET
status: 200
Expand All @@ -36,28 +98,50 @@ data:
{
"timestamp": "2023-11-16T8:18:10-08:00"
}
- path: /anomaly
- path: /productionData
method: GET
status: 200
outputs: ["output1"]
response: |
{
"Payload": {
"assetID": "Tac_S1",
"asset_id": "Tac_S1",
"asset_name": "Tacoma_Slicer_Tacoma_Slicer__asset_0",
"humidity": 82.34915832237789,
"machine_status": 1,
"maintenanceStatus": "Upcoming",
"name": "Contoso",
"operating_time": 5999,
"serialNumber": "SN010",
"site": "Tacoma",
"source_timestamp": "2023-11-02T20:27:09.143Z",
"temperature": 93.56069711661576,
"vibration": 50.98858025013501
}
}
[
{
"Line":"Line1",
"ProductId":"Donette",
"Customer":"Contoso",
"Manufacturer": "Robotech"
},
{
"Line":"Line2",
"ProductId":"Twinkies",
"Customer":"Contoso",
"Manufacturer": "ZenithTech"
}
]
- path: /operatorData
method: GET
status: 200
outputs: ["output1"]
response: |
[
{
"Shift":1,
"Operator":"Bob",
"PerformanceTarget":45,
"PackagedProductTarget":12960
},
{
"Shift":2,
"Operator":"Anne",
"PerformanceTarget":60,
"PackagedProductTarget":17280
},
{
"Shift":3,
"Operator":"Cameron",
"PerformanceTarget":50,
"PackagedProductTarget":14400
}
]
grpc:
port: 3334
outputs: ["output1"]
Expand Down
Loading

0 comments on commit 5eaceed

Please sign in to comment.