Skip to content

iter_describe_policies

iter_describe_policies(
    *,
    config_overrides: Optional[AutoScalingClientConfig] = None,
    auto_scaling_group_name: Optional[XmlStringMaxLen255] = None,
    policy_names: Optional[PolicyNames] = None,
    policy_types: Optional[PolicyTypes] = None,
    next_token: Optional[XmlString] = None,
    max_records: Optional[MaxRecords] = None,
) -> Iterator[ScalingPolicy]
Source code in docs_src/capo_auto_scaling/_services/auto_scaling.py
def iter_describe_policies(
    self,
    *,
    config_overrides: Optional[AutoScalingClientConfig] = None,
    auto_scaling_group_name: Optional[
        "capo_auto_scaling.types.xml_string_max_len255.XmlStringMaxLen255"
    ] = None,
    policy_names: Optional[
        "capo_auto_scaling.types.policy_names.PolicyNames"
    ] = None,
    policy_types: Optional[
        "capo_auto_scaling.types.policy_types.PolicyTypes"
    ] = None,
    next_token: Optional["capo_auto_scaling.types.xml_string.XmlString"] = None,
    max_records: Optional["capo_auto_scaling.types.max_records.MaxRecords"] = None,
) -> "Iterator[capo_auto_scaling.types.scaling_policy.ScalingPolicy]":
    _token = next_token
    while True:
        _response = self.describe_policies(
            config_overrides=config_overrides,
            auto_scaling_group_name=auto_scaling_group_name,
            policy_names=policy_names,
            policy_types=policy_types,
            next_token=_token,
            max_records=max_records,
        )
        _page = _resolve_path(_response, ("scaling_policies",))
        for _item in _page or []:
            yield _item
        _token = _resolve_path(_response, ("next_token",))
        if not _token:
            break