List of usage examples for com.amazonaws.services.autoscaling.model DescribePoliciesRequest getAutoScalingGroupName
public String getAutoScalingGroupName()
The name of the Auto Scaling group.
From source file:com.netflix.edda.EddaAutoScalingClient.java
License:Apache License
public DescribePoliciesResult describePolicies(DescribePoliciesRequest request) { TypeReference<List<ScalingPolicy>> ref = new TypeReference<List<ScalingPolicy>>() { };//from ww w . j av a 2 s . c o m String url = config.url() + "/api/v2/aws/scalingPolicies;_expand"; try { List<ScalingPolicy> scalingPolicies = parse(ref, doGet(url)); String asg = request.getAutoScalingGroupName(); List<String> names = request.getPolicyNames(); if (shouldFilter(asg) || shouldFilter(names)) { List<ScalingPolicy> sps = new ArrayList<ScalingPolicy>(); for (ScalingPolicy sp : scalingPolicies) { if (matches(asg, sp.getAutoScalingGroupName()) && matches(names, sp.getPolicyName())) sps.add(sp); } scalingPolicies = sps; } return new DescribePoliciesResult().withScalingPolicies(scalingPolicies); } catch (IOException e) { throw new AmazonClientException("Faled to parse " + url, e); } }