// ListVnics will return a list of all VNICs attached to this VM
ListVnics will return a list of all VNICs attached to this VM
// ListVnics will return a list of all VNICs attached to this VM
func (v *VirtualMachine) ListVnics() ([]Vnic, error) {
	vmID, err := v.ID()
	if err != nil {
		return nil, errors.Wrap(err, "VM ID")
	}
	nics, err := utils.GetElementsAssociatedClass(v.mgr.con, SyntheticEthernetPortSettingDataClass, vmID, nil)
	if err != nil {
		return nil, errors.Wrap(err, "utils.GetElementsAssociatedClass")
	}
	ret := make([]Vnic, len(nics))
	for idx, val := range nics {
		ret[idx] = Vnic{
			mgr:    v.mgr,
			path:   val,
			vmPath: v.path,
		}
	}
	return ret, nil
}
func ( v * VirtualMachine ) ListVnics ( ) ( [ ] Vnic , error ) { vmID , err := v . ID ( ) if err != nil { return nil , errors . Wrap ( err , " " ) } nics , err := utils . GetElementsAssociatedClass ( v . mgr . con , SyntheticEthernetPortSettingDataClass , vmID , nil ) if err != nil { return nil , errors . Wrap ( err , " " ) } ret := make ( [ ] Vnic , len ( nics ) ) for idx , val := range nics { ret [ idx ] = Vnic { mgr : v . mgr , path : val , vmPath : v . path , } } return ret , nil }
ListVnics will return a list of all VNICs attached to this VM
ListVnics will return a list of all VNICs attached to this VM