Example usage for com.amazonaws.services.applicationautoscaling.model ScalableTarget getResourceId

List of usage examples for com.amazonaws.services.applicationautoscaling.model ScalableTarget getResourceId

Introduction

In this page you can find the example usage for com.amazonaws.services.applicationautoscaling.model ScalableTarget getResourceId.

Prototype


public String getResourceId() 

Source Link

Document

The identifier of the resource associated with the scalable target.

Usage

From source file:com.netflix.spinnaker.clouddriver.ecs.provider.agent.ScalableTargetsCachingAgent.java

License:Apache License

Map<String, Collection<CacheData>> generateFreshData(Set<ScalableTarget> scalableTargets) {
    Collection<CacheData> dataPoints = new HashSet<>();
    Map<String, Collection<CacheData>> newDataMap = new HashMap<>();

    for (ScalableTarget scalableTarget : scalableTargets) {
        String key = Keys.getScalableTargetKey(accountName, region, scalableTarget.getResourceId());
        Map<String, Object> attributes = convertMetricAlarmToAttributes(scalableTarget, objectMapper);

        CacheData data = new DefaultCacheData(key, attributes, Collections.emptyMap());
        dataPoints.add(data);//from  ww w .j  a  v a2  s .  co  m
    }

    log.info("Caching " + dataPoints.size() + " scalable targets in " + getAgentType());
    newDataMap.put(SCALABLE_TARGETS.toString(), dataPoints);
    return newDataMap;
}