public IrcElbStatusTask(string elbName, string name = null) : base(name ?? "ELB Status Task") { this.elbName = elbName; this.elb = new ELB(); this.ec2 = new EC2(); this.SleepTime = TimeSpan.FromSeconds(15); }
public InsightInstanceStatsMonitorTask(string endpoint, string name = null) : base(name ?? "Insight Instance Stats Monitor Task") { this.elb = new ELB(); this.ec2 = new EC2(); this.SleepTime = TimeSpan.FromSeconds(30); this.endpoint = endpoint ?? string.Empty; }
public InsightInstanceMonitor(string loadBalancerName, string name = null) : base(name ?? "Insight ELB Instance Monitor") { loadBalancerName.Required("loadBalancerName"); this.loadBalancerName = loadBalancerName; this.ec2 = new EC2(); }
public InsightInstanceUrlUploadTask(string loadBalancerName, string bucketName, string taskName = null) : base(taskName ?? "Insight Status Page Task") { loadBalancerName.Required("loadBalancerName"); bucketName.Required("bucketName"); this.loadBalancerName = loadBalancerName; this.bucketName = bucketName; this.elb = new ELB(); this.ec2 = new EC2(); this.s3 = new S3(); }
public override void Process(IrcCommand command) { base.Process(command); var message = string.Format( "I need the name of the load balancer, {0}.", command.Source.Name ); if (HandleNoParameters(message)) { SendMessage("Try: aws elb instances <load balancer name>. If you need a list of load balancers, that command is: aws elb list."); return; } var loadBalancerName = command.Parameters[0]; var elb = new ELB(); var ec2 = new EC2(); var instances = elb.Instances(loadBalancerName); var outOfLB = ElbState.GetStates(loadBalancerName).ToDictionary(s => s.State.InstanceId, s => s); var descriptions = ec2.InstanceDescriptions(instances.Select(i => i.InstanceId)); foreach (var description in descriptions) { var timeOutString = outOfLB.ContainsKey(description.InstanceId) ? "Out For: " + outOfLB[description.InstanceId].TimeSincePulled() : "InService"; SendNotice( string.Format( @"id: {0} / ip: {1} / state: {2} / type: {3} / ami: {4} / dns: {5} / Elb State: {6}", description.InstanceId, description.IpAddress, description.InstanceState.Name, description.InstanceType, description.ImageId, description.PublicDnsName, timeOutString ) ); } }
private void GetDescriptions() { var ec2 = new EC2(); this.descriptions = ec2.InstanceDescriptions(states.Select(i => i.InstanceId)); }
public AwsElbRepairCommand() { this.elb = new ELB(); this.ec2 = new EC2(); }