new settings because of new-install influxdb
This commit is contained in:
parent
3b2b39a3f0
commit
9296866fe9
|
|
@ -267,7 +267,7 @@ func CalcDaysUntil(mydate string) int {
|
|||
func getLastMetrics(deveui string) OneMetric {
|
||||
var res OneMetric
|
||||
|
||||
url := "http://localhost:9999/api/v2/query?org=beieliorg"
|
||||
url := "http://localhost:8086/api/v2/query?org=beieliorg"
|
||||
data := []byte(fmt.Sprintf(`from(bucket:"beielibucket")
|
||||
|> range(start:-5d)
|
||||
|> filter(fn: (r) => r._measurement == "measurement" and r.deveui == "%s")
|
||||
|
|
@ -280,7 +280,7 @@ func getLastMetrics(deveui string) OneMetric {
|
|||
}
|
||||
|
||||
// Set headers
|
||||
req.Header.Set("Authorization", "Token OzSltiHLmm3WCaFPI0DrK0VFAVCiqcORNrGsgHO43jb0qodyVGAumJQ3HRtkaze53BVR3AmHqfkmrwrjq-xTyA==")
|
||||
req.Header.Set("Authorization", "Token nKYCoz3TA-LItYXG988DjdiStMhrfKmFXQqzxrjzJJ7Ek_iUttzFSE9lfe3s6q99EMdcrjuGlDAjp4Y0VnNRXw==")
|
||||
req.Header.Set("accept", "application/csv")
|
||||
req.Header.Set("content-type", "application/vnd.flux")
|
||||
|
||||
|
|
|
|||
12
metrics.go
12
metrics.go
|
|
@ -116,7 +116,7 @@ func metricsHandler(response http.ResponseWriter, request *http.Request) {
|
|||
mystart = start[0]
|
||||
}
|
||||
|
||||
url := "http://localhost:9999/api/v2/query?org=beieliorg"
|
||||
url := "http://localhost:8086/api/v2/query?org=beieliorg"
|
||||
data := []byte(fmt.Sprintf(`from(bucket:"beielibucket") |> range(start: %s, stop: %s) |> filter(fn: (r) => r._measurement == "measurement") |> filter(fn: (r) => r._field == "%s") |> filter(fn: (r) => r.deveui == "%s")`, mystart, mystop, property[0], mydeveui))
|
||||
|
||||
req, err := http.NewRequest("POST", url, bytes.NewBuffer(data))
|
||||
|
|
@ -125,7 +125,7 @@ func metricsHandler(response http.ResponseWriter, request *http.Request) {
|
|||
}
|
||||
|
||||
// Set headers
|
||||
req.Header.Set("Authorization", "Token OzSltiHLmm3WCaFPI0DrK0VFAVCiqcORNrGsgHO43jb0qodyVGAumJQ3HRtkaze53BVR3AmHqfkmrwrjq-xTyA==")
|
||||
req.Header.Set("Authorization", "Token nKYCoz3TA-LItYXG988DjdiStMhrfKmFXQqzxrjzJJ7Ek_iUttzFSE9lfe3s6q99EMdcrjuGlDAjp4Y0VnNRXw==")
|
||||
req.Header.Set("accept", "application/csv")
|
||||
req.Header.Set("content-type", "application/vnd.flux")
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ func lastmetricsHandler(response http.ResponseWriter, request *http.Request) {
|
|||
|
||||
log.Println("Url Param 'deveui' is: " + string(mydeveui))
|
||||
|
||||
url := "http://localhost:9999/api/v2/query?org=beieliorg"
|
||||
url := "http://localhost:8086/api/v2/query?org=beieliorg"
|
||||
//data := []byte(fmt.Sprintf(`from(bucket:"beielibucket") |> range(start:-365d) |> filter(fn: (r) => r.deveui == "%s") |> filter(fn: (r) => r._field == "v" or r._field == "t") |> last() |> yield(name: "last")`,mydeveui))
|
||||
data := []byte(fmt.Sprintf(`from(bucket:"beielibucket")
|
||||
|> range(start:-365d)
|
||||
|
|
@ -211,7 +211,7 @@ func lastmetricsHandler(response http.ResponseWriter, request *http.Request) {
|
|||
}
|
||||
|
||||
// Set headers
|
||||
req.Header.Set("Authorization", "Token OzSltiHLmm3WCaFPI0DrK0VFAVCiqcORNrGsgHO43jb0qodyVGAumJQ3HRtkaze53BVR3AmHqfkmrwrjq-xTyA==")
|
||||
req.Header.Set("Authorization", "Token nKYCoz3TA-LItYXG988DjdiStMhrfKmFXQqzxrjzJJ7Ek_iUttzFSE9lfe3s6q99EMdcrjuGlDAjp4Y0VnNRXw==")
|
||||
req.Header.Set("accept", "application/csv")
|
||||
req.Header.Set("content-type", "application/vnd.flux")
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ func CalcDaysUntil(mydate string) int {
|
|||
func getLastMetrics(deveui string) OneMetric {
|
||||
var res OneMetric
|
||||
|
||||
url := "http://localhost:9999/api/v2/query?org=beieliorg"
|
||||
url := "http://localhost:8086/api/v2/query?org=beieliorg"
|
||||
data := []byte(fmt.Sprintf(`from(bucket:"beielibucket")
|
||||
|> range(start:-365d)
|
||||
|> filter(fn: (r) => r._measurement == "measurement" and r.deveui == "%s")
|
||||
|
|
@ -308,7 +308,7 @@ func getLastMetrics(deveui string) OneMetric {
|
|||
}
|
||||
|
||||
// Set headers
|
||||
req.Header.Set("Authorization", "Token OzSltiHLmm3WCaFPI0DrK0VFAVCiqcORNrGsgHO43jb0qodyVGAumJQ3HRtkaze53BVR3AmHqfkmrwrjq-xTyA==")
|
||||
req.Header.Set("Authorization", "Token nKYCoz3TA-LItYXG988DjdiStMhrfKmFXQqzxrjzJJ7Ek_iUttzFSE9lfe3s6q99EMdcrjuGlDAjp4Y0VnNRXw==")
|
||||
req.Header.Set("accept", "application/csv")
|
||||
req.Header.Set("content-type", "application/vnd.flux")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue