GetData() 공개 정적인 메소드

Return the metadata at the path
public static GetData ( string path ) : string
path string Path at which to query the metadata; may be relative or absolute.
리턴 string
예제 #1
0
        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);
            }
        }