/// <summary> /// Creates a new Network from a Hashtable. /// </summary> /// <param name="table"></param> public Network(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 <network_operations>(Marshalling.ParseStringArray(table, "allowed_operations")); current_operations = Maps.convert_from_proxy_string_network_operations(Marshalling.ParseHashTable(table, "current_operations")); VIFs = Marshalling.ParseSetRef <VIF>(table, "VIFs"); PIFs = Marshalling.ParseSetRef <PIF>(table, "PIFs"); MTU = Marshalling.ParseLong(table, "MTU"); other_config = Maps.convert_from_proxy_string_string(Marshalling.ParseHashTable(table, "other_config")); bridge = Marshalling.ParseString(table, "bridge"); blobs = Maps.convert_from_proxy_string_XenRefBlob(Marshalling.ParseHashTable(table, "blobs")); tags = Marshalling.ParseStringArray(table, "tags"); default_locking_mode = (network_default_locking_mode)Helper.EnumParseDefault(typeof(network_default_locking_mode), Marshalling.ParseString(table, "default_locking_mode")); }
internal void UpdateFromProxy(Proxy_Network 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 <network_operations>(proxy.allowed_operations); current_operations = proxy.current_operations == null ? null : Maps.convert_from_proxy_string_network_operations(proxy.current_operations); VIFs = proxy.VIFs == null ? null : XenRef <VIF> .Create(proxy.VIFs); PIFs = proxy.PIFs == null ? null : XenRef <PIF> .Create(proxy.PIFs); 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); bridge = proxy.bridge == null ? null : (string)proxy.bridge; blobs = proxy.blobs == null ? null : Maps.convert_from_proxy_string_XenRefBlob(proxy.blobs); tags = proxy.tags == null ? new string[] {} : (string [])proxy.tags; default_locking_mode = proxy.default_locking_mode == null ? (network_default_locking_mode)0 : (network_default_locking_mode)Helper.EnumParseDefault(typeof(network_default_locking_mode), (string)proxy.default_locking_mode); }
/// <summary> /// Get the current_operations field of the given network. /// First published in XenServer 4.0. /// </summary> /// <param name="session">The session</param> /// <param name="_network">The opaque_ref of the given network</param> public static Dictionary <string, network_operations> get_current_operations(Session session, string _network) { return(Maps.convert_from_proxy_string_network_operations(session.proxy.network_get_current_operations(session.uuid, _network ?? "").parse())); }