mirror of
https://github.com/Oxalide/vsphere-influxdb-go.git
synced 2023-10-10 13:36:51 +02:00
syntax correction
This commit is contained in:
parent
3442d30e1a
commit
7f61a40f1c
@ -21,8 +21,6 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/davecgh/go-spew/spew"
|
|
||||||
"golang.org/x/net/context"
|
|
||||||
"log"
|
"log"
|
||||||
"math"
|
"math"
|
||||||
"net/url"
|
"net/url"
|
||||||
@ -32,6 +30,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/davecgh/go-spew/spew"
|
||||||
|
"golang.org/x/net/context"
|
||||||
|
|
||||||
influxclient "github.com/influxdata/influxdb/client/v2"
|
influxclient "github.com/influxdata/influxdb/client/v2"
|
||||||
"github.com/vmware/govmomi"
|
"github.com/vmware/govmomi"
|
||||||
"github.com/vmware/govmomi/property"
|
"github.com/vmware/govmomi/property"
|
||||||
@ -259,15 +260,13 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.
|
|||||||
} else if mor.Type == "HostSystem" {
|
} else if mor.Type == "HostSystem" {
|
||||||
host_refs = append(host_refs, mor)
|
host_refs = append(host_refs, mor)
|
||||||
new_mors = append(new_mors, mor)
|
new_mors = append(new_mors, mor)
|
||||||
}
|
} else if mor.Type == "ResourcePool" {
|
||||||
else if mor.Type == "ResourcePool" {
|
|
||||||
resp_refs = append(resp_refs, mor)
|
resp_refs = append(resp_refs, mor)
|
||||||
new_mors = append(new_mors, mor)
|
new_mors = append(new_mors, mor)
|
||||||
}
|
} else if mor.Type == "ClusterComputeResource" {
|
||||||
else if mor.Type == "ClusterComputeResource" {
|
|
||||||
cluster_refs = append(cluster_refs, mor)
|
cluster_refs = append(cluster_refs, mor)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// Copy the mors without the clusters
|
// Copy the mors without the clusters
|
||||||
mors = new_mors
|
mors = new_mors
|
||||||
@ -504,7 +503,7 @@ func (vcenter *VCenter) Query(config Configuration, InfluxDBClient influxclient.
|
|||||||
if special_fields[measurementName] == nil {
|
if special_fields[measurementName] == nil {
|
||||||
special_fields[measurementName] = make(map[string]map[string]map[string]interface{})
|
special_fields[measurementName] = make(map[string]map[string]map[string]interface{})
|
||||||
special_tags[measurementName] = make(map[string]map[string]map[string]string)
|
special_tags[measurementName] = make(map[string]map[string]map[string]string)
|
||||||
}
|
}
|
||||||
|
|
||||||
if special_fields[measurementName][tags["name"]] == nil {
|
if special_fields[measurementName][tags["name"]] == nil {
|
||||||
special_fields[measurementName][tags["name"]] = make(map[string]map[string]interface{})
|
special_fields[measurementName][tags["name"]] = make(map[string]map[string]interface{})
|
||||||
@ -664,5 +663,3 @@ func main() {
|
|||||||
queryVCenter(*vcenter, config, InfluxDBClient)
|
queryVCenter(*vcenter, config, InfluxDBClient)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user