public static GetData ( string path ) : string | ||
path | string | Path at which to query the metadata; may be relative or absolute. |
리턴 | string |
public static string GetData(string path)
{
return GetData(path, DEFAULT_RETRIES);
}
EC2InstanceMetadata::GetData ( string path, int tries ) : string |
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 = EC2InstanceMetadata.GetItems(_path); } if (_availableKeys.Contains(key)) { _data[key] = EC2InstanceMetadata.GetData(_path + key); return(_data[key]); } else { return(null); } }