describePolicies method
Describes the policies for the specified Auto Scaling group.
May throw InvalidNextToken. May throw ResourceContentionFault. May throw ServiceLinkedRoleFailure.
Parameter autoScalingGroupName
:
The name of the Auto Scaling group.
Parameter maxRecords
:
The maximum number of items to be returned with each call. The default
value is 50
and the maximum value is 100
.
Parameter nextToken
:
The token for the next set of items to return. (You received this token
from a previous call.)
Parameter policyNames
:
The names of one or more policies. If you omit this parameter, all
policies are described. If a group name is provided, the results are
limited to that group. This list is limited to 50 items. If you specify an
unknown policy name, it is ignored with no error.
Parameter policyTypes
:
One or more policy types. The valid values are SimpleScaling
,
StepScaling
, and TargetTrackingScaling
.
Implementation
Future<PoliciesType> describePolicies({
String? autoScalingGroupName,
int? maxRecords,
String? nextToken,
List<String>? policyNames,
List<String>? policyTypes,
}) async {
_s.validateStringLength(
'autoScalingGroupName',
autoScalingGroupName,
1,
255,
);
final $request = <String, dynamic>{};
autoScalingGroupName?.also((arg) => $request['AutoScalingGroupName'] = arg);
maxRecords?.also((arg) => $request['MaxRecords'] = arg);
nextToken?.also((arg) => $request['NextToken'] = arg);
policyNames?.also((arg) => $request['PolicyNames'] = arg);
policyTypes?.also((arg) => $request['PolicyTypes'] = arg);
final $result = await _protocol.send(
$request,
action: 'DescribePolicies',
version: '2011-01-01',
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
shape: shapes['DescribePoliciesType'],
shapes: shapes,
resultWrapper: 'DescribePoliciesResult',
);
return PoliciesType.fromXml($result);
}