NextToken
public DescribeAutoScalingGroupsResponse DescribeAutoScalingGroups() { return DescribeAutoScalingGroups(new DescribeAutoScalingGroupsRequest()); }
/// <summary> /// Load auto scaling groups to view model with AWS data based on region selected and EC2 classic/vpc /// </summary> private void LoadAutoScalingGroups(AmazonAutoScalingClient asClient) { try { DescribeAutoScalingGroupsRequest asreq = new DescribeAutoScalingGroupsRequest(); DescribeAutoScalingGroupsResponse asresp = asClient.DescribeAutoScalingGroups(asreq); Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { vm.AutoScalingGroups.Clear(); })); foreach (AutoScalingGroup asg in asresp.DescribeAutoScalingGroupsResult.AutoScalingGroups) { if (vm.IsVpc) { if (!string.IsNullOrEmpty(asg.VPCZoneIdentifier) && vm.SelectedVpc != null) { foreach (Models.ConsoleSubnet subnet in vm.SelectedVpc.Subnets) { if (asg.VPCZoneIdentifier.Contains(subnet.Subnet.SubnetId)) { //vm.AutoScalingGroups.Add(asg); Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { vm.AutoScalingGroups.Add(new Models.ConsoleASG() { AutoScalingGroup = asg }); })); break; } } } } else { if (string.IsNullOrEmpty(asg.VPCZoneIdentifier)) { Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { vm.AutoScalingGroups.Add(new Models.ConsoleASG() { AutoScalingGroup = asg }); })); } } } Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => { for (int i = 0; i < vm.AutoScalingGroups.Count(); i++) { DescribeNotificationConfigurationsRequest nreq = new DescribeNotificationConfigurationsRequest(); nreq.WithAutoScalingGroupNames(vm.AutoScalingGroups[i].AutoScalingGroup.AutoScalingGroupName); DescribeNotificationConfigurationsResponse nresp = asClient.DescribeNotificationConfigurations(nreq); vm.AutoScalingGroups[i].NotificationConfigurations = new List<NotificationConfiguration>(); foreach (NotificationConfiguration nc in nresp.DescribeNotificationConfigurationsResult.NotificationConfigurations) { vm.AutoScalingGroups[i].NotificationConfigurations.Add(nc); } } })); } catch (Exception ex) { LogManager.LogEntry(ex.Message); LogManager.LogEntry(ex.StackTrace); throw new DataLoadingException("Error occurred loading auto scaling groups for region and environment type"); } }