Skip to content
Permalink
Browse files
Improves the autoscale docs.
  • Loading branch information
zack-shoylev committed Mar 11, 2015
1 parent 4cf1a99 commit eeceb98b740f0cc9ee231faa99916ad7321d7800
Showing 7 changed files with 155 additions and 52 deletions.
@@ -188,6 +188,7 @@ public static class Builder {
protected Map<String, String> args;

/**
* Required.
* @param name The name of this ScalingPolicy.
* @return The builder object.
* @see CreateScalingPolicy#getName()
@@ -198,6 +199,9 @@ public Builder name(String name) {
}

/**
* Required.
* The type of policy that will be executed for the current release, this value can be either webhook or schedule.
*
* @param type The type for this ScalingPolicy.
* @return The builder object.
* @see ScalingPolicyType
@@ -209,6 +213,11 @@ public Builder type(ScalingPolicyType type) {
}

/**
* Required.
* The cooldown period, in seconds, before this particular scaling policy can be executed again. The policy
* cooldown period does not affect the global scaling group cooldown. The minimum value for this parameter is
* 0 seconds, the maximum value is 86400 seconds (24 hrs).
*
* @param cooldown The cooldown of this ScalingPolicy.
* @return The builder object.
* @see CreateScalingPolicy#getCooldown()
@@ -240,6 +249,7 @@ public Builder targetType(ScalingPolicyTargetType targetType) {
}

/**
* Optional.
* @param cron This parameter specifies the recurring time when the policy will be executed as a cron entry.
* For example, if this is parameter is set to "1 0 * * *",
* the policy will be executed at one minute past midnight (00:01)
@@ -257,6 +267,7 @@ public Builder cronSchedule(String cron) {
}

/**
* Optional.
* @param at This parameter specifies the time at which this policy will be executed.
* This property is mutually exclusive with the "cron" parameter.
* You can either provide "cron" or "at" for a given policy, but not both.
@@ -42,7 +42,7 @@ protected Group(String id, ImmutableList<Link> links, ImmutableList<ScalingPolic
this.scalingPolicy = scalingPolicy;
this.groupConfiguration = groupConfiguration;
this.launchConfiguration = launchConfiguration;
}
}

/**
* Unique group identifier, usually UUID
@@ -99,7 +99,7 @@ public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
Group that = Group.class.cast(obj);
return Objects.equal(this.id, that.id) &&
return Objects.equal(this.id, that.id) &&
Objects.equal(this.links, that.links) &&
Objects.equal(this.scalingPolicy, that.scalingPolicy) &&
Objects.equal(this.groupConfiguration, that.groupConfiguration) &&
@@ -120,11 +120,11 @@ public String toString() {
return string().toString();
}

public static Builder builder() {
public static Builder builder() {
return new Builder();
}

public Builder toBuilder() {
public Builder toBuilder() {
return new Builder().fromGroup(this);
}

@@ -135,7 +135,7 @@ public static class Builder {
protected GroupConfiguration groupConfiguration;
protected LaunchConfiguration launchConfiguration;

/**
/**
* @param id The id of this Group.
* @return The builder object.
* @see Group#getId()
@@ -145,7 +145,7 @@ public Builder id(String id) {
return this;
}

/**
/**
* @param links The links of this Group.
* @return The builder object.
* @see Group#getLinks()
@@ -155,17 +155,17 @@ public Builder links(List<Link> links) {
return this;
}

/**
/**
* @param scalingPolicy The scaling policies list of this Group.
* @return The builder object.
* @see Group#getScalingPolicy()
* @see Group#getScalingPolicies()
*/
public Builder scalingPolicy(List<ScalingPolicy> scalingPolicy) {
this.scalingPolicy = ImmutableList.copyOf(scalingPolicy);
return this;
}

/**
/**
* @param groupConfiguration The groupConfiguration of this Group.
* @return The builder object.
* @see Group#getGroupConfiguration()
@@ -175,7 +175,7 @@ public Builder groupConfiguration(GroupConfiguration groupConfiguration) {
return this;
}

/**
/**
* @param launchConfiguration The launchConfiguration of this Group.
* @return The builder object.
* @see Group#getLaunchConfiguration()
@@ -199,6 +199,6 @@ public Builder fromGroup(Group in) {
.scalingPolicy(in.getScalingPolicies())
.groupConfiguration(in.getGroupConfiguration())
.launchConfiguration(in.getLaunchConfiguration());
}
}
}
}
@@ -30,7 +30,7 @@

/**
* Autoscale GroupConfiguration.
*
*
* @see GroupApi#create(GroupConfiguration, LaunchConfiguration, java.util.List)
*/
public class GroupConfiguration implements Comparable<GroupConfiguration>{
@@ -65,7 +65,7 @@ protected GroupConfiguration(String name, int cooldown, int minEntities, int max
*/
public String getName() {
return this.name;
}
}

/**
* @return the cooldown for this GroupConfiguration.
@@ -109,7 +109,7 @@ public boolean equals(Object obj) {
if (this == obj) return true;
if (obj == null || getClass() != obj.getClass()) return false;
GroupConfiguration that = GroupConfiguration.class.cast(obj);
return Objects.equal(this.name, that.name) &&
return Objects.equal(this.name, that.name) &&
Objects.equal(this.cooldown, that.cooldown) &&
Objects.equal(this.minEntities, that.minEntities) &&
Objects.equal(this.maxEntities, that.maxEntities) &&
@@ -130,11 +130,11 @@ public String toString() {
return string().toString();
}

public static Builder builder() {
public static Builder builder() {
return new Builder();
}

public Builder toBuilder() {
public Builder toBuilder() {
return new Builder().fromGroupConfiguration(this);
}

@@ -145,7 +145,10 @@ public static class Builder {
protected int maxEntities;
protected Map<String, String> metadata;

/**
/**
* Required.
* The name of the scaling group, does not need to be unique.
*
* @param name The name of this GroupConfiguration.
* @return The builder object.
* @see GroupConfiguration#getName()
@@ -155,8 +158,12 @@ public Builder name(String name) {
return this;
}

/**
* @param name The cooldown for this GroupConfiguration.
/**
* Required.
* The period of time, in seconds, that must pass before any scaling can occur after the previous scaling.
* Must be an integer between 0 and 86400 (24 hrs).
*
* @param cooldown The cooldown for this GroupConfiguration.
* @return The builder object.
* @see GroupConfiguration#getCooldown()
*/
@@ -165,8 +172,11 @@ public Builder cooldown(int cooldown) {
return this;
}

/**
* @param name The cooldown for this GroupConfiguration.
/**
* Required.
* The minimum number of entities in the scaling group. This number must be an integer between 0 and 1000.
*
* @param minEntities The cooldown for this GroupConfiguration.
* @return The builder object.
* @see GroupConfiguration#getCooldown()
*/
@@ -175,8 +185,12 @@ public Builder minEntities(int minEntities) {
return this;
}

/**
* @param name The maxEntities for this GroupConfiguration.
/**
* Optional.
* The maximum number of entities that are allowed in the scaling group. If unconfigured, defaults to 1000.
* If this parameter is provided it must be set to an integer between 0 and 1000.
*
* @param maxEntities The maxEntities for this GroupConfiguration.
* @return The builder object.
* @see GroupConfiguration#getCooldown()
*/
@@ -185,18 +199,22 @@ public Builder maxEntities(int maxEntities) {
return this;
}

/**
* @param name The metadata for this GroupConfiguration.
/**
* Optional.
* This optional parameter specifies custom metadata for your group configuration. You can use the metadata
* parameter for customer automation, but it does not change any functionality in Auto Scale. There currently is
* no limitation on depth.
*
* @param metadata The metadata for this GroupConfiguration.
* @return The builder object.
* @see GroupConfiguration#getDatabases()
* @see GroupConfiguration#getMetadata()
*/
public Builder metadata(Map<String, String> metadata) {
this.metadata = metadata;
return this;
}

/**
*
* @return A new GroupConfiguration object.
*/
public GroupConfiguration build() {
@@ -210,7 +228,7 @@ public Builder fromGroupConfiguration(GroupConfiguration in) {
.minEntities(in.getMinEntities())
.maxEntities(in.getMaxEntities())
.metadata(in.getMetadata());
}
}
}

@Override

0 comments on commit eeceb98

Please sign in to comment.