private bool IsEKSProcess(string credentials) { var httpClientHandler = this.CreateHttpClientHandler(); var awsAuth = ResourceDetectorUtils.SendOutRequest(AWSAuthUrl, "GET", new KeyValuePair <string, string>("Authorization", credentials), httpClientHandler).Result; return(string.IsNullOrEmpty(awsAuth)); }
internal string GetEKSCredentials(string path) { StringBuilder stringBuilder = new StringBuilder(); using (var streamReader = ResourceDetectorUtils.GetStreamReader(path)) { while (!streamReader.EndOfStream) { stringBuilder.Append(streamReader.ReadLine().Trim()); } } return("Bearer " + stringBuilder.ToString()); }
private bool IsEKSProcess(string credentials) { string awsAuth = null; try { var httpClientHandler = this.CreateHttpClientHandler(); awsAuth = ResourceDetectorUtils.SendOutRequest(AWSAuthUrl, "GET", new KeyValuePair <string, string>("Authorization", credentials), httpClientHandler).Result; } catch (Exception ex) { AWSXRayEventSource.Log.ResourceAttributesExtractException($"{nameof(AWSEKSResourceDetector)} : Failed to get EKS information", ex); } return(!string.IsNullOrEmpty(awsAuth)); }
internal string GetEKSContainerId(string path) { string containerId = null; using (var streamReader = ResourceDetectorUtils.GetStreamReader(path)) { while (!streamReader.EndOfStream) { var trimmedLine = streamReader.ReadLine().Trim(); if (trimmedLine.Length > 64) { containerId = trimmedLine.Substring(trimmedLine.Length - 64); return(containerId); } } } return(containerId); }
internal string GetEKSContainerId(string path) { try { using (var streamReader = ResourceDetectorUtils.GetStreamReader(path)) { while (!streamReader.EndOfStream) { var trimmedLine = streamReader.ReadLine().Trim(); if (trimmedLine.Length > 64) { return(trimmedLine.Substring(trimmedLine.Length - 64)); } } } } catch (Exception ex) { AWSXRayEventSource.Log.ResourceAttributesExtractException($"{nameof(AWSEKSResourceDetector)} : Failed to get Container Id", ex); } return(null); }
internal string GetEKSCredentials(string path) { try { StringBuilder stringBuilder = new StringBuilder(); using (var streamReader = ResourceDetectorUtils.GetStreamReader(path)) { while (!streamReader.EndOfStream) { stringBuilder.Append(streamReader.ReadLine().Trim()); } } return("Bearer " + stringBuilder.ToString()); } catch (Exception ex) { AWSXRayEventSource.Log.ResourceAttributesExtractException($"{nameof(AWSEKSResourceDetector)} : Failed to load client token", ex); } return(null); }
private string GetAWSEC2HostName(string token) { return(ResourceDetectorUtils.SendOutRequest(AWSEC2HostNameUrl, "GET", new KeyValuePair <string, string>(AWSEC2MetadataTokenHeader, token)).Result); }
private string GetIdentityResponse(string token) { return(ResourceDetectorUtils.SendOutRequest(AWSEC2IdentityDocumentUrl, "GET", new KeyValuePair <string, string>(AWSEC2MetadataTokenHeader, token)).Result); }
private string GetAWSEC2Token() { return(ResourceDetectorUtils.SendOutRequest(AWSEC2MetadataTokenUrl, "PUT", new KeyValuePair <string, string>(AWSEC2MetadataTokenTTLHeader, "60")).Result); }
internal AWSEC2IdentityDocumentModel DeserializeResponse(string response) { return(ResourceDetectorUtils.DeserializeFromString <AWSEC2IdentityDocumentModel>(response)); }
internal AWSEBSMetadataModel GetEBSMetadata(string filePath) { return(ResourceDetectorUtils.DeserializeFromFile <AWSEBSMetadataModel>(filePath)); }
private string GetEKSClusterInfo(string credentials) { var httpClientHandler = this.CreateHttpClientHandler(); return(ResourceDetectorUtils.SendOutRequest(AWSClusterInfoUrl, "GET", new KeyValuePair <string, string>("Authorization", credentials), httpClientHandler).Result); }
internal AWSEKSClusterInformationModel DeserializeResponse(string response) { return(ResourceDetectorUtils.DeserializeFromString <AWSEKSClusterInformationModel>(response)); }