Create new generic method for resource UUID obtention in event's descriptions (#12502)

This commit is contained in:
Erik Böck 2026-02-05 07:23:40 -03:00 committed by GitHub
parent a5b6bc3be6
commit e32d08e50e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
364 changed files with 770 additions and 623 deletions

View File

@ -27,6 +27,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.regex.Pattern;
import javax.inject.Inject;
@ -498,4 +499,14 @@ public abstract class BaseCmd {
}
return details;
}
public String getResourceUuid(String parameterName) {
UUID resourceUuid = CallContext.current().getApiResourceUuid(parameterName);
if (resourceUuid != null) {
return resourceUuid.toString();
}
return null;
}
}

View File

@ -177,7 +177,7 @@ public class CreateAccountCmd extends BaseCmd {
@Override
public void execute() {
validateParams();
CallContext.current().setEventDetails("Account Name: " + getUsername() + ", Domain Id:" + getDomainId());
CallContext.current().setEventDetails("Account Name: " + getUsername() + ", Domain ID:" + getResourceUuid(ApiConstants.DOMAIN_ID));
UserAccount userAccount =
_accountService.createUserAccount(this);
if (userAccount != null) {

View File

@ -108,12 +108,20 @@ public class DisableAccountCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Disabling Account: " + getAccountName() + " in domain: " + getDomainId();
String message = "Disabling Account ";
if (getId() != null) {
message += "with ID: " + getResourceUuid(ApiConstants.ID);
} else {
message += getAccountName() + " in Domain: " + getResourceUuid(ApiConstants.DOMAIN_ID);
}
return message;
}
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
CallContext.current().setEventDetails("Account Name: " + getAccountName() + ", Domain Id:" + getDomainId());
CallContext.current().setEventDetails("Account Name: " + getAccountName() + ", Domain Id:" + getResourceUuid(ApiConstants.DOMAIN_ID));
Account result = _regionService.disableAccount(this);
if (result != null){
AccountResponse response = _responseGenerator.createAccountResponse(ResponseView.Full, result);

View File

@ -81,7 +81,7 @@ public class CreateRolePermissionCmd extends BaseRolePermissionCmd {
if (role == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid role id provided");
}
CallContext.current().setEventDetails("Role id: " + role.getId() + ", rule:" + getRule() + ", permission: " + getPermission() + ", description: " + getDescription());
CallContext.current().setEventDetails("Role ID: " + role.getUuid() + ", rule:" + getRule() + ", permission: " + getPermission() + ", description: " + getDescription());
final RolePermission rolePermission = roleService.createRolePermission(role, getRule(), getPermission(), getDescription());
if (rolePermission == null) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create role permission");

View File

@ -70,7 +70,7 @@ public class DeleteRoleCmd extends BaseCmd {
if (role == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Cannot find the role with provided id");
}
CallContext.current().setEventDetails("Role id: " + role.getId());
CallContext.current().setEventDetails("Role ID: " + role.getUuid());
boolean result = roleService.deleteRole(role);
SuccessResponse response = new SuccessResponse(getCommandName());
response.setSuccess(result);

View File

@ -68,7 +68,7 @@ public class DeleteRolePermissionCmd extends BaseCmd {
if (rolePermission == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid role permission id provided");
}
CallContext.current().setEventDetails("Role permission id: " + rolePermission.getId());
CallContext.current().setEventDetails("Role permission ID: " + rolePermission.getUuid());
boolean result = roleService.deleteRolePermission(rolePermission);
SuccessResponse response = new SuccessResponse(getCommandName());
response.setSuccess(result);

View File

@ -55,7 +55,7 @@ public class DisableRoleCmd extends BaseCmd {
if (role == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Cannot find the role with provided id");
}
CallContext.current().setEventDetails("Role id: " + role.getId());
CallContext.current().setEventDetails("Role ID: " + role.getUuid());
boolean result = roleService.disableRole(role);
SuccessResponse response = new SuccessResponse(getCommandName());
response.setSuccess(result);

View File

@ -55,7 +55,7 @@ public class EnableRoleCmd extends BaseCmd {
if (role == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Cannot find the role with provided id");
}
CallContext.current().setEventDetails("Role id: " + role.getId());
CallContext.current().setEventDetails("Role ID: " + role.getUuid());
boolean result = roleService.enableRole(role);
SuccessResponse response = new SuccessResponse(getCommandName());
response.setSuccess(result);

View File

@ -111,7 +111,7 @@ public class UpdateRolePermissionCmd extends BaseCmd {
if (getRuleId() != null || getRulePermission() != null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Parameters permission and ruleid must be mutually exclusive with ruleorder");
}
CallContext.current().setEventDetails("Reordering permissions for role id: " + role.getId());
CallContext.current().setEventDetails("Reordering permissions for role with ID: " + role.getUuid());
final List<RolePermission> rolePermissionsOrder = new ArrayList<>();
for (Long rolePermissionId : getRulePermissionOrder()) {
final RolePermission rolePermission = roleService.findRolePermission(rolePermissionId);
@ -129,7 +129,7 @@ public class UpdateRolePermissionCmd extends BaseCmd {
if (rolePermission == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid rule id provided");
}
CallContext.current().setEventDetails("Updating permission for rule id: " + getRuleId() + " to: " + getRulePermission().toString());
CallContext.current().setEventDetails("Updating permission for rule with ID: " + getResourceUuid(ApiConstants.RULE_ID) + " to: " + getRulePermission().toString());
result = roleService.updateRolePermission(role, rolePermission, getRulePermission());
}
SuccessResponse response = new SuccessResponse(getCommandName());

View File

@ -72,7 +72,7 @@ public class CreateProjectRolePermissionCmd extends BaseRolePermissionCmd {
if (projectRole == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid project role ID provided");
}
CallContext.current().setEventDetails("Project Role ID: " + projectRole.getId() + ", Rule:" + getRule() + ", Permission: " + getPermission() + ", Description: " + getDescription());
CallContext.current().setEventDetails("Project Role ID: " + projectRole.getUuid() + ", Rule:" + getRule() + ", Permission: " + getPermission() + ", Description: " + getDescription());
final ProjectRolePermission projectRolePermission = projRoleService.createProjectRolePermission(this);
if (projectRolePermission == null) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create project role permission");

View File

@ -69,7 +69,7 @@ public class DeleteProjectRoleCmd extends BaseCmd {
if (role == null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Cannot find project role with provided id");
}
CallContext.current().setEventDetails("Deleting Project Role with id: " + role.getId());
CallContext.current().setEventDetails("Deleting Project Role with ID: " + role.getUuid());
boolean result = projRoleService.deleteProjectRole(role, getProjectId());
SuccessResponse response = new SuccessResponse(getCommandName());
response.setSuccess(result);

View File

@ -70,7 +70,7 @@ public class DeleteProjectRolePermissionCmd extends BaseCmd {
if (rolePermission == null || rolePermission.getProjectId() != getProjectId()) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid role permission id provided for the project");
}
CallContext.current().setEventDetails("Deleting Project Role permission with id: " + rolePermission.getId());
CallContext.current().setEventDetails("Deleting Project Role permission with ID: " + rolePermission.getUuid());
boolean result = projRoleService.deleteProjectRolePermission(rolePermission);
SuccessResponse response = new SuccessResponse();
response.setSuccess(result);

View File

@ -115,7 +115,7 @@ public class UpdateProjectRolePermissionCmd extends BaseCmd {
if (getProjectRuleId() != null || getProjectRolePermission() != null) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Parameters permission and ruleid must be mutually exclusive with ruleorder");
}
CallContext.current().setEventDetails("Reordering permissions for role id: " + projectRole.getId());
CallContext.current().setEventDetails("Reordering permissions for role with ID: " + projectRole.getUuid());
result = updateProjectRolePermissionOrder(projectRole);
} else if (getProjectRuleId() != null || getProjectRolePermission() != null ) {
@ -123,7 +123,7 @@ public class UpdateProjectRolePermissionCmd extends BaseCmd {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Parameters permission and ruleid must be mutually exclusive with ruleorder");
}
ProjectRolePermission rolePermission = getValidProjectRolePermission();
CallContext.current().setEventDetails("Updating project role permission for rule id: " + getProjectRuleId() + " to: " + getProjectRolePermission().toString());
CallContext.current().setEventDetails("Updating project role permission for rule ID: " + getProjectRuleId() + " to: " + getProjectRolePermission().toString());
result = projRoleService.updateProjectRolePermission(projectId, projectRole, rolePermission, getProjectRolePermission());
}
SuccessResponse response = new SuccessResponse(getCommandName());

View File

@ -97,7 +97,7 @@ public class CreateCounterCmd extends BaseAsyncCreateCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Counter ID: " + getEntityId());
CallContext.current().setEventDetails("Counter ID: " + getEntityUuid());
Counter ctr = _autoScaleService.getCounter(getEntityId());
CounterResponse response = _responseGenerator.createCounterResponse(ctr);
response.setResponseName(getCommandName());

View File

@ -91,6 +91,6 @@ public class DeleteCounterCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting a counter.";
return "Deleting auto scaling counter with ID: " + getResourceUuid(ApiConstants.ID);
}
}

View File

@ -156,6 +156,6 @@ public class ImportBackupOfferingCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Importing backup offering: " + name + " (external ID: " + externalId + ") on zone ID " + zoneId ;
return "Importing backup offering: " + name + " (external ID: " + externalId + ") on zone with ID: " + getResourceUuid(ApiConstants.ZONE_ID) ;
}
}

View File

@ -149,6 +149,6 @@ public class IssueCertificateCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "issuing certificate for domain(s)=" + domains + ", ip(s)=" + addresses;
return "Issuing certificate for domain(s)=" + domains + ", ip(s)=" + addresses;
}
}

View File

@ -108,7 +108,7 @@ public class ProvisionCertificateCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Provisioning certificate for host id=" + hostId + " using provider=" + provider;
return "Provisioning certificate for host with ID: " + getResourceUuid(ApiConstants.HOST_ID) + " using provider: " + provider;
}
@Override

View File

@ -142,6 +142,6 @@ public class ExecuteClusterDrsPlanCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return String.format("Executing DRS plan for cluster: %d", getId());
return "Executing DRS plan for cluster with ID: " + getResourceUuid(ApiConstants.ID);
}
}

View File

@ -140,7 +140,7 @@ public class GetDiagnosticsDataCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Getting diagnostics data files from System VM: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
return "Getting diagnostics data files from System Instance with ID: " + getResourceUuid(ApiConstants.TARGET_ID);
}
@Override

View File

@ -153,7 +153,7 @@ public class RunDiagnosticsCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Executing diagnostics on System VM: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
return "Executing diagnostics on System Instance with ID: " + getResourceUuid(ApiConstants.TARGET_ID);
}
@Override

View File

@ -86,7 +86,7 @@ public class CreateDomainCmd extends BaseCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Domain Name: " + getDomainName() + ((getParentDomainId() != null) ? ", Parent DomainId :" + getParentDomainId() : ""));
CallContext.current().setEventDetails("Domain Name: " + getDomainName() + ((getParentDomainId() != null) ? ", Parent Domain ID:" + getResourceUuid(ApiConstants.PARENT_DOMAIN_ID) : ""));
Domain domain = _domainService.createDomain(getDomainName(), getParentDomainId(), getNetworkDomain(), getDomainUUID());
if (domain != null) {
DomainResponse response = _responseGenerator.createDomainResponse(domain);

View File

@ -88,12 +88,12 @@ public class DeleteDomainCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting domain: " + getId();
return "Deleting domain with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
public void execute() {
CallContext.current().setEventDetails("Domain Id: " + getId());
CallContext.current().setEventDetails("Domain ID: " + getResourceUuid(ApiConstants.ID));
boolean result = _regionService.deleteDomain(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());

View File

@ -82,7 +82,7 @@ public class UpdateDomainCmd extends BaseCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Domain Id: " + getId());
CallContext.current().setEventDetails("Domain ID: " + getResourceUuid(ApiConstants.ID));
Domain domain = _regionService.updateDomain(this);
if (domain != null) {

View File

@ -46,7 +46,7 @@ public class DiscoverGpuDevicesCmd extends BaseListCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Discovering GPU Devices on host id: " + getId());
CallContext.current().setEventDetails("Discovering GPU Devices on host with ID: " + getResourceUuid(ApiConstants.ID));
ListResponse<GpuDeviceResponse> response = gpuService.discoverGpuDevices(this);
response.setResponseName(getCommandName());
setResponseObject(response);

View File

@ -120,7 +120,7 @@ public class AddGuestOsCmd extends BaseAsyncCreateCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Guest OS Id: " + getEntityId());
CallContext.current().setEventDetails("Guest OS ID: " + getEntityUuid());
GuestOS guestOs = _mgr.getAddedGuestOs(getEntityId());
if (guestOs != null) {
GuestOSResponse response = _responseGenerator.createGuestOSResponse(guestOs);

View File

@ -62,7 +62,7 @@ public class RemoveGuestOsCmd extends BaseAsyncCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Guest OS Id: " + id);
CallContext.current().setEventDetails("Guest OS ID: " + getResourceUuid(ApiConstants.ID));
boolean result = _mgr.removeGuestOs(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
@ -74,7 +74,7 @@ public class RemoveGuestOsCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Removing Guest OS: " + getId();
return "Removing Guest OS with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -62,7 +62,7 @@ public class RemoveGuestOsMappingCmd extends BaseAsyncCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Guest OS Mapping Id: " + id);
CallContext.current().setEventDetails("Guest OS Mapping ID: " + getResourceUuid(ApiConstants.ID));
boolean result = _mgr.removeGuestOsMapping(this);
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
@ -74,7 +74,7 @@ public class RemoveGuestOsMappingCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Removing Guest OS Mapping: " + getId();
return "Removing Guest OS Mapping with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -123,7 +123,7 @@ public class UpdateGuestOsCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Updating guest OS: " + getId();
return "Updating guest OS with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -86,7 +86,7 @@ public class UpdateGuestOsMappingCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Updating Guest OS Mapping: " + getId();
return "Updating Guest OS with ID: " + getResourceUuid(ApiConstants.ID) + " mapping.";
}
@Override

View File

@ -102,7 +102,7 @@ public final class ConfigureHAForHostCmd extends BaseAsyncCmd {
if (!result) {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to configure HA provider for the host");
}
CallContext.current().setEventDetails("Host Id:" + host.getId() + " HA configured with provider: " + getHaProvider());
CallContext.current().setEventDetails("Host ID:" + host.getUuid() + " HA configured with provider: " + getHaProvider());
CallContext.current().putContextParameter(Host.class, host.getUuid());
setupResponse(result, host.getUuid());
@ -115,6 +115,6 @@ public final class ConfigureHAForHostCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Configure HA for host: " + getHostId();
return "Configuring HA for host with ID: " + getResourceUuid(ApiConstants.HOST_ID);
}
}

View File

@ -89,7 +89,7 @@ public final class DisableHAForClusterCmd extends BaseAsyncCmd {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to find cluster by ID: " + getClusterId());
}
final boolean result = haConfigManager.disableHA(cluster);
CallContext.current().setEventDetails("Cluster Id:" + cluster.getId() + " HA enabled: false");
CallContext.current().setEventDetails("Cluster ID:" + cluster.getUuid() + " HA enabled: false");
CallContext.current().putContextParameter(Cluster.class, cluster.getUuid());
setupResponse(result);
@ -102,7 +102,7 @@ public final class DisableHAForClusterCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Disable HA for cluster: " + getClusterId();
return "Disabling HA for cluster with ID: " + getResourceUuid(ApiConstants.CLUSTER_ID);
}
}

View File

@ -91,7 +91,7 @@ public final class DisableHAForHostCmd extends BaseAsyncCmd {
}
final boolean result = haConfigManager.disableHA(host.getId(), HAResource.ResourceType.Host);
CallContext.current().setEventDetails("Host Id:" + host.getId() + " HA enabled: false");
CallContext.current().setEventDetails("Host ID:" + host.getUuid() + " HA enabled: false");
CallContext.current().putContextParameter(Host.class, host.getUuid());
setupResponse(result, host.getUuid());
@ -104,6 +104,6 @@ public final class DisableHAForHostCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Disable HA for host: " + getHostId();
return "Disabling HA for host with ID: " + getResourceUuid(ApiConstants.HOST_ID);
}
}

View File

@ -90,7 +90,7 @@ public final class DisableHAForZoneCmd extends BaseAsyncCmd {
}
final boolean result = haConfigManager.disableHA(dataCenter);
CallContext.current().setEventDetails("Zone Id:" + dataCenter.getId() + " HA enabled: false");
CallContext.current().setEventDetails("Zone ID:" + dataCenter.getUuid() + " HA enabled: false");
CallContext.current().putContextParameter(DataCenter.class, dataCenter.getUuid());
setupResponse(result);
@ -103,7 +103,7 @@ public final class DisableHAForZoneCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Disable HA for zone: " + getZoneId();
return "Disabling HA for zone with ID: " + getResourceUuid(ApiConstants.ZONE_ID);
}
}

View File

@ -90,7 +90,7 @@ public final class EnableHAForClusterCmd extends BaseAsyncCmd {
}
final boolean result = haConfigManager.enableHA(cluster);
CallContext.current().setEventDetails("Cluster Id:" + cluster.getId() + " HA enabled: true");
CallContext.current().setEventDetails("Cluster ID:" + cluster.getUuid() + " HA enabled: true");
CallContext.current().putContextParameter(Cluster.class, cluster.getUuid());
setupResponse(result);
@ -103,6 +103,6 @@ public final class EnableHAForClusterCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Enable HA for cluster: " + getClusterId();
return "Enabling HA for cluster with ID: " + getResourceUuid(ApiConstants.CLUSTER_ID);
}
}

View File

@ -91,7 +91,7 @@ public final class EnableHAForHostCmd extends BaseAsyncCmd {
}
final boolean result = haConfigManager.enableHA(host.getId(), HAResource.ResourceType.Host);
CallContext.current().setEventDetails("Host Id:" + host.getId() + " HA enabled: true");
CallContext.current().setEventDetails("Host ID:" + host.getUuid() + " HA enabled: true");
CallContext.current().putContextParameter(Host.class, host.getUuid());
setupResponse(result, host.getUuid());
@ -104,6 +104,6 @@ public final class EnableHAForHostCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Enable HA for host: " + getHostId();
return "Enabling HA for host with ID: " + getResourceUuid(ApiConstants.HOST_ID);
}
}

View File

@ -90,7 +90,7 @@ public final class EnableHAForZoneCmd extends BaseAsyncCmd {
}
final boolean result = haConfigManager.enableHA(dataCenter);
CallContext.current().setEventDetails("Zone Id:" + dataCenter.getId() + " HA enabled: true");
CallContext.current().setEventDetails("Zone ID:" + dataCenter.getUuid() + " HA enabled: true");
CallContext.current().putContextParameter(DataCenter.class, dataCenter.getUuid());
setupResponse(result);
@ -103,7 +103,7 @@ public final class EnableHAForZoneCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Enable HA for zone: " + getZoneId();
return "Enabling HA for zone with ID: " + getResourceUuid(ApiConstants.ZONE_ID);
}
}

View File

@ -78,7 +78,7 @@ public class CancelHostAsDegradedCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "declaring host: " + getId() + " as Degraded";
return "Removing host with ID: " + getResourceUuid(ApiConstants.ID) + " from Degraded state.";
}
@Override

View File

@ -76,7 +76,7 @@ public class CancelHostMaintenanceCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Canceling maintenance for host: " + getId();
return "Canceling maintenance for host with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -78,7 +78,7 @@ public class DeclareHostAsDegradedCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "declaring host: " + getId() + " as Degraded";
return "Declaring host with ID: " + getResourceUuid(ApiConstants.ID) + " as Degraded.";
}
@Override

View File

@ -76,7 +76,7 @@ public class PrepareForHostMaintenanceCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "preparing host: " + getId() + " for maintenance";
return "Preparing host with ID: " + getResourceUuid(ApiConstants.ID) + " for maintenance.";
}
@Override

View File

@ -77,7 +77,7 @@ public class ReconnectHostCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "reconnecting host: " + getId();
return "Reconnecting host with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -72,7 +72,7 @@ public class ReleaseHostReservationCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "releasing reservation for host: " + getId();
return "Releasing reservation from host with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -84,12 +84,12 @@ public class ConfigureInternalLoadBalancerElementCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "configuring internal load balancer element: " + id;
return "Configuring internal load balancer element with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Internal load balancer element: " + id);
CallContext.current().setEventDetails("Internal load balancer element: " + getResourceUuid(ApiConstants.ID));
InternalLoadBalancerElementService service = _networkService.getInternalLoadBalancerElementById(id);
VirtualRouterProvider result = service.configureInternalLoadBalancerElement(getId(), getEnabled());
if (result != null) {

View File

@ -74,7 +74,7 @@ public class CreateInternalLoadBalancerElementCmd extends BaseAsyncCreateCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Virtual router element Id: " + getEntityId());
CallContext.current().setEventDetails("Virtual router element ID: " + getEntityUuid());
InternalLoadBalancerElementService service = _networkService.getInternalLoadBalancerElementByNetworkServiceProviderId(getNspId());
VirtualRouterProvider result = service.getInternalLoadBalancerElement(getEntityId());
if (result != null) {

View File

@ -88,7 +88,7 @@ public class StartInternalLBVMCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "starting Internal LB Instance: " + getId();
return "Starting internal LB Instance with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
@ -103,7 +103,7 @@ public class StartInternalLBVMCmd extends BaseAsyncCmd {
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Internal LB Instance ID: " + getId());
CallContext.current().setEventDetails("Internal LB Instance ID: " + getResourceUuid(ApiConstants.ID));
VirtualRouter result = null;
VirtualRouter router = _routerService.findRouter(getId());
if (router == null || router.getRole() != Role.INTERNAL_LB_VM) {

View File

@ -86,7 +86,7 @@ public class StopInternalLBVMCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Stopping Internal LB Instance: " + getId();
return "Stopping Internal LB Instance: " + getResourceUuid(ApiConstants.ID);
}
@Override
@ -105,7 +105,7 @@ public class StopInternalLBVMCmd extends BaseAsyncCmd {
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
CallContext.current().setEventDetails("Internal LB Instance Id: " + getId());
CallContext.current().setEventDetails("Internal LB Instance ID: " + getResourceUuid(ApiConstants.ID));
VirtualRouter result = null;
VirtualRouter vm = _routerService.findRouter(getId());
if (vm == null || vm.getRole() != Role.INTERNAL_LB_VM) {

View File

@ -101,7 +101,7 @@ public class AddNetworkServiceProviderCmd extends BaseAsyncCreateCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Network ServiceProvider Id: " + getEntityId());
CallContext.current().setEventDetails("Network ServiceProvider ID: " + getEntityUuid());
PhysicalNetworkServiceProvider result = _networkService.getCreatedPhysicalNetworkServiceProvider(getEntityId());
if (result != null) {
ProviderResponse response = _responseGenerator.createNetworkServiceProviderResponse(result);

View File

@ -83,7 +83,7 @@ public class CreateGuestNetworkIpv6PrefixCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Creating guest IPv6 prefix " + getPrefix() + " for zone=" + getZoneId();
return "Creating guest IPv6 prefix " + getPrefix() + " for zone with ID: " + getResourceUuid(ApiConstants.ZONE_ID);
}
@Override

View File

@ -85,7 +85,7 @@ public class CreateIpv4SubnetForGuestNetworkCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Creating guest IPv4 subnet " + getSubnet() + " in zone subnet=" + getParentId();
return "Creating guest IPv4 subnet " + getSubnet() + " in zone subnet: " + getResourceUuid(ApiConstants.PARENT_ID);
}
@Override

View File

@ -102,7 +102,7 @@ public class CreateIpv4SubnetForZoneCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Creating guest IPv4 subnet " + getSubnet() + " for zone=" + getZoneId();
return "Creating guest IPv4 subnet " + getSubnet() + " for zone: " + getResourceUuid(ApiConstants.ZONE_ID);
}
@Override

View File

@ -132,7 +132,7 @@ public class CreateManagementNetworkIpRangeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Creating management ip range from " + getStartIp() + " to " + getEndIp() + " and gateway=" + getGateWay() + ", netmask=" + getNetmask() + " of pod=" + getPodId();
return "Creating management IP range from " + getStartIp() + " to " + getEndIp() + ", with gateway: " + getGateWay() + ", netmask:" + getNetmask() + " on pod:" + getPodId();
}
@Override

View File

@ -148,7 +148,7 @@ public class CreatePhysicalNetworkCmd extends BaseAsyncCreateCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Physical Network ID: " + getEntityId());
CallContext.current().setEventDetails("Physical Network ID: " + getEntityUuid());
PhysicalNetwork result = _networkService.getCreatedPhysicalNetwork(getEntityId());
if (result != null) {
PhysicalNetworkResponse response = _responseGenerator.createPhysicalNetworkResponse(result);

View File

@ -82,7 +82,7 @@ public class DedicateIpv4SubnetForZoneCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Dedicating zone IPv4 subnet " + getId();
return "Dedicating zone's IPv4 subnet with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -63,7 +63,7 @@ public class DeleteGuestNetworkIpv6PrefixCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting guest IPv6 prefix " + getId();
return "Deleting guest IPv6 prefix with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -59,7 +59,7 @@ public class DeleteIpv4SubnetForGuestNetworkCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting guest IPv4 subnet " + getId();
return "Deleting guest IPv4 subnet with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -59,7 +59,7 @@ public class DeleteIpv4SubnetForZoneCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting zone IPv4 subnet " + getId();
return "Deleting zone IPv4 subnet with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -100,7 +100,7 @@ public class DeleteManagementNetworkIpRangeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting management ip range from " + getStartIp() + " to " + getEndIp() + " of Pod: " + getPodId();
return "Deleting management IP range from " + getStartIp() + " to " + getEndIp() + " from Pod: " + getResourceUuid(ApiConstants.POD_ID);
}
@Override

View File

@ -91,7 +91,7 @@ public class DeleteNetworkServiceProviderCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting Physical network ServiceProvider: " + getId();
return "Deleting Physical network ServiceProvider with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -65,7 +65,7 @@ public class DeletePhysicalNetworkCmd extends BaseAsyncCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Physical Network Id: " + id);
CallContext.current().setEventDetails("Physical Network Id: " + getResourceUuid(ApiConstants.ID));
boolean result = _networkService.deletePhysicalNetwork(getId());
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());
@ -77,7 +77,7 @@ public class DeletePhysicalNetworkCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting Physical network: " + getId();
return "Deleting Physical network with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -64,7 +64,7 @@ public class DeleteStorageNetworkIpRangeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting storage ip range " + getId();
return "Deleting storage IP range with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -115,7 +115,7 @@ public class MigrateNetworkCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
StringBuilder eventMsg = new StringBuilder("Migrating network: " + getId());
String description = "Migrating Network with ID: " + getResourceUuid(ApiConstants.NETWORK_ID);
if (getNetworkOfferingId() != null) {
Network network = _networkService.getNetwork(getId());
if (network == null) {
@ -128,11 +128,11 @@ public class MigrateNetworkCmd extends BaseAsyncCmd {
throw new InvalidParameterValueException("Network offering id supplied is invalid");
}
eventMsg.append(". Original network offering id: " + oldOff.getUuid() + ", new network offering id: " + newOff.getUuid());
description += ". Original Network Offering id: " + oldOff.getUuid() + ", new Network Offering id: " + newOff.getUuid();
}
}
return eventMsg.toString();
return description;
}
@Override

View File

@ -120,7 +120,7 @@ public class MigrateVPCCmd extends BaseAsyncCmd {
}
@Override
public String getEventDescription() { return "Migrating VPC : " + getId() + " to new VPC offering (" + vpcOfferingId + ")"; }
public String getEventDescription() { return "Migrating VPC with ID: " + getResourceUuid(ApiConstants.VPC_ID) + " to new VPC offering with ID: " + getResourceUuid(ApiConstants.VPC_OFF_ID);}
@Override
public String getEventType() {

View File

@ -72,7 +72,7 @@ public class ReleaseDedicatedGuestVlanRangeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Releasing a dedicated guest vlan range.";
return "Releasing dedicated guest VLAN range with ID: " + getResourceUuid(ApiConstants.ID);
}
// ///////////////////////////////////////////////////
@ -81,7 +81,7 @@ public class ReleaseDedicatedGuestVlanRangeCmd extends BaseAsyncCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Dedicated guest vlan range Id: " + id);
CallContext.current().setEventDetails("Dedicated guest VLAN range ID: " + getResourceUuid(ApiConstants.ID));
boolean result = _networkService.releaseDedicatedGuestVlanRange(getId());
if (result) {
SuccessResponse response = new SuccessResponse(getCommandName());

View File

@ -59,7 +59,7 @@ public class ReleaseDedicatedIpv4SubnetForZoneCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Releasing a dedicated zone IPv4 subnet " + getId();
return "Releasing dedicated zone IPv4 subnet with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -69,7 +69,7 @@ public class UpdateIpv4SubnetForZoneCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Updating zone IPv4 subnet " + getId();
return "Updating zone IPv4 subnet with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -100,7 +100,7 @@ public class UpdateNetworkServiceProviderCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Updating physical network ServiceProvider: " + getId();
return "Updating Physical Network ServiceProvider with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -98,7 +98,7 @@ public class UpdatePhysicalNetworkCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Updating Physical network: " + getId();
return "Updating Physical Network with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -113,7 +113,7 @@ public class UpdatePodManagementNetworkIpRangeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Updating pod management IP range " + getNewStartIP() + "-" + getNewEndIP() + " of Pod: " + getPodId();
return "Updating pod management IP range " + getNewStartIP() + "-" + getNewEndIP() + " of Pod: " + getResourceUuid(ApiConstants.POD_ID);
}
@Override

View File

@ -93,7 +93,7 @@ public class UpdateStorageNetworkIpRangeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Update storage ip range " + getId() + " [StartIp=" + getStartIp() + ", EndIp=" + getEndIp() + ", vlan=" + getVlan() + ", netmask=" + getNetmask() + ']';
return "Updating storage IP range " + getResourceUuid(ApiConstants.ID) + " [StartIp=" + getStartIp() + ", EndIp=" + getEndIp() + ", VLAN=" + getVlan() + ", netmask=" + getNetmask() + ']';
}
@Override

View File

@ -80,7 +80,7 @@ public class ChangeBgpPeersForNetworkCmd extends BaseAsyncCmd implements AdminCm
@Override
public String getEventDescription() {
return "Changing Bgp Peers for network " + getNetworkId();
return "Changing BGP Peers for Network with ID: " + getResourceUuid(ApiConstants.NETWORK_ID);
}
@Override

View File

@ -80,7 +80,7 @@ public class ChangeBgpPeersForVpcCmd extends BaseAsyncCmd implements AdminCmd {
@Override
public String getEventDescription() {
return "Changing Bgp Peers for VPC " + getVpcId();
return "Changing BGP Peers for VPC with ID: " + getResourceUuid(ApiConstants.VPC_ID);
}
@Override

View File

@ -145,7 +145,7 @@ public class CreateBgpPeerCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Creating Bgp Peer " + getAsNumber() + " for zone=" + getZoneId();
return "Creating BGP Peer " + getAsNumber() + " for zone with ID: " + getResourceUuid(ApiConstants.ZONE_ID);
}
@Override

View File

@ -82,7 +82,7 @@ public class DedicateBgpPeerCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Dedicating Bgp Peer " + getId();
return "Dedicating BGP Peer with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -59,7 +59,7 @@ public class DeleteBgpPeerCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting Bgp Peer " + getId();
return "Deleting BGP Peer with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -59,7 +59,7 @@ public class ReleaseDedicatedBgpPeerCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Releasing a dedicated Bgp Peer " + getId();
return "Releasing dedicated BGP Peer with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -120,7 +120,7 @@ public class UpdateBgpPeerCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Updating Bgp Peer " + getId();
return "Updating BGP Peer with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -70,7 +70,7 @@ public class ChangeOutOfBandManagementPasswordCmd extends BaseAsyncCmd {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Unable to find host by ID: " + getHostId());
}
CallContext.current().setEventDetails("Host Id: " + host.getId() + " Password: " + getPassword().charAt(0) + "****");
CallContext.current().setEventDetails("Host ID: " + host.getUuid() + " Password: " + getPassword().charAt(0) + "****");
CallContext.current().putContextParameter(Host.class, host.getUuid());
final OutOfBandManagementResponse response = outOfBandManagementService.changePassword(host, getPassword());
@ -101,7 +101,7 @@ public class ChangeOutOfBandManagementPasswordCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "change out-of-band management password for host: " + getHostId();
return "Changing out-of-band management password for host with ID: " + getResourceUuid(ApiConstants.HOST_ID);
}
@Override

View File

@ -70,7 +70,7 @@ public class DisableOutOfBandManagementForClusterCmd extends BaseAsyncCmd {
OutOfBandManagementResponse response = outOfBandManagementService.disableOutOfBandManagement(cluster);
CallContext.current().setEventDetails("Cluster Id:" + cluster.getId() + " out-of-band management enabled: false");
CallContext.current().setEventDetails("Cluster ID:" + cluster.getUuid() + " out-of-band management enabled: false");
CallContext.current().putContextParameter(Cluster.class, cluster.getUuid());
response.setResponseName(getCommandName());
@ -93,7 +93,7 @@ public class DisableOutOfBandManagementForClusterCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "disable out-of-band management password for cluster: " + getClusterId();
return "Disabling out-of-band management password for cluster with ID: " + getResourceUuid(ApiConstants.CLUSTER_ID);
}
@Override

View File

@ -70,7 +70,7 @@ public class DisableOutOfBandManagementForHostCmd extends BaseAsyncCmd {
OutOfBandManagementResponse response = outOfBandManagementService.disableOutOfBandManagement(host);
CallContext.current().setEventDetails("Host Id:" + host.getId() + " out-of-band management enabled: false");
CallContext.current().setEventDetails("Host ID:" + host.getUuid() + " out-of-band management enabled: false");
CallContext.current().putContextParameter(Host.class, host.getUuid());
response.setId(host.getUuid());
@ -94,7 +94,7 @@ public class DisableOutOfBandManagementForHostCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "disable out-of-band management password for host: " + getHostId();
return "Disabling out-of-band management password for host with ID: " + getResourceUuid(ApiConstants.HOST_ID);
}
@Override

View File

@ -70,7 +70,7 @@ public class DisableOutOfBandManagementForZoneCmd extends BaseAsyncCmd {
OutOfBandManagementResponse response = outOfBandManagementService.disableOutOfBandManagement(zone);
CallContext.current().setEventDetails("Zone Id:" + zone.getId() + " out-of-band management enabled: false");
CallContext.current().setEventDetails("Zone ID:" + zone.getUuid() + " out-of-band management enabled: false");
CallContext.current().putContextParameter(DataCenter.class, zone.getUuid());
response.setResponseName(getCommandName());
@ -93,7 +93,7 @@ public class DisableOutOfBandManagementForZoneCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "disable out-of-band management password for zone: " + getZoneId();
return "Disabling out-of-band management password for zone with ID: " + getResourceUuid(ApiConstants.ZONE_ID);
}
@Override

View File

@ -70,7 +70,7 @@ public class EnableOutOfBandManagementForClusterCmd extends BaseAsyncCmd {
OutOfBandManagementResponse response = outOfBandManagementService.enableOutOfBandManagement(cluster);
CallContext.current().setEventDetails("Cluster Id:" + cluster.getId() + " out-of-band management enabled: true");
CallContext.current().setEventDetails("Cluster ID:" + cluster.getUuid() + " out-of-band management enabled: true");
CallContext.current().putContextParameter(Cluster.class, cluster.getUuid());
response.setResponseName(getCommandName());
@ -93,7 +93,7 @@ public class EnableOutOfBandManagementForClusterCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "enable out-of-band management password for cluster: " + getClusterId();
return "Enabling out-of-band management password for cluster with ID: " + getResourceUuid(ApiConstants.CLUSTER_ID);
}
@Override

View File

@ -70,7 +70,7 @@ public class EnableOutOfBandManagementForHostCmd extends BaseAsyncCmd {
OutOfBandManagementResponse response = outOfBandManagementService.enableOutOfBandManagement(host);
CallContext.current().setEventDetails("Host Id:" + host.getId() + " out-of-band management enabled: true");
CallContext.current().setEventDetails("Host ID:" + host.getUuid() + " out-of-band management enabled: true");
CallContext.current().putContextParameter(Host.class, host.getUuid());
response.setId(host.getUuid());
@ -94,7 +94,7 @@ public class EnableOutOfBandManagementForHostCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "enable out-of-band management password for host: " + getHostId();
return "Enabling out-of-band management password for host with ID: " + getResourceUuid(ApiConstants.HOST_ID);
}
@Override

View File

@ -70,7 +70,7 @@ public class EnableOutOfBandManagementForZoneCmd extends BaseAsyncCmd {
OutOfBandManagementResponse response = outOfBandManagementService.enableOutOfBandManagement(zone);
CallContext.current().setEventDetails("Zone Id:" + zone.getId() + " out-of-band management enabled: true");
CallContext.current().setEventDetails("Zone ID:" + zone.getUuid() + " out-of-band management enabled: true");
CallContext.current().putContextParameter(DataCenter.class, zone.getUuid());
response.setResponseName(getCommandName());
@ -93,7 +93,7 @@ public class EnableOutOfBandManagementForZoneCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "enable out-of-band management password for zone: " + getZoneId();
return "Enabling out-of-band management password for zone with ID: " + getResourceUuid(ApiConstants.ZONE_ID);
}
@Override

View File

@ -75,7 +75,7 @@ public class IssueOutOfBandManagementPowerActionCmd extends BaseAsyncCmd {
}
final PowerOperation powerOperation = PowerOperation.valueOf(getPowerAction());
CallContext.current().setEventDetails("Host Id: " + host.getId() + " Action: " + powerOperation.toString());
CallContext.current().setEventDetails("Host ID: " + host.getUuid() + " Action: " + powerOperation.toString());
CallContext.current().putContextParameter(Host.class, host.getUuid());
final OutOfBandManagementResponse response = outOfBandManagementService.executePowerOperation(host, powerOperation, getActionTimeout());
@ -107,7 +107,7 @@ public class IssueOutOfBandManagementPowerActionCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "issue out-out-band management power action: " + getPowerAction() + " on host: " + getHostId();
return "Issuing out-out-band management power action: " + getPowerAction() + " to host: " + getResourceUuid(ApiConstants.HOST_ID);
}
@Override

View File

@ -83,7 +83,7 @@ public class DeletePortableIpRangeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "deleting a portable public ip range";
return "Deleting a portable public ip range with ID: " + getResourceUuid(ApiConstants.ID) ;
}
@Override

View File

@ -84,7 +84,7 @@ public class UploadCustomCertificateCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return ("Uploading custom certificate to the db, and applying it to all the cpvms in the system");
return ("Uploading custom certificate and applying it to all the CPVMs in the system");
}
public static String getResultObjectName() {

View File

@ -93,7 +93,7 @@ public class ConfigureOvsElementCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "configuring ovs provider: " + id;
return "Configuring OVS provider with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
@ -109,7 +109,7 @@ public class ConfigureOvsElementCmd extends BaseAsyncCmd {
@Override
public void execute() throws ConcurrentOperationException,
ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Ovs element: " + id);
CallContext.current().setEventDetails("OVS element: " + getResourceUuid(ApiConstants.ID));
OvsProvider result = _service.get(0).configure(this);
if (result != null) {
OvsProviderResponse ovsResponse = _responseGenerator

View File

@ -100,7 +100,7 @@ public class ConfigureVirtualRouterElementCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "configuring virtual router provider: " + id;
return "Configuring virtual router with provider that has ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
@ -115,7 +115,7 @@ public class ConfigureVirtualRouterElementCmd extends BaseAsyncCmd {
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Virtual router element: " + id);
CallContext.current().setEventDetails("Virtual router element ID: " + getResourceUuid(ApiConstants.ID));
VirtualRouterProvider result = _service.get(0).configure(this);
if (result != null) {
VirtualRouterProviderResponse routerResponse = _responseGenerator.createVirtualRouterProviderResponse(result);

View File

@ -98,7 +98,7 @@ public class CreateVirtualRouterElementCmd extends BaseAsyncCreateCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Virtual router element Id: " + getEntityUuid());
CallContext.current().setEventDetails("Virtual router element ID: " + getEntityUuid());
VirtualRouterProvider result = _service.get(0).getCreatedElement(getEntityId());
if (result != null) {
VirtualRouterProviderResponse response = _responseGenerator.createVirtualRouterProviderResponse(result);

View File

@ -74,7 +74,7 @@ public class DestroyRouterCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "destroying router: " + this._uuidMgr.getUuid(VirtualMachine.class,getId());
return "Destroying virtual router with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
@ -90,7 +90,7 @@ public class DestroyRouterCmd extends BaseAsyncCmd {
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
CallContext ctx = CallContext.current();
ctx.setEventDetails("Router Id: " + this._uuidMgr.getUuid(VirtualMachine.class,getId()));
ctx.setEventDetails("Router ID: " + getResourceUuid(ApiConstants.ID));
VirtualRouter result = _routerService.destroyRouter(getId(), ctx.getCallingAccount(), ctx.getCallingUserId());
if (result != null) {

View File

@ -87,7 +87,7 @@ public class GetRouterHealthCheckResultsCmd extends BaseCmd {
@Override
public void execute() throws ResourceUnavailableException, InvalidParameterValueException, ServerApiException {
CallContext.current().setEventDetails("Router Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getRouterId()));
CallContext.current().setEventDetails("Router ID: " + getResourceUuid(ApiConstants.ROUTER_ID));
VirtualRouter router = _routerService.findRouter(getRouterId());
if (router == null || router.getRole() != VirtualRouter.Role.VIRTUAL_ROUTER) {
throw new InvalidParameterValueException("Can't find router by routerId");

View File

@ -78,7 +78,7 @@ public class RebootRouterCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "rebooting router: " + this._uuidMgr.getUuid(VirtualMachine.class,getId());
return "Rebooting router with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
@ -97,7 +97,7 @@ public class RebootRouterCmd extends BaseAsyncCmd {
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Router Id: " + this._uuidMgr.getUuid(VirtualMachine.class,getId()));
CallContext.current().setEventDetails("Router ID: " + getResourceUuid(ApiConstants.ID));
VirtualRouter result = _routerService.rebootRouter(getId(), true, isForced());
if (result != null) {
DomainRouterResponse response = _responseGenerator.createDomainRouterResponse(result);

View File

@ -81,7 +81,7 @@ public class StartRouterCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "starting router: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
return "Starting virtual router with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
@ -96,7 +96,7 @@ public class StartRouterCmd extends BaseAsyncCmd {
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Router Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
CallContext.current().setEventDetails("Router Id: " + getResourceUuid(ApiConstants.ID));
VirtualRouter result = null;
VirtualRouter router = _routerService.findRouter(getId());
if (router == null || router.getRole() != Role.VIRTUAL_ROUTER) {

View File

@ -79,7 +79,7 @@ public class StopRouterCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Stopping router: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
return "Stopping virtual router with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
@ -98,7 +98,7 @@ public class StopRouterCmd extends BaseAsyncCmd {
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException {
CallContext.current().setEventDetails("Router Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
CallContext.current().setEventDetails("Router ID: " + getResourceUuid(ApiConstants.ID));
VirtualRouter result = null;
VirtualRouter router = _routerService.findRouter(getId());
if (router == null || router.getRole() != Role.VIRTUAL_ROUTER) {

View File

@ -119,7 +119,7 @@ public class UpgradeRouterTemplateCmd extends org.apache.cloudstack.api.BaseCmd
@Override
public void execute() throws ConcurrentOperationException, ResourceUnavailableException, InsufficientCapacityException {
CallContext.current().setEventDetails("Upgrading router Template");
CallContext.current().setEventDetails("Upgrading router with with ID: " + getResourceUuid(ApiConstants.ID) + " template");
List<Long> result = _routerService.upgradeRouterTemplate(this);
if (result != null) {
ListResponse<UpgradeRouterTemplateResponse> response = _responseGenerator.createUpgradeRouterTemplateResponse(result);

View File

@ -93,7 +93,7 @@ public class CancelPrimaryStorageMaintenanceCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "canceling maintenance for primary storage pool: " + getId();
return "Canceling maintenance mode for primary storage pool with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -28,7 +28,6 @@ import org.apache.cloudstack.api.response.SuccessResponse;
import org.apache.cloudstack.context.CallContext;
import com.cloud.event.EventTypes;
import com.cloud.storage.StoragePool;
@APICommand(name = "changeStoragePoolScope", description = "Changes the scope of a storage pool when the pool is in Disabled state." +
"This feature is officially tested and supported for Hypervisors: KVM and VMware, Protocols: NFS and Ceph, and Storage Provider: DefaultPrimary. " +
@ -61,15 +60,7 @@ public class ChangeStoragePoolScopeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
String description = "Change storage pool scope. Storage pool Id: ";
StoragePool pool = _entityMgr.findById(StoragePool.class, getId());
if (pool != null) {
description += pool.getUuid();
} else {
description += getId();
}
description += " to " + getScope();
return description;
return "Changing storage pool with ID: " + getResourceUuid(ApiConstants.ID) + " to scope " + scope;
}
@Override

View File

@ -130,6 +130,6 @@ public class ConfigureStorageAccessCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "configuring storage access groups";
return "Configuring storage access groups";
}
}

View File

@ -94,6 +94,6 @@ public class DownloadImageStoreObjectCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Downloading object at path " + getPath() + " on image store " + getStoreId();
return "Downloading object at path " + getPath() + " on image store " + getResourceUuid(ApiConstants.ID);
}
}

Some files were not shown because too many files have changed in this diff Show More