This commit is contained in:
Erik Böck 2026-01-22 14:25:45 +00:00 committed by GitHub
commit 5c61268929
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
256 changed files with 491 additions and 343 deletions

View File

@ -32,6 +32,7 @@ import java.util.regex.Pattern;
import javax.inject.Inject;
import com.cloud.bgp.BGPService;
import com.cloud.utils.UuidUtils;
import org.apache.cloudstack.acl.ProjectRoleService;
import org.apache.cloudstack.acl.RoleService;
import org.apache.cloudstack.acl.RoleType;
@ -498,4 +499,14 @@ public abstract class BaseCmd {
}
return details;
}
public String getResourceUuid(String parameterName) {
String resourceUuid = CallContext.current().getApiResourceUuid(parameterName);
if (resourceUuid != null && UuidUtils.isUuid(resourceUuid)) {
return resourceUuid;
}
return null;
}
}

View File

@ -108,7 +108,15 @@ 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

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

@ -88,7 +88,7 @@ public class DeleteDomainCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting domain: " + getId();
return "Deleting domain with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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,7 +84,7 @@ 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

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

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

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

@ -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

@ -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);
}
// ///////////////////////////////////////////////////

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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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

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

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

@ -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

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

@ -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);
}
}

View File

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

View File

@ -67,7 +67,7 @@ public class SyncStoragePoolCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Attempting to synchronise storage pool with management server";
return "Attempting to synchronise storage pool with ID:" + getResourceUuid(ApiConstants.ID) + " with management server";
}
@Override

View File

@ -76,7 +76,7 @@ public class DestroySystemVmCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Destroying system Instance: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
return "Destroying System VM with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
@ -91,14 +91,14 @@ public class DestroySystemVmCmd extends BaseAsyncCmd {
@Override
public void execute() {
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
CallContext.current().setEventDetails("VM ID: " + getResourceUuid(ApiConstants.ID));
VirtualMachine instance = _mgr.destroySystemVM(this);
if (instance != null) {
SystemVmResponse response = _responseGenerator.createSystemVmResponse(instance);
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Fail to destroy system vm");
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to destroy System VM");
}
}
}

View File

@ -120,7 +120,7 @@ public class MigrateSystemVMCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Attempting to migrate Instance Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVirtualMachineId()) + " to host Id: " + this._uuidMgr.getUuid(Host.class, getHostId());
return "Attempting to migrate System VM with ID: " + getResourceUuid(ApiConstants.VIRTUAL_MACHINE_ID) + " to host with ID: " + getResourceUuid(ApiConstants.HOST_ID);
}
@Override

View File

@ -19,7 +19,6 @@ package org.apache.cloudstack.api.command.admin.systemvm;
import com.cloud.event.EventTypes;
import com.cloud.user.Account;
import com.cloud.utils.Pair;
import com.cloud.vm.VirtualMachine;
import org.apache.cloudstack.acl.RoleType;
import org.apache.cloudstack.api.APICommand;
import org.apache.cloudstack.api.ApiConstants;
@ -72,7 +71,7 @@ public class PatchSystemVMCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return String.format("Attempting to live patch System VM with Id: %s ", this._uuidMgr.getUuid(VirtualMachine.class, getId()));
return String.format("Attempting to live patch System VM with ID: %s ", getResourceUuid(ApiConstants.ID));
}
@Override

View File

@ -86,7 +86,7 @@ public class RebootSystemVmCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "rebooting system vm: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
return "Rebooting System VM with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
@ -112,7 +112,7 @@ public class RebootSystemVmCmd extends BaseAsyncCmd {
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Fail to reboot system vm");
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to reboot System Instance");
}
}
}

View File

@ -137,6 +137,6 @@ public class ScaleSystemVMCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Upgrading system vm: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()) + " to service offering: " + this._uuidMgr.getUuid(ServiceOffering.class, getServiceOfferingId());
return "Upgrading System VM with ID: " + getResourceUuid(ApiConstants.ID) + " to service offering: " + getResourceUuid(ApiConstants.SERVICE_OFFERING_ID);
}
}

View File

@ -87,7 +87,7 @@ public class StartSystemVMCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "starting system vm: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
return "Starting System VM with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -89,7 +89,7 @@ public class StopSystemVmCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Stopping system vm: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
return "Stopping System VM with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -100,7 +100,7 @@ public class UpgradeSystemVMCmd extends BaseCmd {
response.setResponseName(getCommandName());
setResponseObject(response);
} else {
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Fail to reboot system vm");
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to reboot System VM");
}
}
}

View File

@ -71,7 +71,7 @@ public class DeleteTrafficTypeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting Traffic Type: " + getId();
return "Deleting Traffic Type with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -118,7 +118,7 @@ public class UpdateTrafficTypeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Updating Traffic Type: " + getId();
return "Updating Traffic Type with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -78,12 +78,12 @@ public class DisableUserCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "disabling user: " + this._uuidMgr.getUuid(User.class, getId());
return "Disabling User with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
public void execute() {
CallContext.current().setEventDetails("User ID: " + this._uuidMgr.getUuid(User.class, getId()));
CallContext.current().setEventDetails("User ID: " + getResourceUuid(ApiConstants.ID));
UserAccount user = _regionService.disableUser(this);
if (user != null) {

View File

@ -81,7 +81,7 @@ public class ExpungeVMCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Expunging Instance: " + this._uuidMgr.getUuid(VirtualMachine.class, getId());
return "Expunging Instance with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override
@ -96,7 +96,7 @@ public class ExpungeVMCmd extends BaseAsyncCmd {
@Override
public void execute() throws ResourceUnavailableException, ConcurrentOperationException {
CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getId()));
CallContext.current().setEventDetails("VM ID: " + getResourceUuid(ApiConstants.ID));
try {
UserVm result = _userVmService.expungeVm(this.getId());

View File

@ -271,8 +271,7 @@ public class ImportUnmanagedInstanceCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
String vmName = this.name;
return String.format("Importing unmanaged Instance: %s", vmName);
return "Importing unmanaged Instance: " + name;
}
public boolean isForced() {

View File

@ -124,15 +124,15 @@ public class MigrateVMCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
String eventDescription;
String description = "Attempting to migrate Instance with ID: " + getResourceUuid(ApiConstants.VIRTUAL_MACHINE_ID);
if (getHostId() != null) {
eventDescription = String.format("Attempting to migrate Instance id: %s to host Id: %s", getVirtualMachineId(), getHostId());
description += " to host with ID: " +getResourceUuid(ApiConstants.HOST_ID);
} else if (getStoragePoolId() != null) {
eventDescription = String.format("Attempting to migrate Instance id: %s to storage pool Id: %s", getVirtualMachineId(), getStoragePoolId());
} else {
eventDescription = String.format("Attempting to migrate Instance id: %s", getVirtualMachineId());
description = " to storage pool with ID: " + getResourceUuid(ApiConstants.STORAGE_ID);
}
return eventDescription;
return description;
}
@Override

View File

@ -135,7 +135,7 @@ public class MigrateVirtualMachineWithVolumeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Attempting to migrate Instance Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVirtualMachineId()) + " to host Id: " + this._uuidMgr.getUuid(Host.class, getHostId());
return "Attempting to migrate Instance with ID: " + getResourceUuid(ApiConstants.VIRTUAL_MACHINE_ID) + " to host with ID: " + getResourceUuid(ApiConstants.HOST_ID);
}
@Override

View File

@ -97,7 +97,7 @@ public class UnmanageVMInstanceCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Unmanaging Instance. Instance ID = " + vmId;
return "Unmanaging Instance with ID: " + getResourceUuid(ApiConstants.ID);
}
public Long getHostId() {

View File

@ -81,7 +81,7 @@ public class UnmanageVolumeCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return String.format("Unmanaging Volume with ID %s", volumeId);
return "Unmanaging Volume with ID: " + getResourceUuid(ApiConstants.ID);
}
/////////////////////////////////////////////////////

View File

@ -66,7 +66,7 @@ public class DeletePrivateGatewayCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return ("Deleting private gateway id=" + id);
return "Deleting private gateway with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -76,7 +76,7 @@ public class DeleteVPCOfferingCmd extends BaseAsyncCmd {
@Override
public String getEventDescription() {
return "Deleting VPC offering id=" + getId();
return "Deleting VPC offering with ID: " + getResourceUuid(ApiConstants.ID);
}
@Override

View File

@ -126,7 +126,7 @@ public class UpdateVPCOfferingCmd extends BaseAsyncCmd implements DomainAndZoneI
@Override
public String getEventDescription() {
return "Updating VPC offering id=" + getId();
return "Updating VPC offering with ID:" + getResourceUuid(ApiConstants.ID);
}
@Override

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