/// <summary> /// Creates a new VBD from a Hashtable. /// </summary> /// <param name="table"></param> public VBD(Hashtable table) { uuid = Marshalling.ParseString(table, "uuid"); allowed_operations = Helper.StringArrayToEnumList <vbd_operations>(Marshalling.ParseStringArray(table, "allowed_operations")); current_operations = Maps.convert_from_proxy_string_vbd_operations(Marshalling.ParseHashTable(table, "current_operations")); VM = Marshalling.ParseRef <VM>(table, "VM"); VDI = Marshalling.ParseRef <VDI>(table, "VDI"); device = Marshalling.ParseString(table, "device"); userdevice = Marshalling.ParseString(table, "userdevice"); bootable = Marshalling.ParseBool(table, "bootable"); mode = (vbd_mode)Helper.EnumParseDefault(typeof(vbd_mode), Marshalling.ParseString(table, "mode")); type = (vbd_type)Helper.EnumParseDefault(typeof(vbd_type), Marshalling.ParseString(table, "type")); unpluggable = Marshalling.ParseBool(table, "unpluggable"); storage_lock = Marshalling.ParseBool(table, "storage_lock"); empty = Marshalling.ParseBool(table, "empty"); 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 <VBD_metrics>(table, "metrics"); }
internal void UpdateFromProxy(Proxy_VBD proxy) { uuid = proxy.uuid == null ? null : (string)proxy.uuid; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList <vbd_operations>(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_vbd_operations(proxy.current_operations); VM = proxy.VM == null ? null : XenRef <VM> .Create(proxy.VM); VDI = proxy.VDI == null ? null : XenRef <VDI> .Create(proxy.VDI); device = proxy.device == null ? null : (string)proxy.device; userdevice = proxy.userdevice == null ? null : (string)proxy.userdevice; bootable = (bool)proxy.bootable; mode = proxy.mode == null ? (vbd_mode)0 : (vbd_mode)Helper.EnumParseDefault(typeof(vbd_mode), (string)proxy.mode); type = proxy.type == null ? (vbd_type)0 : (vbd_type)Helper.EnumParseDefault(typeof(vbd_type), (string)proxy.type); unpluggable = (bool)proxy.unpluggable; storage_lock = (bool)proxy.storage_lock; empty = (bool)proxy.empty; 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 <VBD_metrics> .Create(proxy.metrics); }
public static Dictionary <string, vbd_operations> get_current_operations(Session session, string _vbd) { return(Maps.convert_from_proxy_string_vbd_operations(session.proxy.vbd_get_current_operations(session.uuid, (_vbd != null) ? _vbd : "").parse())); }