//VdsSummary  stats for a VDS
VdsSummary  stats for a VDS
// VdsSummary stats for a VDS
func (c *Client) VdsSummary(name, moid string, js bool) (err error) {
	start := time.Now()
	ctx := context.Background()
	ctx, _ = context.WithTimeout(ctx, 30*time.Second)
	v, err := c.m.CreateContainerView(ctx, c.c.ServiceContent.RootFolder, []string{"VmwareDistributedVirtualSwitch"}, true)
	if err != nil {
		return fmt.Errorf("create container %v", err)
	}
	defer func() { _ = v.Destroy(ctx) }()
	id := types.ManagedObjectReference{
		Type:  "VmwareDistributedVirtualSwitch",
		Value: moid,
	}
	if moid == "" {
		id, err = c.findOne(name, "VmwareDistributedVirtualSwitch")
		if err != nil {
			return
		}
	}
	vds := mo.VmwareDistributedVirtualSwitch{}
	err = v.Properties(ctx, id, nil, &vds)
	if err != nil {
		return errCheck(name, id, fmt.Errorf("vds v.properties %v", err))
	}
	elapsed := time.Since(start)
	pr := newPrtgData("VdsSummary")
	_ = pr.add(tfl(vds.OverallStatus), ps.SensorChannel{Channel: "Overall Status", Unit: "Custom", CustomUnit: "Custom", ValueLookup: "prtg.standardlookups.Google.Gsa.Health"})
	_ = pr.add(tfl(vds.ConfigStatus), ps.SensorChannel{Channel: "Config Status", Unit: "Custom", CustomUnit: "Custom", ValueLookup: "prtg.standardlookups.Google.Gsa.Health"})
	for _, pg := range vds.Portgroup {
		vpg := mo.DistributedVirtualPortgroup{}
		err = v.Properties(ctx, pg, nil, &vpg)
		if err != nil {
			return fmt.Errorf("hs properties %v", err)
		}
		_ = pr.add(tfl(vpg.OverallStatus), ps.SensorChannel{Channel: vpg.Name, Unit: "Custom", CustomUnit: "Custom", ValueLookup: "prtg.standardlookups.Google.Gsa.Health"})
	}
	_ = c.Metrics(vds.Reference(), pr, vdsSummaryDefault, 20)
	err = pr.print(elapsed, js)
	return
}
func ( c * Client ) VdsSummary ( name , moid string , js bool ) ( err error ) { start := time . Now ( ) ctx := context . Background ( ) ctx , _ = context . WithTimeout ( ctx , 30 * time . Second ) v , err := c . m . CreateContainerView ( ctx , c . c . ServiceContent . RootFolder , [ ] string { " " } , true ) if err != nil { return fmt . Errorf ( " " , err ) } defer func ( ) { _ = v . Destroy ( ctx ) } ( ) id := types . ManagedObjectReference { Type : " " , Value : moid , } if moid == " " { id , err = c . findOne ( name , " " ) if err != nil { return } } vds := mo . VmwareDistributedVirtualSwitch { } err = v . Properties ( ctx , id , nil , & vds ) if err != nil { return errCheck ( name , id , fmt . Errorf ( " " , err ) ) } elapsed := time . Since ( start ) pr := newPrtgData ( " " ) _ = pr . add ( tfl ( vds . OverallStatus ) , ps . SensorChannel { Channel : " " , Unit : " " , CustomUnit : " " , ValueLookup : " " } ) _ = pr . add ( tfl ( vds . ConfigStatus ) , ps . SensorChannel { Channel : " " , Unit : " " , CustomUnit : " " , ValueLookup : " " } ) for _ , pg := range vds . Portgroup { vpg := mo . DistributedVirtualPortgroup { } err = v . Properties ( ctx , pg , nil , & vpg ) if err != nil { return fmt . Errorf ( " " , err ) } _ = pr . add ( tfl ( vpg . OverallStatus ) , ps . SensorChannel { Channel : vpg . Name , Unit : " " , CustomUnit : " " , ValueLookup : " " } ) } _ = c . Metrics ( vds . Reference ( ) , pr , vdsSummaryDefault , 20 ) err = pr . print ( elapsed , js ) return }
VdsSummary  stats for a VDS
VdsSummary stats for a VDS