Skip to content

Commit 0896f32

Browse files
committed
Merge branch 'healthcheck-main' of https://github.com/apache/cloudstack into healthcheck-main
2 parents c19fc1b + 0869f00 commit 0896f32

File tree

142 files changed

+8438
-1677
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+8438
-1677
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ jobs:
164164
component/test_cpu_limits
165165
component/test_cpu_max_limits
166166
component/test_cpu_project_limits
167-
component/test_deploy_vm_userdata_multi_nic",
167+
component/test_deploy_vm_userdata_multi_nic
168+
component/test_deploy_vm_lease",
168169
"component/test_egress_fw_rules
169170
component/test_invalid_gw_nm
170171
component/test_ip_reservation",

api/src/main/java/com/cloud/event/EventTypes.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,9 @@ public class EventTypes {
688688
public static final String EVENT_EXTERNAL_OPENDAYLIGHT_CONFIGURE_CONTROLLER = "PHYSICAL.ODLCONTROLLER.CONFIGURE";
689689

690690
//Guest OS related events
691+
public static final String EVENT_GUEST_OS_CATEGORY_ADD = "GUEST.OS.CATEGORY.ADD";
692+
public static final String EVENT_GUEST_OS_CATEGORY_DELETE = "GUEST.OS.CATEGORY.DELETE";
693+
public static final String EVENT_GUEST_OS_CATEGORY_UPDATE = "GUEST.OS.CATEGORY.UPDATE";
691694
public static final String EVENT_GUEST_OS_ADD = "GUEST.OS.ADD";
692695
public static final String EVENT_GUEST_OS_REMOVE = "GUEST.OS.REMOVE";
693696
public static final String EVENT_GUEST_OS_UPDATE = "GUEST.OS.UPDATE";
@@ -796,6 +799,11 @@ public class EventTypes {
796799
// Resource Limit
797800
public static final String EVENT_RESOURCE_LIMIT_UPDATE = "RESOURCE.LIMIT.UPDATE";
798801

802+
public static final String VM_LEASE_EXPIRED = "VM.LEASE.EXPIRED";
803+
public static final String VM_LEASE_DISABLED = "VM.LEASE.DISABLED";
804+
public static final String VM_LEASE_CANCELLED = "VM.LEASE.CANCELLED";
805+
public static final String VM_LEASE_EXPIRING = "VM.LEASE.EXPIRING";
806+
799807
static {
800808

801809
// TODO: need a way to force author adding event types to declare the entity details as well, with out braking
@@ -1290,6 +1298,12 @@ public class EventTypes {
12901298
entityEventDetails.put(EVENT_SHAREDFS_DESTROY, SharedFS.class);
12911299
entityEventDetails.put(EVENT_SHAREDFS_EXPUNGE, SharedFS.class);
12921300
entityEventDetails.put(EVENT_SHAREDFS_RECOVER, SharedFS.class);
1301+
1302+
// VM Lease
1303+
entityEventDetails.put(VM_LEASE_EXPIRED, VirtualMachine.class);
1304+
entityEventDetails.put(VM_LEASE_EXPIRING, VirtualMachine.class);
1305+
entityEventDetails.put(VM_LEASE_DISABLED, VirtualMachine.class);
1306+
entityEventDetails.put(VM_LEASE_CANCELLED, VirtualMachine.class);
12931307
}
12941308

12951309
public static boolean isNetworkEvent(String eventType) {

api/src/main/java/com/cloud/kubernetes/cluster/KubernetesServiceHelper.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import org.apache.cloudstack.acl.ControlledEntity;
2020

21+
import com.cloud.user.Account;
2122
import com.cloud.uservm.UserVm;
2223
import com.cloud.utils.component.Adapter;
2324

@@ -26,4 +27,5 @@ public interface KubernetesServiceHelper extends Adapter {
2627
ControlledEntity findByUuid(String uuid);
2728
ControlledEntity findByVmId(long vmId);
2829
void checkVmCanBeDestroyed(UserVm userVm);
30+
void cleanupForAccount(Account account);
2931
}

api/src/main/java/com/cloud/server/ManagementService.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,15 @@
2525
import org.apache.cloudstack.api.command.admin.config.ListCfgGroupsByCmd;
2626
import org.apache.cloudstack.api.command.admin.config.ListCfgsByCmd;
2727
import org.apache.cloudstack.api.command.admin.config.UpdateHypervisorCapabilitiesCmd;
28+
import org.apache.cloudstack.api.command.admin.guest.AddGuestOsCategoryCmd;
2829
import org.apache.cloudstack.api.command.admin.guest.AddGuestOsCmd;
2930
import org.apache.cloudstack.api.command.admin.guest.AddGuestOsMappingCmd;
31+
import org.apache.cloudstack.api.command.admin.guest.DeleteGuestOsCategoryCmd;
3032
import org.apache.cloudstack.api.command.admin.guest.GetHypervisorGuestOsNamesCmd;
3133
import org.apache.cloudstack.api.command.admin.guest.ListGuestOsMappingCmd;
3234
import org.apache.cloudstack.api.command.admin.guest.RemoveGuestOsCmd;
3335
import org.apache.cloudstack.api.command.admin.guest.RemoveGuestOsMappingCmd;
36+
import org.apache.cloudstack.api.command.admin.guest.UpdateGuestOsCategoryCmd;
3437
import org.apache.cloudstack.api.command.admin.guest.UpdateGuestOsCmd;
3538
import org.apache.cloudstack.api.command.admin.guest.UpdateGuestOsMappingCmd;
3639
import org.apache.cloudstack.api.command.admin.host.ListHostsCmd;
@@ -168,6 +171,12 @@ public interface ManagementService {
168171
*/
169172
Pair<List<? extends GuestOsCategory>, Integer> listGuestOSCategoriesByCriteria(ListGuestOsCategoriesCmd cmd);
170173

174+
GuestOsCategory addGuestOsCategory(AddGuestOsCategoryCmd cmd);
175+
176+
GuestOsCategory updateGuestOsCategory(UpdateGuestOsCategoryCmd cmd);
177+
178+
boolean deleteGuestOsCategory(DeleteGuestOsCategoryCmd cmd);
179+
171180
/**
172181
* Obtains a list of all guest OS mappings
173182
*

api/src/main/java/com/cloud/server/ResourceIconManager.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
// under the License.
1717
package com.cloud.server;
1818

19+
import java.util.Collection;
1920
import java.util.List;
21+
import java.util.Map;
2022

2123
public interface ResourceIconManager {
2224

@@ -25,4 +27,8 @@ public interface ResourceIconManager {
2527
boolean deleteResourceIcon(List<String> resourceIds, ResourceTag.ResourceObjectType resourceType);
2628

2729
ResourceIcon getByResourceTypeAndUuid(ResourceTag.ResourceObjectType type, String resourceId);
30+
31+
Map<Long, ResourceIcon> getByResourceTypeAndIds(ResourceTag.ResourceObjectType type, Collection<Long> resourceIds);
32+
33+
Map<String, ResourceIcon> getByResourceTypeAndUuids(ResourceTag.ResourceObjectType type, Collection<String> resourceUuids);
2834
}

api/src/main/java/com/cloud/server/ResourceTag.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public enum ResourceObjectType {
6666
LBStickinessPolicy(false, true),
6767
LBHealthCheckPolicy(false, true),
6868
SnapshotPolicy(true, true),
69+
GuestOsCategory(false, false, true),
6970
GuestOs(false, true),
7071
NetworkOffering(false, true),
7172
VpcOffering(true, false),

api/src/main/java/com/cloud/storage/GuestOsCategory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
// under the License.
1717
package com.cloud.storage;
1818

19+
import java.util.Date;
20+
1921
import org.apache.cloudstack.api.Identity;
2022
import org.apache.cloudstack.api.InternalIdentity;
2123

@@ -27,4 +29,7 @@ public interface GuestOsCategory extends Identity, InternalIdentity {
2729

2830
void setName(String name);
2931

32+
boolean isFeatured();
33+
34+
Date getCreated();
3035
}

api/src/main/java/com/cloud/user/Account.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ public static Type getFromValue(Integer type){
7171
}
7272

7373
public static final long ACCOUNT_ID_SYSTEM = 1;
74+
public static final long ACCOUNT_ID_ADMIN = 2;
7475

7576
public String getAccountName();
7677

api/src/main/java/com/cloud/vm/VmDetailConstants.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,8 @@ public interface VmDetailConstants {
110110
// CPU mode and model, ADMIN only
111111
String GUEST_CPU_MODE = "guest.cpu.mode";
112112
String GUEST_CPU_MODEL = "guest.cpu.model";
113+
114+
String INSTANCE_LEASE_EXPIRY_DATE = "leaseexpirydate";
115+
String INSTANCE_LEASE_EXPIRY_ACTION = "leaseexpiryaction";
116+
String INSTANCE_LEASE_EXECUTION = "leaseactionexecution";
113117
}

api/src/main/java/org/apache/cloudstack/api/ApiCommandResourceType.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public enum ApiCommandResourceType {
6161
AffinityGroup(org.apache.cloudstack.affinity.AffinityGroup.class),
6262
InternalLbVm(com.cloud.network.router.VirtualRouter.class),
6363
DedicatedGuestVlanRange(com.cloud.network.GuestVlan.class),
64+
GuestOsCategory(com.cloud.storage.GuestOsCategory.class),
6465
GuestOs(com.cloud.storage.GuestOS.class),
6566
GuestOsMapping(com.cloud.storage.GuestOSHypervisor.class),
6667
Network(com.cloud.network.Network.class),

0 commit comments

Comments
 (0)