예제 #1
0
        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));
        }
        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));
        }
예제 #3
0
 private string GetAWSEC2HostName(string token)
 {
     return(ResourceDetectorUtils.SendOutRequest(AWSEC2HostNameUrl, "GET", new KeyValuePair <string, string>(AWSEC2MetadataTokenHeader, token)).Result);
 }
예제 #4
0
 private string GetIdentityResponse(string token)
 {
     return(ResourceDetectorUtils.SendOutRequest(AWSEC2IdentityDocumentUrl, "GET", new KeyValuePair <string, string>(AWSEC2MetadataTokenHeader, token)).Result);
 }
예제 #5
0
 private string GetAWSEC2Token()
 {
     return(ResourceDetectorUtils.SendOutRequest(AWSEC2MetadataTokenUrl, "PUT", new KeyValuePair <string, string>(AWSEC2MetadataTokenTTLHeader, "60")).Result);
 }
예제 #6
0
        private string GetEKSClusterInfo(string credentials)
        {
            var httpClientHandler = this.CreateHttpClientHandler();

            return(ResourceDetectorUtils.SendOutRequest(AWSClusterInfoUrl, "GET", new KeyValuePair <string, string>("Authorization", credentials), httpClientHandler).Result);
        }