/// <summary> /// Creates a new SR from a Hashtable. /// </summary> /// <param name="table"></param> public SR(Hashtable table) { uuid = Marshalling.ParseString(table, "uuid"); name_label = Marshalling.ParseString(table, "name_label"); name_description = Marshalling.ParseString(table, "name_description"); allowed_operations = Helper.StringArrayToEnumList <storage_operations>(Marshalling.ParseStringArray(table, "allowed_operations")); current_operations = Maps.convert_from_proxy_string_storage_operations(Marshalling.ParseHashTable(table, "current_operations")); VDIs = Marshalling.ParseSetRef <VDI>(table, "VDIs"); PBDs = Marshalling.ParseSetRef <PBD>(table, "PBDs"); virtual_allocation = Marshalling.ParseLong(table, "virtual_allocation"); physical_utilisation = Marshalling.ParseLong(table, "physical_utilisation"); physical_size = Marshalling.ParseLong(table, "physical_size"); type = Marshalling.ParseString(table, "type"); content_type = Marshalling.ParseString(table, "content_type"); shared = Marshalling.ParseBool(table, "shared"); other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config")); tags = Marshalling.ParseStringArray(table, "tags"); sm_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "sm_config")); blobs = Maps.convert_from_proxy_string_XenRefBlob(Marshalling.ParseHashTable(table, "blobs")); local_cache_enabled = Marshalling.ParseBool(table, "local_cache_enabled"); introduced_by = Marshalling.ParseRef <DR_task>(table, "introduced_by"); }
internal void UpdateFromProxy(Proxy_SR proxy) { uuid = proxy.uuid == null ? null : (string)proxy.uuid; name_label = proxy.name_label == null ? null : (string)proxy.name_label; name_description = proxy.name_description == null ? null : (string)proxy.name_description; allowed_operations = proxy.allowed_operations == null ? null : Helper.StringArrayToEnumList <storage_operations>(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_storage_operations(proxy.current_operations); VDIs = proxy.VDIs == null ? null : XenRef <VDI> .Create(proxy.VDIs); PBDs = proxy.PBDs == null ? null : XenRef <PBD> .Create(proxy.PBDs); virtual_allocation = proxy.virtual_allocation == null ? 0 : long.Parse((string)proxy.virtual_allocation); physical_utilisation = proxy.physical_utilisation == null ? 0 : long.Parse((string)proxy.physical_utilisation); physical_size = proxy.physical_size == null ? 0 : long.Parse((string)proxy.physical_size); type = proxy.type == null ? null : (string)proxy.type; content_type = proxy.content_type == null ? null : (string)proxy.content_type; shared = (bool)proxy.shared; other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); tags = proxy.tags == null ? new string[] {} : (string [])proxy.tags; sm_config = proxy.sm_config == null ? null : Maps.convert_from_proxy_string_string(proxy.sm_config); blobs = proxy.blobs == null ? null : Maps.convert_from_proxy_string_XenRefBlob(proxy.blobs); local_cache_enabled = (bool)proxy.local_cache_enabled; introduced_by = proxy.introduced_by == null ? null : XenRef <DR_task> .Create(proxy.introduced_by); }
public static Dictionary <string, storage_operations> get_current_operations(Session session, string _sr) { return(Maps.convert_from_proxy_string_storage_operations(session.proxy.sr_get_current_operations(session.uuid, (_sr != null) ? _sr : "").parse())); }