//--------------------------------------------------------------------------------------------------------------------- /// <summary>Queries the cloud provider to get a list of the virtual networks (in OCCI: <i>networks</i>) defined on it.</summary> public override VirtualNetwork[] FindVirtualNetworks(bool detailed) { XmlNodeList nodes = GetResourceNodeList("/network", "NETWORK_COLLECTION/NETWORK"); if (nodes == null) { return(null); } List <OcciNetwork> list = new List <OcciNetwork>(); foreach (XmlNode node in nodes) { XmlElement elem = node as XmlElement; if (elem == null) { continue; } OcciNetwork item = null; if (detailed) { if (elem.HasAttribute("href")) { elem = GetResourceNode(String.Format("/network/{0}", Regex.Replace(node.Attributes["href"].Value, "^.*/", String.Empty))); item = OcciNetwork.FromItemXml(context, this, elem); } } else { item = OcciNetwork.FromListXml(context, this, elem); } list.Add(item); } return(list.ToArray()); }
//--------------------------------------------------------------------------------------------------------------------- /// <summary>Queries the cloud provider to get a list of the virtual networks (in OCCI: <i>networks</i>) defined on it.</summary> public override VirtualNetwork GetNetwork(string remoteId) { XmlElement elem = GetResourceNode(String.Format("/network/{0}", remoteId)); if (elem == null) { return(null); } OcciNetwork result = null; result = OcciNetwork.FromItemXml(context, this, elem); return(result); }