Пример #1
0
 public API(AgentConfig config, string accessToken)
 {
     logger           = new Logger();
     this.accessToken = accessToken;
     client           = new RestClient(config.BaseURL);
     client.Proxy     = config;
 }
Пример #2
0
        public static AgentInfo GetAgentInfo()
        {
            string identifier;

            if (Debugger.IsAttached)
            {
                identifier = "i-701c521a";
            }
            else
            {
                switch (AgentConfig.GetCloudName())
                {
                case "datacenter":
                    identifier = GetMacAddress();
                    break;

                case "azure":
                    identifier = GetVmUUID();
                    break;

                default:
                    identifier = new EC2InstanceMetadata().InstanceId;
                    break;
                }
            }
            return(new AgentInfo {
                Identifier = identifier, CloudName = AgentConfig.GetCloudName()
            });
        }
Пример #3
0
        public static AgentInfo GetAgentInfo()
        {
            string instanceId = null;

            if (System.Diagnostics.Debugger.IsAttached)
            {
                instanceId = "i-701c521a";
            }
            else
            {
                instanceId = new EC2InstanceMetadata().InstanceId;
            }
            return(new AgentInfo {
                Instance = instanceId, CloudName = AgentConfig.GetCloudName()
            });
        }