com.softlayer.api.service.network.lbaas.L7Policy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of softlayer-api-client Show documentation
Show all versions of softlayer-api-client Show documentation
API client for accessing the SoftLayer API
package com.softlayer.api.service.network.lbaas;
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.Entity;
import com.softlayer.api.service.network.lbaas.L7Rule;
import com.softlayer.api.service.network.lbaas.LoadBalancer;
import com.softlayer.api.service.network.lbaas.PolicyRule;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;
/**
* The SoftLayer_Network_LBaaS_L7Policy represents the policy for a listener.
*
* @see SoftLayer_Network_LBaaS_L7Policy
*/
@ApiType("SoftLayer_Network_LBaaS_L7Policy")
public class L7Policy extends Entity {
@ApiProperty
protected List l7Rules;
public List getL7Rules() {
if (l7Rules == null) {
l7Rules = new ArrayList();
}
return l7Rules;
}
/**
* The Action to take if the rules belonging to this policy match. It can be set to any of the following values: REDIRECT_URL, REDIRECT_POOL, REJECT.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected String action;
public String getAction() {
return action;
}
public void setAction(String action) {
actionSpecified = true;
this.action = action;
}
protected boolean actionSpecified;
public boolean isActionSpecified() {
return actionSpecified;
}
public void unsetAction() {
action = null;
actionSpecified = false;
}
/**
* Specifies when a L7 Policy was created.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected GregorianCalendar createDate;
public GregorianCalendar getCreateDate() {
return createDate;
}
public void setCreateDate(GregorianCalendar createDate) {
createDateSpecified = true;
this.createDate = createDate;
}
protected boolean createDateSpecified;
public boolean isCreateDateSpecified() {
return createDateSpecified;
}
public void unsetCreateDate() {
createDate = null;
createDateSpecified = false;
}
/**
* The unique identifier of a policy.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
idSpecified = true;
this.id = id;
}
protected boolean idSpecified;
public boolean isIdSpecified() {
return idSpecified;
}
public void unsetId() {
id = null;
idSpecified = false;
}
/**
* Specifies when a L7 Policy was updated previously.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected GregorianCalendar modifyDate;
public GregorianCalendar getModifyDate() {
return modifyDate;
}
public void setModifyDate(GregorianCalendar modifyDate) {
modifyDateSpecified = true;
this.modifyDate = modifyDate;
}
protected boolean modifyDateSpecified;
public boolean isModifyDateSpecified() {
return modifyDateSpecified;
}
public void unsetModifyDate() {
modifyDate = null;
modifyDateSpecified = false;
}
/**
* Name of a Policy.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected String name;
public String getName() {
return name;
}
public void setName(String name) {
nameSpecified = true;
this.name = name;
}
protected boolean nameSpecified;
public boolean isNameSpecified() {
return nameSpecified;
}
public void unsetName() {
name = null;
nameSpecified = false;
}
/**
* The order in which the policy is evaluated. Each policy should have a unique priority
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long priority;
public Long getPriority() {
return priority;
}
public void setPriority(Long priority) {
prioritySpecified = true;
this.priority = priority;
}
protected boolean prioritySpecified;
public boolean isPrioritySpecified() {
return prioritySpecified;
}
public void unsetPriority() {
priority = null;
prioritySpecified = false;
}
/**
* The L7 pool id to which traffic is redirected
*/
@ApiProperty(canBeNullOrNotSet = true)
protected Long redirectL7PoolId;
public Long getRedirectL7PoolId() {
return redirectL7PoolId;
}
public void setRedirectL7PoolId(Long redirectL7PoolId) {
redirectL7PoolIdSpecified = true;
this.redirectL7PoolId = redirectL7PoolId;
}
protected boolean redirectL7PoolIdSpecified;
public boolean isRedirectL7PoolIdSpecified() {
return redirectL7PoolIdSpecified;
}
public void unsetRedirectL7PoolId() {
redirectL7PoolId = null;
redirectL7PoolIdSpecified = false;
}
/**
* The UUID of the L7 pool object referenced by the policy when the policy action is set to REDIRECT_POOL
*/
@ApiProperty(canBeNullOrNotSet = true)
protected String redirectL7PoolUuid;
public String getRedirectL7PoolUuid() {
return redirectL7PoolUuid;
}
public void setRedirectL7PoolUuid(String redirectL7PoolUuid) {
redirectL7PoolUuidSpecified = true;
this.redirectL7PoolUuid = redirectL7PoolUuid;
}
protected boolean redirectL7PoolUuidSpecified;
public boolean isRedirectL7PoolUuidSpecified() {
return redirectL7PoolUuidSpecified;
}
public void unsetRedirectL7PoolUuid() {
redirectL7PoolUuid = null;
redirectL7PoolUuidSpecified = false;
}
/**
* The URL to which traffic is redirected when the action is set to REDIRECT_URL.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected String redirectUrl;
public String getRedirectUrl() {
return redirectUrl;
}
public void setRedirectUrl(String redirectUrl) {
redirectUrlSpecified = true;
this.redirectUrl = redirectUrl;
}
protected boolean redirectUrlSpecified;
public boolean isRedirectUrlSpecified() {
return redirectUrlSpecified;
}
public void unsetRedirectUrl() {
redirectUrl = null;
redirectUrlSpecified = false;
}
/**
* The UUID of a Policy.
*/
@ApiProperty(canBeNullOrNotSet = true)
protected String uuid;
public String getUuid() {
return uuid;
}
public void setUuid(String uuid) {
uuidSpecified = true;
this.uuid = uuid;
}
protected boolean uuidSpecified;
public boolean isUuidSpecified() {
return uuidSpecified;
}
public void unsetUuid() {
uuid = null;
uuidSpecified = false;
}
/**
* A count of
*/
@ApiProperty
protected Long l7RuleCount;
public Long getL7RuleCount() {
return l7RuleCount;
}
public void setL7RuleCount(Long l7RuleCount) {
this.l7RuleCount = l7RuleCount;
}
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());
}
/**
* The SoftLayer_Network_LBaaS_L7Policy service allows consumers to manage the Policies associated with a Listener. A Listener can have multiple policies. Polices are associated with priorities. The priorities indicate the order in which policies are evaluated. Each policy is configured with an action which is applied when http traffic matches rules associated with the policy. A policy can be configured with one of the following actions: redirect to pool, redirect to url, or reject. Policies configured with reject are always evaluated first irrespective of the priority followed by redirect to url, after which policies with action set to redirect to pool are evaluated. Polices have multiple rules, each rule is evaluated to true or false. If all the rules of the policy evaluate to true then the action associated with that policy is applied to the request.
*
* @see SoftLayer_Network_LBaaS_L7Policy
*/
@com.softlayer.api.annotation.ApiService("SoftLayer_Network_LBaaS_L7Policy")
public static interface Service extends com.softlayer.api.Service {
public ServiceAsync asAsync();
public Mask withNewMask();
public Mask withMask();
public void setMask(Mask mask);
/**
* This function creates multiple policies with rules for the given listener.
*
* @see SoftLayer_Network_LBaaS_L7Policy::addL7Policies
*/
@ApiMethod
public LoadBalancer addL7Policies(String listenerUuid, List policiesRules);
/**
* Deletes a l7 policy instance and the rules associated with the policy
*
* @see SoftLayer_Network_LBaaS_L7Policy::deleteObject
*/
@ApiMethod(instanceRequired = true)
public LoadBalancer deleteObject();
/**
* Edit a l7 policy instance's properties
*
* @see SoftLayer_Network_LBaaS_L7Policy::editObject
*/
@ApiMethod(instanceRequired = true)
public LoadBalancer editObject(L7Policy templateObject);
/**
* @see SoftLayer_Network_LBaaS_L7Policy::getObject
*/
@ApiMethod(instanceRequired = true)
public L7Policy getObject();
/**
* @see SoftLayer_Network_LBaaS_L7Policy::getL7Rules
*/
@ApiMethod(instanceRequired = true)
public List getL7Rules();
}
public static interface ServiceAsync extends com.softlayer.api.ServiceAsync {
public Mask withNewMask();
public Mask withMask();
public void setMask(Mask mask);
/**
* Async version of {@link Service#addL7Policies}
*/
public Future addL7Policies(String listenerUuid, List policiesRules);
public Future> addL7Policies(String listenerUuid, List policiesRules, ResponseHandler callback);
/**
* Async version of {@link Service#deleteObject}
*/
public Future deleteObject();
public Future> deleteObject(ResponseHandler callback);
/**
* Async version of {@link Service#editObject}
*/
public Future editObject(L7Policy templateObject);
public Future> editObject(L7Policy templateObject, ResponseHandler callback);
/**
* Async version of {@link Service#getObject}
*/
public Future getObject();
public Future> getObject(ResponseHandler callback);
/**
* Async version of {@link Service#getL7Rules}
*/
public Future> getL7Rules();
/**
* Async callback version of {@link Service#getL7Rules}
*/
public Future> getL7Rules(ResponseHandler> callback);
}
public static class Mask extends com.softlayer.api.service.Entity.Mask {
public L7Rule.Mask l7Rules() {
return withSubMask("l7Rules", L7Rule.Mask.class);
}
public Mask action() {
withLocalProperty("action");
return this;
}
public Mask createDate() {
withLocalProperty("createDate");
return this;
}
public Mask id() {
withLocalProperty("id");
return this;
}
public Mask modifyDate() {
withLocalProperty("modifyDate");
return this;
}
public Mask name() {
withLocalProperty("name");
return this;
}
public Mask priority() {
withLocalProperty("priority");
return this;
}
public Mask redirectL7PoolId() {
withLocalProperty("redirectL7PoolId");
return this;
}
public Mask redirectL7PoolUuid() {
withLocalProperty("redirectL7PoolUuid");
return this;
}
public Mask redirectUrl() {
withLocalProperty("redirectUrl");
return this;
}
public Mask uuid() {
withLocalProperty("uuid");
return this;
}
public Mask l7RuleCount() {
withLocalProperty("l7RuleCount");
return this;
}
}
}