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

com.softlayer.api.service.network.loadbalancer.global.Account Maven / Gradle / Ivy

There is a newer version: 0.3.4
Show newest version
package com.softlayer.api.service.network.loadbalancer.global;

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.billing.Item;
import com.softlayer.api.service.network.loadbalancer.global.Host;
import com.softlayer.api.service.network.loadbalancer.global.Type;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Future;

/**
 * The SoftLayer_Network_LoadBalancer_Global_Account data type contains the properties for a single global load balancer account.  The properties you are able to edit are fallbackIp, loadBalanceTypeId, and notes. The hosts relational property can be used for creating and editing hosts that belong to the global load balancer account.  The [[SoftLayer_Network_LoadBalancer_Global_Account::editObject|editObject]] method contains details on creating and edited hosts through the hosts relational property. 
 *
 * @see SoftLayer_Network_LoadBalancer_Global_Account
 */
@ApiType("SoftLayer_Network_LoadBalancer_Global_Account")
public class Account extends Entity {

    /**
     * Your SoftLayer customer account.
     */
    @ApiProperty
    protected com.softlayer.api.service.Account account;

    public com.softlayer.api.service.Account getAccount() {
        return account;
    }

    public void setAccount(com.softlayer.api.service.Account account) {
        this.account = account;
    }

    /**
     * The current billing item for a Global Load Balancer account.
     */
    @ApiProperty
    protected Item billingItem;

    public Item getBillingItem() {
        return billingItem;
    }

    public void setBillingItem(Item billingItem) {
        this.billingItem = billingItem;
    }

    /**
     * The hosts in the load balancing pool for a global load balancer account.
     */
    @ApiProperty
    protected List hosts;

    public List getHosts() {
        if (hosts == null) {
            hosts = new ArrayList();
        }
        return hosts;
    }

    /**
     * The load balance method of a global load balancer account
     */
    @ApiProperty
    protected Type loadBalanceType;

    public Type getLoadBalanceType() {
        return loadBalanceType;
    }

    public void setLoadBalanceType(Type loadBalanceType) {
        this.loadBalanceType = loadBalanceType;
    }

    /**
     * A flag indicating that the global load balancer is a managed resource.
     */
    @ApiProperty
    protected Boolean managedResourceFlag;

    public Boolean getManagedResourceFlag() {
        return managedResourceFlag;
    }

    public void setManagedResourceFlag(Boolean managedResourceFlag) {
        this.managedResourceFlag = managedResourceFlag;
    }

    /**
     * The maximum number of hosts that a global load balancer account is allowed to have.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long allowedNumberOfHosts;

    public Long getAllowedNumberOfHosts() {
        return allowedNumberOfHosts;
    }

    public void setAllowedNumberOfHosts(Long allowedNumberOfHosts) {
        allowedNumberOfHostsSpecified = true;
        this.allowedNumberOfHosts = allowedNumberOfHosts;
    }

    protected boolean allowedNumberOfHostsSpecified;

    public boolean isAllowedNumberOfHostsSpecified() {
        return allowedNumberOfHostsSpecified;
    }

    public void unsetAllowedNumberOfHosts() {
        allowedNumberOfHosts = null;
        allowedNumberOfHostsSpecified = false;
    }

    /**
     * The average amount of connections per second used within the current billing cycle.  This number is updated daily.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected BigDecimal averageConnectionsPerSecond;

    public BigDecimal getAverageConnectionsPerSecond() {
        return averageConnectionsPerSecond;
    }

    public void setAverageConnectionsPerSecond(BigDecimal averageConnectionsPerSecond) {
        averageConnectionsPerSecondSpecified = true;
        this.averageConnectionsPerSecond = averageConnectionsPerSecond;
    }

    protected boolean averageConnectionsPerSecondSpecified;

    public boolean isAverageConnectionsPerSecondSpecified() {
        return averageConnectionsPerSecondSpecified;
    }

    public void unsetAverageConnectionsPerSecond() {
        averageConnectionsPerSecond = null;
        averageConnectionsPerSecondSpecified = false;
    }

    /**
     * The amount of connections per second a global load balancer account may use within a billing cycle without being billed for an overage.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long connectionsPerSecond;

    public Long getConnectionsPerSecond() {
        return connectionsPerSecond;
    }

    public void setConnectionsPerSecond(Long connectionsPerSecond) {
        connectionsPerSecondSpecified = true;
        this.connectionsPerSecond = connectionsPerSecond;
    }

    protected boolean connectionsPerSecondSpecified;

    public boolean isConnectionsPerSecondSpecified() {
        return connectionsPerSecondSpecified;
    }

    public void unsetConnectionsPerSecond() {
        connectionsPerSecond = null;
        connectionsPerSecondSpecified = false;
    }

    /**
     * The IP address that will be return to a DNS request when none of the hosts for a global load balancer account could be returned.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String fallbackIp;

    public String getFallbackIp() {
        return fallbackIp;
    }

    public void setFallbackIp(String fallbackIp) {
        fallbackIpSpecified = true;
        this.fallbackIp = fallbackIp;
    }

    protected boolean fallbackIpSpecified;

    public boolean isFallbackIpSpecified() {
        return fallbackIpSpecified;
    }

    public void unsetFallbackIp() {
        fallbackIp = null;
        fallbackIpSpecified = false;
    }

    /**
     * The hostname of a global load balancer account that is being load balanced.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String hostname;

    public String getHostname() {
        return hostname;
    }

    public void setHostname(String hostname) {
        hostnameSpecified = true;
        this.hostname = hostname;
    }

    protected boolean hostnameSpecified;

    public boolean isHostnameSpecified() {
        return hostnameSpecified;
    }

    public void unsetHostname() {
        hostname = null;
        hostnameSpecified = false;
    }

    /**
     * The unique identifier of a global load balancer account.
     */
    @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;
    }

    /**
     * The identifier of the load balance method for a global load balancer account.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long loadBalanceTypeId;

    public Long getLoadBalanceTypeId() {
        return loadBalanceTypeId;
    }

    public void setLoadBalanceTypeId(Long loadBalanceTypeId) {
        loadBalanceTypeIdSpecified = true;
        this.loadBalanceTypeId = loadBalanceTypeId;
    }

    protected boolean loadBalanceTypeIdSpecified;

    public boolean isLoadBalanceTypeIdSpecified() {
        return loadBalanceTypeIdSpecified;
    }

    public void unsetLoadBalanceTypeId() {
        loadBalanceTypeId = null;
        loadBalanceTypeIdSpecified = false;
    }

    /**
     * Additional customer defined information for a global load balancer account.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String notes;

    public String getNotes() {
        return notes;
    }

    public void setNotes(String notes) {
        notesSpecified = true;
        this.notes = notes;
    }

    protected boolean notesSpecified;

    public boolean isNotesSpecified() {
        return notesSpecified;
    }

    public void unsetNotes() {
        notes = null;
        notesSpecified = false;
    }

    /**
     * A count of the hosts in the load balancing pool for a global load balancer account.
     */
    @ApiProperty
    protected Long hostCount;

    public Long getHostCount() {
        return hostCount;
    }

    public void setHostCount(Long hostCount) {
        this.hostCount = hostCount;
    }

    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 global load balancer account enables you to load balance traffic between servers that are in geographically diverse locations.  SoftLayer's global load balancers act as a highly modified DNS server.  SoftLayer's global load balancers work by accepting DNS requests for a specific hostname, choosing a host from a load balancing pool using the load balance method specified, and returning a destination IP address through a DNS response. 
*
* A global load balancer account can be created by ordering it as an additional service through the SoftLayer customer portal. You can modify your new global load balancer account once it's created and provisioned. There is a delay before your global load balancer account is created because the purchase has to be approved by SoftLayer sales and provisioned.
*
* Hosts are created and modified through the [[SoftLayer_Network_LoadBalancer_Global_Account::editObject|editObject]] method instead of directly through the [[SoftLayer_Network_LoadBalancer_Global_Host|global load balancer host service]]. This allows you to update the properties of a global load balancer account and the hosts that make up the load balancing pool in a single request.
*
* To have SoftLayer's global load balancers respond to DNS requests, a nameserver resource record must be added for the hostname on your global load balancer account. If your globally load balanced domain is hosted on the SoftLayer nameservers, the [[SoftLayer_Network_LoadBalancer_Global_Account::addNsRecord|addNsRecord]] method will create the required nameserver resource record in the zone file for you. If your globally load balanced domain is hosted on any other nameservers, you will need to add the nameserver resource record yourself. The SoftLayer Knowledge Layer contains information about [http://knowledgelayer.softlayer.com/questions/421/ configuring DNS] for a globally load balanced domain.
*
* Use the [[SoftLayer_Network_LoadBalancer_Global_Host::deleteObject]] method to remove a host from your global load balancing pool.
*
* Global load balancer accounts can only be removed by opening a ticket with the SoftLayer accounting team and request that the global load balancer service be canceled. * * @see SoftLayer_Network_LoadBalancer_Global_Account */ @com.softlayer.api.annotation.ApiService("SoftLayer_Network_LoadBalancer_Global_Account") public static interface Service extends com.softlayer.api.Service { public ServiceAsync asAsync(); public Mask withNewMask(); public Mask withMask(); public void setMask(Mask mask); /** * If your globally load balanced domain is hosted on the SoftLayer nameservers this method will add the required NS resource record to your DNS zone file and remove any A records that match the host portion of a global load balancer account hostname. A NS resource record is required to be able to use your SoftLayer global load balancer account. Please make sure the zone file for the hostname listed on your SoftLayer global load balancer account is setup prior to using this method. If your globally load balanced domain is hosted on any other nameservers this method will not be able to add the required NS record. * * @see SoftLayer_Network_LoadBalancer_Global_Account::addNsRecord */ @ApiMethod(instanceRequired = true) public Boolean addNsRecord(); /** * Edit the properties of a global load balancer account by passing in a modified instance of the object. The global load balancer account properties you are able to edit are: fallback ip, load balance type id, and notes. Hosts that belong to your SoftLayer global load balancer account are created and modified through this method. An example templateObject that updates global load balancer account properties, updates the properties of a host, and adds a new host is shown below:
*
*
* * id: 2
* * loadBalanceTypeId: 2
* * notes: Notes updated
* * fallbackIp: 1.1.1.1
* * hosts:
* ** id: 19
* ** destinationIp: 2.2.2.2
* ** weight: 25
* ** healthCheck: http
* ** destinationPort: 80
* ** enabled: 1


* ** destinationIp: 3.3.3.3
* ** weight: 25
* ** healthCheck: http
* ** destinationPort: 80
* ** enabled: 1
*
*
*
*
* The first section contains the properties of the global load balancer account that will be updated, while the second section contains the elements of the 'hosts' property of the global load balancer account. The first host listed will have its properties updated because the 'id' property of the host is set, meaning the global load balancer host with an id of 19 will be updated. The second host listed will be created because it lacks the 'id' property.
*
* There is a limit to the maximum number of hosts that you are allowed to add, and is defined by the allowedNumberOfHosts property on the global load balancer account. The destination IP address of a host must be an IP address that belongs to your SoftLayer Account, or a local load balancer virtual IP address that belongs to your account. The destination IP address and destination port are required and must be provided when creating a host. * * @see SoftLayer_Network_LoadBalancer_Global_Account::editObject */ @ApiMethod(instanceRequired = true) public Boolean editObject(Account templateObject); /** * getObject retrieves the SoftLayer_Network_LoadBalancer_Global_Account object whose ID number corresponds to the ID number of the init paramater passed to the SoftLayer_Network_LoadBalancer_Global_Account service. You can only retrieve a global load balancer account that is assigned to your SoftLayer customer account. * * @see SoftLayer_Network_LoadBalancer_Global_Account::getObject */ @ApiMethod(instanceRequired = true) public Account getObject(); /** * If your globally load balanced domain is hosted on the SoftLayer nameservers this method will remove the NS resource record from your DNS zone file. Removing the NS resource record will basically disable your global load balancer account since no DNS requests will be forwarded to the global load balancers. Any A records that were removed when the NS resource record was added will not be created for you. If your globally load balanced domain is hosted on any other nameservers this method will not be able to remove the required NS record. * * @see SoftLayer_Network_LoadBalancer_Global_Account::removeNsRecord */ @ApiMethod(instanceRequired = true) public Boolean removeNsRecord(); /** * Your SoftLayer customer account. * * @see SoftLayer_Network_LoadBalancer_Global_Account::getAccount */ @ApiMethod(instanceRequired = true) public com.softlayer.api.service.Account getAccount(); /** * The current billing item for a Global Load Balancer account. * * @see SoftLayer_Network_LoadBalancer_Global_Account::getBillingItem */ @ApiMethod(instanceRequired = true) public Item getBillingItem(); /** * The hosts in the load balancing pool for a global load balancer account. * * @see SoftLayer_Network_LoadBalancer_Global_Account::getHosts */ @ApiMethod(instanceRequired = true) public List getHosts(); /** * The load balance method of a global load balancer account * * @see SoftLayer_Network_LoadBalancer_Global_Account::getLoadBalanceType */ @ApiMethod(instanceRequired = true) public Type getLoadBalanceType(); /** * A flag indicating that the global load balancer is a managed resource. * * @see SoftLayer_Network_LoadBalancer_Global_Account::getManagedResourceFlag */ @ApiMethod(instanceRequired = true) public Boolean getManagedResourceFlag(); } 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#addNsRecord} */ public Future addNsRecord(); public Future addNsRecord(ResponseHandler callback); /** * Async version of {@link Service#editObject} */ public Future editObject(Account templateObject); public Future editObject(Account templateObject, ResponseHandler callback); /** * Async version of {@link Service#getObject} */ public Future getObject(); public Future getObject(ResponseHandler callback); /** * Async version of {@link Service#removeNsRecord} */ public Future removeNsRecord(); public Future removeNsRecord(ResponseHandler callback); /** * Async version of {@link Service#getAccount} */ public Future getAccount(); /** * Async callback version of {@link Service#getAccount} */ public Future getAccount(ResponseHandler callback); /** * Async version of {@link Service#getBillingItem} */ public Future getBillingItem(); /** * Async callback version of {@link Service#getBillingItem} */ public Future getBillingItem(ResponseHandler callback); /** * Async version of {@link Service#getHosts} */ public Future> getHosts(); /** * Async callback version of {@link Service#getHosts} */ public Future getHosts(ResponseHandler> callback); /** * Async version of {@link Service#getLoadBalanceType} */ public Future getLoadBalanceType(); /** * Async callback version of {@link Service#getLoadBalanceType} */ public Future getLoadBalanceType(ResponseHandler callback); /** * Async version of {@link Service#getManagedResourceFlag} */ public Future getManagedResourceFlag(); /** * Async callback version of {@link Service#getManagedResourceFlag} */ public Future getManagedResourceFlag(ResponseHandler callback); } public static class Mask extends com.softlayer.api.service.Entity.Mask { public com.softlayer.api.service.Account.Mask account() { return withSubMask("account", com.softlayer.api.service.Account.Mask.class); } public com.softlayer.api.service.billing.Item.Mask billingItem() { return withSubMask("billingItem", com.softlayer.api.service.billing.Item.Mask.class); } public Host.Mask hosts() { return withSubMask("hosts", Host.Mask.class); } public Type.Mask loadBalanceType() { return withSubMask("loadBalanceType", Type.Mask.class); } public Mask managedResourceFlag() { withLocalProperty("managedResourceFlag"); return this; } public Mask allowedNumberOfHosts() { withLocalProperty("allowedNumberOfHosts"); return this; } public Mask averageConnectionsPerSecond() { withLocalProperty("averageConnectionsPerSecond"); return this; } public Mask connectionsPerSecond() { withLocalProperty("connectionsPerSecond"); return this; } public Mask fallbackIp() { withLocalProperty("fallbackIp"); return this; } public Mask hostname() { withLocalProperty("hostname"); return this; } public Mask id() { withLocalProperty("id"); return this; } public Mask loadBalanceTypeId() { withLocalProperty("loadBalanceTypeId"); return this; } public Mask notes() { withLocalProperty("notes"); return this; } public Mask hostCount() { withLocalProperty("hostCount"); return this; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy