internal void UpdateFromProxy(Proxy_VIF proxy) { uuid = proxy.uuid == null ? null : (string)proxy.uuid; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList <vif_operations>(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_vif_operations(proxy.current_operations); device = proxy.device == null ? null : (string)proxy.device; network = proxy.network == null ? null : XenRef <Network> .Create(proxy.network); VM = proxy.VM == null ? null : XenRef <VM> .Create(proxy.VM); MAC = proxy.MAC == null ? null : (string)proxy.MAC; MTU = proxy.MTU == null ? 0 : long.Parse((string)proxy.MTU); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); currently_attached = (bool)proxy.currently_attached; status_code = proxy.status_code == null ? 0 : long.Parse((string)proxy.status_code); status_detail = proxy.status_detail == null ? null : (string)proxy.status_detail; runtime_properties = proxy.runtime_properties == null ? null : Maps.convert_from_proxy_string_string(proxy.runtime_properties); qos_algorithm_type = proxy.qos_algorithm_type == null ? null : (string)proxy.qos_algorithm_type; qos_algorithm_params = proxy.qos_algorithm_params == null ? null : Maps.convert_from_proxy_string_string(proxy.qos_algorithm_params); qos_supported_algorithms = proxy.qos_supported_algorithms == null ? new string[] {} : (string [])proxy.qos_supported_algorithms; metrics = proxy.metrics == null ? null : XenRef <VIF_metrics> .Create(proxy.metrics); MAC_autogenerated = (bool)proxy.MAC_autogenerated; locking_mode = proxy.locking_mode == null ? (vif_locking_mode)0 : (vif_locking_mode)Helper.EnumParseDefault(typeof(vif_locking_mode), (string)proxy.locking_mode); ipv4_allowed = proxy.ipv4_allowed == null ? new string[] {} : (string [])proxy.ipv4_allowed; ipv6_allowed = proxy.ipv6_allowed == null ? new string[] {} : (string [])proxy.ipv6_allowed; }
/// <summary> /// Creates a new VIF from a Hashtable. /// </summary> /// <param name="table"></param> public VIF(Hashtable table) { uuid = Marshalling.ParseString(table, "uuid"); allowed_operations = Helper.StringArrayToEnumList <vif_operations>(Marshalling.ParseStringArray(table, "allowed_operations")); current_operations = Maps.convert_from_proxy_string_vif_operations(Marshalling.ParseHashTable(table, "current_operations")); device = Marshalling.ParseString(table, "device"); network = Marshalling.ParseRef <Network>(table, "network"); VM = Marshalling.ParseRef <VM>(table, "VM"); MAC = Marshalling.ParseString(table, "MAC"); MTU = Marshalling.ParseLong(table, "MTU"); other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config")); currently_attached = Marshalling.ParseBool(table, "currently_attached"); status_code = Marshalling.ParseLong(table, "status_code"); status_detail = Marshalling.ParseString(table, "status_detail"); runtime_properties = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "runtime_properties")); qos_algorithm_type = Marshalling.ParseString(table, "qos_algorithm_type"); qos_algorithm_params = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "qos_algorithm_params")); qos_supported_algorithms = Marshalling.ParseStringArray(table, "qos_supported_algorithms"); metrics = Marshalling.ParseRef <VIF_metrics>(table, "metrics"); MAC_autogenerated = Marshalling.ParseBool(table, "MAC_autogenerated"); locking_mode = (vif_locking_mode)Helper.EnumParseDefault(typeof(vif_locking_mode), Marshalling.ParseString(table, "locking_mode")); ipv4_allowed = Marshalling.ParseStringArray(table, "ipv4_allowed"); ipv6_allowed = Marshalling.ParseStringArray(table, "ipv6_allowed"); }
public static Dictionary <string, vif_operations> get_current_operations(Session session, string _vif) { return(Maps.convert_from_proxy_string_vif_operations(session.proxy.vif_get_current_operations(session.uuid, (_vif != null) ? _vif : "").parse())); }