Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[CLOUDSTACK-9846] create column to save the content of alert messages
Remove declaration of throws CloudRuntimeException
I also removed some unused variables and comments left behind

This closes #837
  • Loading branch information
rafaelweingartner committed Mar 13, 2018
commit cec82f6a9ac485ee65e76bc31518ba493ce59119
2 changes: 2 additions & 0 deletions api/src/main/java/com/cloud/alert/Alert.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,6 @@ public interface Alert extends Identity, InternalIdentity {
boolean getArchived();

String getName();

String getContent();
}
23 changes: 4 additions & 19 deletions api/src/main/java/com/cloud/resource/ResourceService.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@

import java.util.List;

import com.cloud.exception.AgentUnavailableException;
import com.cloud.utils.exception.CloudRuntimeException;
import com.cloud.dc.DataCenter;
import org.apache.cloudstack.api.command.admin.cluster.AddClusterCmd;
import org.apache.cloudstack.api.command.admin.cluster.DeleteClusterCmd;
import org.apache.cloudstack.api.command.admin.host.AddHostCmd;
Expand All @@ -31,6 +28,8 @@
import org.apache.cloudstack.api.command.admin.host.UpdateHostCmd;
import org.apache.cloudstack.api.command.admin.host.UpdateHostPasswordCmd;

import com.cloud.dc.DataCenter;
import com.cloud.exception.AgentUnavailableException;
import com.cloud.exception.DiscoveryException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.exception.ResourceInUseException;
Expand All @@ -43,25 +42,17 @@ public interface ResourceService {
/**
* Updates a host
*
* @param cmd
* - the command specifying hostId
* @return hostObject
* @throws NoTransitionException
* @param cmd - the command specifying hostId
*/
Host updateHost(UpdateHostCmd cmd) throws NoTransitionException;

Host cancelMaintenance(CancelMaintenanceCmd cmd);

Host reconnectHost(ReconnectHostCmd cmd) throws CloudRuntimeException, AgentUnavailableException;
Host reconnectHost(ReconnectHostCmd cmd) throws AgentUnavailableException;

/**
* We will automatically create an Apache CloudStack cluster to attach to the external cluster and return a hyper host to perform
* host related operation within the cluster
*
* @param cmd
* @return
* @throws IllegalArgumentException
* @throws DiscoveryException
*/
List<? extends Cluster> discoverCluster(AddClusterCmd cmd) throws IllegalArgumentException, DiscoveryException, ResourceInUseException;

Expand All @@ -77,12 +68,6 @@ public interface ResourceService {

/**
* Deletes a host
*
* @param hostId
* TODO
* @param isForced
* TODO
*
* @param true if deleted, false otherwise
*/
boolean deleteHost(long hostId, boolean isForced, boolean isForceDeleteStorage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
// under the License.
package org.apache.cloudstack.api.command.admin.host;

import com.cloud.exception.AgentUnavailableException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.utils.exception.CloudRuntimeException;
import org.apache.log4j.Logger;

import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiCommandJobType;
import org.apache.cloudstack.api.ApiConstants;
Expand All @@ -30,13 +25,16 @@
import org.apache.cloudstack.api.ServerApiException;
import org.apache.cloudstack.api.response.HostResponse;
import org.apache.cloudstack.context.CallContext;
import org.apache.log4j.Logger;

import com.cloud.event.EventTypes;
import com.cloud.exception.AgentUnavailableException;
import com.cloud.exception.InvalidParameterValueException;
import com.cloud.host.Host;
import com.cloud.user.Account;
import com.cloud.utils.exception.CloudRuntimeException;

@APICommand(name = "reconnectHost", description = "Reconnects a host.", responseObject = HostResponse.class,
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
@APICommand(name = "reconnectHost", description = "Reconnects a host.", responseObject = HostResponse.class, requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
public class ReconnectHostCmd extends BaseAsyncCmd {
public static final Logger s_logger = Logger.getLogger(ReconnectHostCmd.class.getName());

Expand Down Expand Up @@ -103,17 +101,15 @@ public Long getInstanceId() {
@Override
public void execute() {
try {
Host result =_resourceService.reconnectHost(this);
Host result = _resourceService.reconnectHost(this);
HostResponse response = _responseGenerator.createHostResponse(result);
response.setResponseName(getCommandName());
this.setResponseObject(response);
}catch (InvalidParameterValueException e) {
} catch (InvalidParameterValueException e) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, e.getMessage());
}
catch (CloudRuntimeException e) {
s_logger.warn("Exception: ", e);
} catch (CloudRuntimeException e) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
}catch (AgentUnavailableException e) {
} catch (AgentUnavailableException e) {
throw new ServerApiException(ApiErrorCode.RESOURCE_UNAVAILABLE_ERROR, e.getMessage());
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
// under the License.
package com.cloud.agent;

import com.cloud.utils.exception.CloudRuntimeException;
import org.apache.cloudstack.framework.config.ConfigKey;

import com.cloud.agent.api.Answer;
Expand All @@ -37,7 +36,7 @@
*/
public interface AgentManager {
static final ConfigKey<Integer> Wait = new ConfigKey<Integer>("Advanced", Integer.class, "wait", "1800", "Time in seconds to wait for control commands to return",
true);
true);

public enum TapAgentsAction {
Add, Del, Contains,
Expand Down Expand Up @@ -144,7 +143,7 @@ public enum TapAgentsAction {

public void pullAgentOutMaintenance(long hostId);

void reconnect(long hostId) throws CloudRuntimeException, AgentUnavailableException;
void reconnect(long hostId) throws AgentUnavailableException;

void rescan();

Expand Down
Loading