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

com.softlayer.api.service.virtual.Host Maven / Gradle / Ivy

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

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.Account;
import com.softlayer.api.service.Entity;
import com.softlayer.api.service.hardware.Server;
import com.softlayer.api.service.metric.tracking.Object;
import com.softlayer.api.service.virtual.Guest;
import com.softlayer.api.service.virtual.host.PciDevice;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;

/**
 * The virtual host represents the platform on which virtual guests reside. At times a virtual host has no allocations on the physical server, however with many modern platforms it is a virtual machine with small CPU and Memory allocations that runs in the Control Domain. 
 *
 * @see SoftLayer_Virtual_Host
 */
@ApiType("SoftLayer_Virtual_Host")
public class Host extends Entity {

    /**
     * The account which a virtual host belongs to.
     */
    @ApiProperty
    protected Account account;

    public Account getAccount() {
        return account;
    }

    public void setAccount(Account account) {
        this.account = account;
    }

    /**
     * Boolean flag indicating whether this virtualization platform gets billed per guest rather than at a fixed rate.
     */
    @ApiProperty
    protected Boolean billedPerGuestFlag;

    public Boolean getBilledPerGuestFlag() {
        return billedPerGuestFlag;
    }

    public void setBilledPerGuestFlag(Boolean billedPerGuestFlag) {
        this.billedPerGuestFlag = billedPerGuestFlag;
    }

    /**
     * Boolean flag indicating whether this virtualization platform gets billed per memory usage rather than at a fixed rate.
     */
    @ApiProperty
    protected Boolean billedPerMemoryUsageFlag;

    public Boolean getBilledPerMemoryUsageFlag() {
        return billedPerMemoryUsageFlag;
    }

    public void setBilledPerMemoryUsageFlag(Boolean billedPerMemoryUsageFlag) {
        this.billedPerMemoryUsageFlag = billedPerMemoryUsageFlag;
    }

    /**
     * The guests associated with a virtual host.
     */
    @ApiProperty
    protected List guests;

    public List getGuests() {
        if (guests == null) {
            guests = new ArrayList();
        }
        return guests;
    }

    /**
     * The hardware record which a virtual host resides on.
     */
    @ApiProperty
    protected Server hardware;

    public Server getHardware() {
        return hardware;
    }

    public void setHardware(Server hardware) {
        this.hardware = hardware;
    }

    /**
     * The metric tracking object for this virtual host.
     */
    @ApiProperty
    protected Object metricTrackingObject;

    public Object getMetricTrackingObject() {
        return metricTrackingObject;
    }

    public void setMetricTrackingObject(Object metricTrackingObject) {
        this.metricTrackingObject = metricTrackingObject;
    }

    @ApiProperty
    protected List pciDevices;

    public List getPciDevices() {
        if (pciDevices == null) {
            pciDevices = new ArrayList();
        }
        return pciDevices;
    }

    /**
     * A virtual host's associated account id 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long accountId;

    public Long getAccountId() {
        return accountId;
    }

    public void setAccountId(Long accountId) {
        accountIdSpecified = true;
        this.accountId = accountId;
    }

    protected boolean accountIdSpecified;

    public boolean isAccountIdSpecified() {
        return accountIdSpecified;
    }

    public void unsetAccountId() {
        accountId = null;
        accountIdSpecified = false;
    }

    /**
     * The date a virtual host 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;
    }

    /**
     * A virtual host's description. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected String description;

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        descriptionSpecified = true;
        this.description = description;
    }

    protected boolean descriptionSpecified;

    public boolean isDescriptionSpecified() {
        return descriptionSpecified;
    }

    public void unsetDescription() {
        description = null;
        descriptionSpecified = false;
    }

    /**
     * The enabled flag specifies whether a virtual host can run guests. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long enabledFlag;

    public Long getEnabledFlag() {
        return enabledFlag;
    }

    public void setEnabledFlag(Long enabledFlag) {
        enabledFlagSpecified = true;
        this.enabledFlag = enabledFlag;
    }

    protected boolean enabledFlagSpecified;

    public boolean isEnabledFlagSpecified() {
        return enabledFlagSpecified;
    }

    public void unsetEnabledFlag() {
        enabledFlag = null;
        enabledFlagSpecified = false;
    }

    /**
     * A hardware device which a virtual host resides. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long hardwareId;

    public Long getHardwareId() {
        return hardwareId;
    }

    public void setHardwareId(Long hardwareId) {
        hardwareIdSpecified = true;
        this.hardwareId = hardwareId;
    }

    protected boolean hardwareIdSpecified;

    public boolean isHardwareIdSpecified() {
        return hardwareIdSpecified;
    }

    public void unsetHardwareId() {
        hardwareId = null;
        hardwareIdSpecified = false;
    }

    /**
     * Unique ID for a virtual host. 
     */
    @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 date a virtual host was last modified. 
     */
    @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;
    }

    /**
     * A virtual host's name. 
     */
    @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 amount of memory physically available for a virtual host. 
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long physicalMemoryCapacity;

    public Long getPhysicalMemoryCapacity() {
        return physicalMemoryCapacity;
    }

    public void setPhysicalMemoryCapacity(Long physicalMemoryCapacity) {
        physicalMemoryCapacitySpecified = true;
        this.physicalMemoryCapacity = physicalMemoryCapacity;
    }

    protected boolean physicalMemoryCapacitySpecified;

    public boolean isPhysicalMemoryCapacitySpecified() {
        return physicalMemoryCapacitySpecified;
    }

    public void unsetPhysicalMemoryCapacity() {
        physicalMemoryCapacity = null;
        physicalMemoryCapacitySpecified = false;
    }

    /**
     * Unique ID for a virtual host's record on a virtualization platform. 
     */
    @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 the guests associated with a virtual host.
     */
    @ApiProperty
    protected Long guestCount;

    public Long getGuestCount() {
        return guestCount;
    }

    public void setGuestCount(Long guestCount) {
        this.guestCount = guestCount;
    }

    /**
     * A count of 
     */
    @ApiProperty
    protected Long pciDeviceCount;

    public Long getPciDeviceCount() {
        return pciDeviceCount;
    }

    public void setPciDeviceCount(Long pciDeviceCount) {
        this.pciDeviceCount = pciDeviceCount;
    }

    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 virtual host service provides a common interface to any virtualization platform supported by SoftLayer. Interaction with various third party APIs is not needed when implementing this service to administer your hosts. 
     *
     * @see SoftLayer_Virtual_Host
     */
    @com.softlayer.api.annotation.ApiService("SoftLayer_Virtual_Host")
    public static interface Service extends com.softlayer.api.Service {

        public ServiceAsync asAsync();
        public Mask withNewMask();
        public Mask withMask();
        public void setMask(Mask mask);

        /**
         * Query a virtualization platform directly to retrieve details regarding a guest. 
         *
         * @see SoftLayer_Virtual_Host::getLiveGuestByUuid
         */
        @ApiMethod(instanceRequired = true)
        public Guest getLiveGuestByUuid(String uuid);

        /**
         * Query a virtualization platform directly to retrieve a list of known guests. 
         *
         * @see SoftLayer_Virtual_Host::getLiveGuestList
         */
        @ApiMethod(instanceRequired = true)
        public List getLiveGuestList();

        /**
         * Query a virtualization platform directly to retrieve recent metric data for a guest. 
         *
         * @see SoftLayer_Virtual_Host::getLiveGuestRecentMetricData
         */
        @ApiMethod(instanceRequired = true)
        public List getLiveGuestRecentMetricData(String uuid, Long time, Long limit, Long interval);

        /**
         * @see SoftLayer_Virtual_Host::getObject
         */
        @ApiMethod(instanceRequired = true)
        public Host getObject();

        /**
         * Pause a virtual guest 
         *
         * @see SoftLayer_Virtual_Host::pauseLiveGuest
         */
        @ApiMethod(instanceRequired = true)
        public Boolean pauseLiveGuest(String uuid);

        /**
         * Power cycle a virtual guest 
         *
         * @see SoftLayer_Virtual_Host::powerCycleLiveGuest
         */
        @ApiMethod(instanceRequired = true)
        public Boolean powerCycleLiveGuest(String uuid);

        /**
         * Power off a virtual guest 
         *
         * @see SoftLayer_Virtual_Host::powerOffLiveGuest
         */
        @ApiMethod(instanceRequired = true)
        public Boolean powerOffLiveGuest(String uuid);

        /**
         * Power on a virtual guest 
         *
         * @see SoftLayer_Virtual_Host::powerOnLiveGuest
         */
        @ApiMethod(instanceRequired = true)
        public Boolean powerOnLiveGuest(String uuid);

        /**
         * Attempt to complete a soft reboot of a guest by shutting down the operating system. 
         *
         * @see SoftLayer_Virtual_Host::rebootSoftLiveGuest
         */
        @ApiMethod(instanceRequired = true)
        public Boolean rebootSoftLiveGuest(String uuid);

        /**
         * Resume a virtual guest 
         *
         * @see SoftLayer_Virtual_Host::resumeLiveGuest
         */
        @ApiMethod(instanceRequired = true)
        public Boolean resumeLiveGuest(String uuid);

        /**
         * The account which a virtual host belongs to.
         *
         * @see SoftLayer_Virtual_Host::getAccount
         */
        @ApiMethod(instanceRequired = true)
        public Account getAccount();

        /**
         * Boolean flag indicating whether this virtualization platform gets billed per guest rather than at a fixed rate.
         *
         * @see SoftLayer_Virtual_Host::getBilledPerGuestFlag
         */
        @ApiMethod(instanceRequired = true)
        public Boolean getBilledPerGuestFlag();

        /**
         * Boolean flag indicating whether this virtualization platform gets billed per memory usage rather than at a fixed rate.
         *
         * @see SoftLayer_Virtual_Host::getBilledPerMemoryUsageFlag
         */
        @ApiMethod(instanceRequired = true)
        public Boolean getBilledPerMemoryUsageFlag();

        /**
         * The guests associated with a virtual host.
         *
         * @see SoftLayer_Virtual_Host::getGuests
         */
        @ApiMethod(instanceRequired = true)
        public List getGuests();

        /**
         * The hardware record which a virtual host resides on.
         *
         * @see SoftLayer_Virtual_Host::getHardware
         */
        @ApiMethod(instanceRequired = true)
        public Server getHardware();

        /**
         * The metric tracking object for this virtual host.
         *
         * @see SoftLayer_Virtual_Host::getMetricTrackingObject
         */
        @ApiMethod(instanceRequired = true)
        public Object getMetricTrackingObject();

        /**
         * @see SoftLayer_Virtual_Host::getPciDevices
         */
        @ApiMethod(instanceRequired = true)
        public List getPciDevices();

    }

    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#getLiveGuestByUuid}
         */
        public Future getLiveGuestByUuid(String uuid);

        public Future getLiveGuestByUuid(String uuid, ResponseHandler callback);

        /**
         * Async version of {@link Service#getLiveGuestList}
         */
        public Future> getLiveGuestList();

        public Future getLiveGuestList(ResponseHandler> callback);

        /**
         * Async version of {@link Service#getLiveGuestRecentMetricData}
         */
        public Future> getLiveGuestRecentMetricData(String uuid, Long time, Long limit, Long interval);

        public Future getLiveGuestRecentMetricData(String uuid, Long time, Long limit, Long interval, ResponseHandler> callback);

        /**
         * Async version of {@link Service#getObject}
         */
        public Future getObject();

        public Future getObject(ResponseHandler callback);

        /**
         * Async version of {@link Service#pauseLiveGuest}
         */
        public Future pauseLiveGuest(String uuid);

        public Future pauseLiveGuest(String uuid, ResponseHandler callback);

        /**
         * Async version of {@link Service#powerCycleLiveGuest}
         */
        public Future powerCycleLiveGuest(String uuid);

        public Future powerCycleLiveGuest(String uuid, ResponseHandler callback);

        /**
         * Async version of {@link Service#powerOffLiveGuest}
         */
        public Future powerOffLiveGuest(String uuid);

        public Future powerOffLiveGuest(String uuid, ResponseHandler callback);

        /**
         * Async version of {@link Service#powerOnLiveGuest}
         */
        public Future powerOnLiveGuest(String uuid);

        public Future powerOnLiveGuest(String uuid, ResponseHandler callback);

        /**
         * Async version of {@link Service#rebootSoftLiveGuest}
         */
        public Future rebootSoftLiveGuest(String uuid);

        public Future rebootSoftLiveGuest(String uuid, ResponseHandler callback);

        /**
         * Async version of {@link Service#resumeLiveGuest}
         */
        public Future resumeLiveGuest(String uuid);

        public Future resumeLiveGuest(String uuid, 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#getBilledPerGuestFlag}
         */
        public Future getBilledPerGuestFlag();

        /**
         * Async callback version of {@link Service#getBilledPerGuestFlag}
         */
        public Future getBilledPerGuestFlag(ResponseHandler callback);

        /**
         * Async version of {@link Service#getBilledPerMemoryUsageFlag}
         */
        public Future getBilledPerMemoryUsageFlag();

        /**
         * Async callback version of {@link Service#getBilledPerMemoryUsageFlag}
         */
        public Future getBilledPerMemoryUsageFlag(ResponseHandler callback);

        /**
         * Async version of {@link Service#getGuests}
         */
        public Future> getGuests();

        /**
         * Async callback version of {@link Service#getGuests}
         */
        public Future getGuests(ResponseHandler> callback);

        /**
         * Async version of {@link Service#getHardware}
         */
        public Future getHardware();

        /**
         * Async callback version of {@link Service#getHardware}
         */
        public Future getHardware(ResponseHandler callback);

        /**
         * Async version of {@link Service#getMetricTrackingObject}
         */
        public Future getMetricTrackingObject();

        /**
         * Async callback version of {@link Service#getMetricTrackingObject}
         */
        public Future getMetricTrackingObject(ResponseHandler callback);

        /**
         * Async version of {@link Service#getPciDevices}
         */
        public Future> getPciDevices();

        /**
         * Async callback version of {@link Service#getPciDevices}
         */
        public Future getPciDevices(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 Mask billedPerGuestFlag() {
            withLocalProperty("billedPerGuestFlag");
            return this;
        }

        public Mask billedPerMemoryUsageFlag() {
            withLocalProperty("billedPerMemoryUsageFlag");
            return this;
        }

        public Guest.Mask guests() {
            return withSubMask("guests", Guest.Mask.class);
        }

        public com.softlayer.api.service.hardware.Server.Mask hardware() {
            return withSubMask("hardware", com.softlayer.api.service.hardware.Server.Mask.class);
        }

        public com.softlayer.api.service.metric.tracking.Object.Mask metricTrackingObject() {
            return withSubMask("metricTrackingObject", com.softlayer.api.service.metric.tracking.Object.Mask.class);
        }

        public com.softlayer.api.service.virtual.host.PciDevice.Mask pciDevices() {
            return withSubMask("pciDevices", com.softlayer.api.service.virtual.host.PciDevice.Mask.class);
        }

        public Mask accountId() {
            withLocalProperty("accountId");
            return this;
        }

        public Mask createDate() {
            withLocalProperty("createDate");
            return this;
        }

        public Mask description() {
            withLocalProperty("description");
            return this;
        }

        public Mask enabledFlag() {
            withLocalProperty("enabledFlag");
            return this;
        }

        public Mask hardwareId() {
            withLocalProperty("hardwareId");
            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 physicalMemoryCapacity() {
            withLocalProperty("physicalMemoryCapacity");
            return this;
        }

        public Mask uuid() {
            withLocalProperty("uuid");
            return this;
        }

        public Mask guestCount() {
            withLocalProperty("guestCount");
            return this;
        }

        public Mask pciDeviceCount() {
            withLocalProperty("pciDeviceCount");
            return this;
        }

    }

}