fix(aws/health): events mode - limit issue with paws (#2732)
This commit is contained in:
parent
0df621c812
commit
cf2b2c162e
|
@ -619,25 +619,24 @@ sub health_describe_affected_entities {
|
||||||
eval {
|
eval {
|
||||||
my $lwp_caller = new Paws::Net::LWPCaller();
|
my $lwp_caller = new Paws::Net::LWPCaller();
|
||||||
my $health = Paws->service('Health', caller => $lwp_caller, region => $self->{option_results}->{region});
|
my $health = Paws->service('Health', caller => $lwp_caller, region => $self->{option_results}->{region});
|
||||||
my $health_options = { Filter => {} };
|
|
||||||
if (defined($options{filter_event_arns})) {
|
|
||||||
$health_options->{Filter}->{EventArns} = $options{filter_event_arns};
|
|
||||||
}
|
|
||||||
|
|
||||||
while ((my $entities = $health->DescribeAffectedEntities(%$health_options))) {
|
while (my @events = splice(@{$options{filter_event_arns}}, 0, 10)) {
|
||||||
foreach (@{$entities->{Entities}}) {
|
my $health_options = { Filter => { EventArns => \@events } };
|
||||||
push @$entities_results, {
|
while ((my $entities = $health->DescribeAffectedEntities(%$health_options))) {
|
||||||
entityArn => $_->{EntityArn},
|
foreach (@{$entities->{Entities}}) {
|
||||||
eventArn => $_->{EventArn},
|
push @$entities_results, {
|
||||||
entityValue => $_->{EntityValue},
|
entityArn => $_->{EntityArn},
|
||||||
awsAccountId => $_->{AwsAccountId},
|
eventArn => $_->{EventArn},
|
||||||
lastUpdatedTime => $_->{LastUpdatedTime},
|
entityValue => $_->{EntityValue},
|
||||||
statusCode => $_->{StatusCode}
|
awsAccountId => $_->{AwsAccountId},
|
||||||
};
|
lastUpdatedTime => $_->{LastUpdatedTime},
|
||||||
|
statusCode => $_->{StatusCode}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
last if (!defined($entities->{NextToken}));
|
||||||
|
$health_options->{NextToken} = $entities->{NextToken};
|
||||||
}
|
}
|
||||||
|
|
||||||
last if (!defined($entities->{NextToken}));
|
|
||||||
$health_options->{NextToken} = $entities->{NextToken};
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if ($@) {
|
if ($@) {
|
||||||
|
|
Loading…
Reference in New Issue