/// <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")); assigned_ips = Maps.convert_from_proxy_XenRefVIF_string(Marshalling.ParseHashTable(table, "assigned_ips")); }
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); assigned_ips = proxy.assigned_ips == null ? null : Maps.convert_from_proxy_XenRefVIF_string(proxy.assigned_ips); }
/// <summary> /// Get the assigned_ips field of the given network. /// First published in XenServer 6.5. /// </summary> /// <param name="session">The session</param> /// <param name="_network">The opaque_ref of the given network</param> public static Dictionary <XenRef <VIF>, string> get_assigned_ips(Session session, string _network) { return(Maps.convert_from_proxy_XenRefVIF_string(session.proxy.network_get_assigned_ips(session.uuid, _network ?? "").parse())); }