> +      for ( GroupState state : groupApi.listGroupStates() ) {
> +         Group g = groupApi.get(state.getId());
> +         for ( ScalingPolicyResponse policy : g.getScalingPolicies() ) {
> +            if (policy.getName().equals(NAME)) return g.getId();
> +         }
> +      }
> +
> +      throw new RuntimeException("Group not found");
> +   }
> +
> +   public static String getPolicyId(PolicyApi policyApi) {
> +      for ( ScalingPolicyResponse policy : policyApi.list() ) {
> +         if (policy.getName().equals(NAME)) return policy.getId();
> +      }
> +
> +      throw new RuntimeException("Policy not found");

[minor] IllegalArgException?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-examples/pull/24/files#r7656427

Reply via email to