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

com.softlayer.api.service.monitoring.Agent Maven / Gradle / Ivy

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

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.Hardware;
import com.softlayer.api.service.configuration.Template;
import com.softlayer.api.service.configuration.template.section.Profile;
import com.softlayer.api.service.container.metric.data.Type;
import com.softlayer.api.service.container.monitoring.graph.Outputs;
import com.softlayer.api.service.metric.tracking.object.Data;
import com.softlayer.api.service.monitoring.agent.Status;
import com.softlayer.api.service.monitoring.agent.configuration.Value;
import com.softlayer.api.service.notification.user.Subscriber;
import com.softlayer.api.service.product.Item;
import com.softlayer.api.service.provisioning.version1.Transaction;
import com.softlayer.api.service.software.Description;
import com.softlayer.api.service.user.Customer;
import com.softlayer.api.service.virtual.Guest;
import java.util.ArrayList;
import java.util.GregorianCalendar;
import java.util.List;
import java.util.concurrent.Future;

/**
 * A monitoring agent object contains information describing the agent. 
 *
 * @see SoftLayer_Monitoring_Agent
 */
@ApiType("SoftLayer_Monitoring_Agent")
public class Agent extends Entity {

    /**
     * The current status of the corresponding agent
     */
    @ApiProperty
    protected Status agentStatus;

    public Status getAgentStatus() {
        return agentStatus;
    }

    public void setAgentStatus(Status agentStatus) {
        this.agentStatus = agentStatus;
    }

    /**
     * All custom configuration profiles associated with the corresponding agent
     */
    @ApiProperty
    protected List configurationProfiles;

    public List getConfigurationProfiles() {
        if (configurationProfiles == null) {
            configurationProfiles = new ArrayList();
        }
        return configurationProfiles;
    }

    /**
     * A template of an agent's current configuration which contains information about the structure of the configuration values.
     */
    @ApiProperty
    protected Template configurationTemplate;

    public Template getConfigurationTemplate() {
        return configurationTemplate;
    }

    public void setConfigurationTemplate(Template configurationTemplate) {
        this.configurationTemplate = configurationTemplate;
    }

    /**
     * The values associated with the corresponding Agent configuration.
     */
    @ApiProperty
    protected List configurationValues;

    public List getConfigurationValues() {
        if (configurationValues == null) {
            configurationValues = new ArrayList();
        }
        return configurationValues;
    }

    /**
     * SoftLayer hardware related to the agent.
     */
    @ApiProperty
    protected Hardware hardware;

    public Hardware getHardware() {
        return hardware;
    }

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

    /**
     * Contains general information relating to a single SoftLayer product.
     */
    @ApiProperty
    protected Item productItem;

    public Item getProductItem() {
        return productItem;
    }

    public void setProductItem(Item productItem) {
        this.productItem = productItem;
    }

    /**
     * A description for a specific installation of a Software Component
     */
    @ApiProperty
    protected Description softwareDescription;

    public Description getSoftwareDescription() {
        return softwareDescription;
    }

    public void setSoftwareDescription(Description softwareDescription) {
        this.softwareDescription = softwareDescription;
    }

    /**
     * Monitoring agent status name.
     */
    @ApiProperty
    protected String statusName;

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    /**
     * Softlayer_Virtual_Guest object related to the monitoring agent, which this virtual guest object and hardware is on the server of the running agent.
     */
    @ApiProperty
    protected Guest virtualGuest;

    public Guest getVirtualGuest() {
        return virtualGuest;
    }

    public void setVirtualGuest(Guest virtualGuest) {
        this.virtualGuest = virtualGuest;
    }

    /**
     * Internal identifier of a configuration template that is used to configure this agent
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long configurationTemplateId;

    public Long getConfigurationTemplateId() {
        return configurationTemplateId;
    }

    public void setConfigurationTemplateId(Long configurationTemplateId) {
        configurationTemplateIdSpecified = true;
        this.configurationTemplateId = configurationTemplateId;
    }

    protected boolean configurationTemplateIdSpecified;

    public boolean isConfigurationTemplateIdSpecified() {
        return configurationTemplateIdSpecified;
    }

    public void unsetConfigurationTemplateId() {
        configurationTemplateId = null;
        configurationTemplateIdSpecified = false;
    }

    /**
     * Created date
     */
    @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;
    }

    /**
     * Internal identifier of a monitoring agent
     */
    @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;
    }

    /**
     * Last modified date
     */
    @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;
    }

    /**
     * Monitoring agent 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;
    }

    /**
     * Indicates if this monitoring agent resides on your local box or on a SoftLayer monitoring cluster.
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Boolean remoteMonitoringAgentFlag;

    public Boolean getRemoteMonitoringAgentFlag() {
        return remoteMonitoringAgentFlag;
    }

    public void setRemoteMonitoringAgentFlag(Boolean remoteMonitoringAgentFlag) {
        remoteMonitoringAgentFlagSpecified = true;
        this.remoteMonitoringAgentFlag = remoteMonitoringAgentFlag;
    }

    protected boolean remoteMonitoringAgentFlagSpecified;

    public boolean isRemoteMonitoringAgentFlagSpecified() {
        return remoteMonitoringAgentFlagSpecified;
    }

    public void unsetRemoteMonitoringAgentFlag() {
        remoteMonitoringAgentFlag = null;
        remoteMonitoringAgentFlagSpecified = false;
    }

    /**
     * Internal identifier of a monitoring robot that this agent belongs to
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long robotId;

    public Long getRobotId() {
        return robotId;
    }

    public void setRobotId(Long robotId) {
        robotIdSpecified = true;
        this.robotId = robotId;
    }

    protected boolean robotIdSpecified;

    public boolean isRobotIdSpecified() {
        return robotIdSpecified;
    }

    public void unsetRobotId() {
        robotId = null;
        robotIdSpecified = false;
    }

    /**
     * Internal identifier of a monitoring agent status
     */
    @ApiProperty(canBeNullOrNotSet = true)
    protected Long statusId;

    public Long getStatusId() {
        return statusId;
    }

    public void setStatusId(Long statusId) {
        statusIdSpecified = true;
        this.statusId = statusId;
    }

    protected boolean statusIdSpecified;

    public boolean isStatusIdSpecified() {
        return statusIdSpecified;
    }

    public void unsetStatusId() {
        statusId = null;
        statusIdSpecified = false;
    }

    /**
     * A count of all custom configuration profiles associated with the corresponding agent
     */
    @ApiProperty
    protected Long configurationProfileCount;

    public Long getConfigurationProfileCount() {
        return configurationProfileCount;
    }

    public void setConfigurationProfileCount(Long configurationProfileCount) {
        this.configurationProfileCount = configurationProfileCount;
    }

    /**
     * A count of the values associated with the corresponding Agent configuration.
     */
    @ApiProperty
    protected Long configurationValueCount;

    public Long getConfigurationValueCount() {
        return configurationValueCount;
    }

    public void setConfigurationValueCount(Long configurationValueCount) {
        this.configurationValueCount = configurationValueCount;
    }

    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 monitoring agent is a program that resides on a server and does the work of getting details of a system or application and reporting of the metric data and triggers alarms for predefined events. 
     *
     * @see SoftLayer_Monitoring_Agent
     */
    @com.softlayer.api.annotation.ApiService("SoftLayer_Monitoring_Agent")
    public static interface Service extends com.softlayer.api.Service {

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

        /**
         * This method activates a SoftLayer_Monitoring_Agent.
         *
         * @see SoftLayer_Monitoring_Agent::activate
         */
        @ApiMethod(instanceRequired = true)
        public Boolean activate();

        /**
         * This method is used to apply changes to a monitoring agent's configuration for SoftLayer_Configuration_Template_Section with the property sectionType that has a keyName of 'TEMPLATE_SECTION'. Configuration values that are passed in can be new or updated objects but must have a definitionId and profileId defined for both. Existing SoftLayer_Monitoring_Agent_Configuration_Value values can be retrieved as a property of the SoftLayer_Configuration_Template_Section_Definition's from the monitoring agent's configurationTemplate property. New values will follow the structure of SoftLayer_Monitoring_Agent_Configuration_Value. It returns a SoftLayer_Provisioning_Version1_Transaction object to track the progress of the update being applied. Some configuration sections act as a template which helps to create additional monitoring configurations. For instance, Core Resource monitoring agent lets you create monitoring configurations for different disk volumes or disk path. 
         *
         * @see SoftLayer_Monitoring_Agent::addConfigurationProfile
         */
        @ApiMethod(instanceRequired = true)
        public Transaction addConfigurationProfile(List configurationValues);

        /**
         * This method creates a transaction used to apply changes to a monitoring agent's configuration for an array of SoftLayer_Configuration_Template_Section that have the property sectionType with a name of 'Fixed section'. Configuration values that are passed in can be new or updated objects but must have a configurationDefinitionId defined for both. Existing SoftLayer_Monitoring_Agent_Configuration_Value values can be retrieved as a property of the SoftLayer_Configuration_Template_Section_Definition from the monitoring agent's configurationTemplate property. New values will follow the structure of SoftLayer_Monitoring_Agent_Configuration_Value. This method returns a SoftLayer_Provisioning_Version1_Transaction object to track the progress of the update being applied. 
         *
         * @see SoftLayer_Monitoring_Agent::applyConfigurationValues
         */
        @ApiMethod(instanceRequired = true)
        public Transaction applyConfigurationValues(List configurationValues);

        /**
         * This method will deactivate the monitoring agent, preventing it from generating any further alarms. 
         *
         * @see SoftLayer_Monitoring_Agent::deactivate
         */
        @ApiMethod(instanceRequired = true)
        public Boolean deactivate();

        /**
         * This method will remove a SoftLayer_Configuration_Template_Section_Profile from a SoftLayer_Configuration_Template_Section by passing in the sectionId of the profile object and identifier of the profile. This will execute the action immediately on the server and the SoftLayer_Configuration_Template_Section returning a boolean true if successful. 
         *
         * @see SoftLayer_Monitoring_Agent::deleteConfigurationProfile
         */
        @ApiMethod(instanceRequired = true)
        public Boolean deleteConfigurationProfile(Long sectionId, Long profileId);

        /**
         * Initialize a monitoring agent and deploy it with the SoftLayer_Configuration_Template with the same identifier as the $configurationTemplateId parameter. If the configuration template ID is not provided, the current configuration template will be used. When executing this method, the existing configuration values will be lost. If no configuration template identifier is provided, the current configuration template will be used. '''Warning''' Reporting data may be lost as a result of executing this method. 
         *
         * @see SoftLayer_Monitoring_Agent::deployMonitoringAgent
         */
        @ApiMethod(instanceRequired = true)
        public Transaction deployMonitoringAgent(Long configurationTemplateId);

        /**
         * This method retrieves an array of SoftLayer_Notification_User_Subscriber objects belonging to the SoftLayer_Monitoring_Agent which are able to receive alarm notifications. 
         *
         * @see SoftLayer_Monitoring_Agent::getActiveAlarmSubscribers
         */
        @ApiMethod(instanceRequired = true)
        public List getActiveAlarmSubscribers();

        /**
         * This method returns an array of available SoftLayer_Configuration_Template objects for this monitoring agent. 
         *
         * @see SoftLayer_Monitoring_Agent::getAvailableConfigurationTemplates
         */
        @ApiMethod(instanceRequired = true)
        public List