All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softlayer.api.service.scale.policy.action.Scale Maven / Gradle / Ivy

The newest version!
package com.softlayer.api.service.scale.policy.action;

import com.softlayer.api.ApiClient;
import com.softlayer.api.ResponseHandler;
import com.softlayer.api.annotation.ApiMethod;
import com.softlayer.api.annotation.ApiProperty;
import com.softlayer.api.annotation.ApiType;
import com.softlayer.api.service.scale.policy.Action;
import java.util.concurrent.Future;

/**
 * A policy action to scale a group. A group can be scaled to an absolute member number or by a relative amount using a fixed number or a percentage. 
 *
 * @see SoftLayer_Scale_Policy_Action_Scale
 */
@ApiType("SoftLayer_Scale_Policy_Action_Scale")
public class Scale extends Action {

    /**
     * The number to scale by. This number has different meanings based on type.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long amount;

    public Long getAmount() {
        return amount;
    }

    public void setAmount(Long amount) {
        amountSpecified = true;
        this.amount = amount;
    }

    protected boolean amountSpecified;

    public boolean isAmountSpecified() {
        return amountSpecified;
    }

    public void unsetAmount() {
        amount = null;
        amountSpecified = false;
    }

    /**
     * The type of scale to perform. Possible values: 
*
*
* * ABSOLUTE - Force the group to be set at a specific number of group members. This may include scaling up or
* down or not at all. If the amount is outside of the min/max range of the group, an error occurs.
* * PERCENT - Scale the group up or down based on the positive or negative percentage given in amount. The
* number is a percent of the current group member count. Any extra percent after the decimal point is always ignored. If the resulting amount is zero, -1 or 1 is used depending upon whether the percentage was negative or positive respectively.
* * RELATIVE - Scale the group up or down by the positive or negative value given in amount. */ @ApiProperty(canBeNullOrNotSet = true) protected String scaleType; public String getScaleType() { return scaleType; } public void setScaleType(String scaleType) { scaleTypeSpecified = true; this.scaleType = scaleType; } protected boolean scaleTypeSpecified; public boolean isScaleTypeSpecified() { return scaleTypeSpecified; } public void unsetScaleType() { scaleType = null; scaleTypeSpecified = false; } public Service asService(ApiClient client) { return service(client, id); } public static Service service(ApiClient client) { return client.createService(Service.class, null); } public static Service service(ApiClient client, Long id) { return client.createService(Service.class, id == null ? null : id.toString()); } /** * A policy action to scale a group. A group can be scaled to an absolute member number or by a relative amount using a fixed number or a percentage. * * @see SoftLayer_Scale_Policy_Action_Scale */ @com.softlayer.api.annotation.ApiService("SoftLayer_Scale_Policy_Action_Scale") public static interface Service extends Action.Service { public ServiceAsync asAsync(); public Mask withNewMask(); public Mask withMask(); public void setMask(Mask mask); /** * @see SoftLayer_Scale_Policy_Action_Scale::createObject */ @ApiMethod public Scale createObject(Scale templateObject); /** * @see SoftLayer_Scale_Policy_Action_Scale::getObject */ @ApiMethod(value = "getObject", instanceRequired = true) public Scale getObjectForScale(); } public static interface ServiceAsync extends Action.ServiceAsync { public Mask withNewMask(); public Mask withMask(); public void setMask(Mask mask); /** * Async version of {@link Service#createObject} */ public Future createObject(Scale templateObject); public Future createObject(Scale templateObject, ResponseHandler callback); /** * Async version of {@link Service#getObjectForScale} */ public Future getObjectForScale(); public Future getObjectForScale(ResponseHandler callback); } public static class Mask extends com.softlayer.api.service.scale.policy.Action.Mask { public Mask amount() { withLocalProperty("amount"); return this; } public Mask scaleType() { withLocalProperty("scaleType"); return this; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy