Esempio n. 1
0
        /// <summary>
        /// Adapt the way ACM gets tenant on the cloud.
        /// Note the difference between getting and getting ANS. Since the processing logic on the server side is different,
        /// the default value returns differently.
        /// </summary>
        /// <returns>user tenant for acm</returns>
        public static string GetUserTenantForAcm()
        {
            string tmp = EnvUtil.GetEnvValue("tenant.id");

            if (tmp.IsNullOrWhiteSpace())
            {
                tmp = EnvUtil.GetEnvValue("acm.namespace");
            }

            return(tmp ?? string.Empty);
        }
Esempio n. 2
0
        /// <summary>
        /// Adapt the way ANS gets tenant on the cloud.
        /// </summary>
        /// <returns>user tenant for ans</returns>
        public static string GetUserTenantForAns()
        {
            string tmp = EnvUtil.GetEnvValue("tenant.id");

            if (tmp.IsNullOrWhiteSpace())
            {
                tmp = EnvUtil.GetEnvValue("ans.namespace");
            }

            return(tmp);
        }
Esempio n. 3
0
        public static string LocalIP()
        {
            if (localIp.IsNotNullOrWhiteSpace())
            {
                return(localIp);
            }

            var val = EnvUtil.GetEnvValue(LocalIpKey);

            var ip = val.IsNullOrWhiteSpace() ? FindFirstNonLoopbackAddress() : val;

            return(localIp = ip);
        }