public static string GetData(string path, int tries) { var items = GetItems(path, tries, true); if (items != null && items.Count > 0) return items[0]; return null; }
private string GetData(string key) { if (_data.ContainsKey(key)) { return(_data[key]); } // Since the keys are variable, cache a list of which ones are available // to prevent unnecessary trips to the service. if (null == _availableKeys) { _availableKeys = EC2Metadata.GetItems(_path); } if (_availableKeys.Contains(key)) { _data[key] = EC2Metadata.GetData(_path + key); return(_data[key]); } else { return(null); } }