Search in sources :

Example 1 with AutoScalingGroupNameBuilder

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);
}
Also used : JobGroupInfo(com.netflix.titus.api.jobmanager.model.job.JobGroupInfo) AutoScalingGroupNameBuilder(com.netflix.frigga.autoscaling.AutoScalingGroupNameBuilder) VisibleForTesting(com.google.common.annotations.VisibleForTesting)

Example 2 with AutoScalingGroupNameBuilder

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);
}
Also used : AutoScalingGroupNameBuilder(com.netflix.frigga.autoscaling.AutoScalingGroupNameBuilder)

Aggregations

AutoScalingGroupNameBuilder (com.netflix.frigga.autoscaling.AutoScalingGroupNameBuilder)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 JobGroupInfo (com.netflix.titus.api.jobmanager.model.job.JobGroupInfo)1