use of com.netflix.frigga.autoscaling.AutoScalingGroupNameBuilder in project titus-control-plane by Netflix.
the class DefaultAppScaleManager method buildAutoScalingGroupV3.
@VisibleForTesting
static String buildAutoScalingGroupV3(JobDescriptor<?> jobDescriptor) {
JobGroupInfo jobGroupInfo = jobDescriptor.getJobGroupInfo();
String jobGroupSequence = jobGroupInfo.getSequence() != null ? jobGroupInfo.getSequence() : DEFAULT_JOB_GROUP_SEQ;
// Using frigga builder for auto scaling group name so that cloud watch alarm configuration
// is compatible with spinnaker generated auto scaling group name that is tagged with cloud watch metrics
AutoScalingGroupNameBuilder autoScalingGroupNameBuilder = new AutoScalingGroupNameBuilder();
String asgWithNoSequence = autoScalingGroupNameBuilder.withAppName(jobDescriptor.getApplicationName()).withStack(jobGroupInfo.getStack()).withDetail(jobGroupInfo.getDetail()).buildGroupName();
return String.format("%s-%s", asgWithNoSequence, jobGroupSequence);
}
use of com.netflix.frigga.autoscaling.AutoScalingGroupNameBuilder in project kork by spinnaker.
the class FriggaReflectiveNamer method applyMoniker.
@Override
public void applyMoniker(Object obj, Moniker moniker) {
AutoScalingGroupNameBuilder nameBuilder = new AutoScalingGroupNameBuilder();
nameBuilder.withAppName(moniker.getApp());
nameBuilder.withStack(moniker.getStack());
nameBuilder.withDetail(moniker.getDetail());
String name = nameBuilder.buildGroupName();
if (moniker.getSequence() != null) {
name = String.format("%s-v%03d", name, moniker.getSequence());
}
setName(obj, name);
}
Aggregations