Skip to content

Commit 855c907

Browse files
committed
ui and fixes
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
1 parent 86546fd commit 855c907

26 files changed

Lines changed: 1052 additions & 104 deletions

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,9 @@ public class EventTypes {
179179
public static final String EVENT_INSTANCE_BOOT_GROUP_START = "INSTANCE.BOOT.GROUP.START";
180180
public static final String EVENT_INSTANCE_BOOT_GROUP_STOP = "INSTANCE.BOOT.GROUP.STOP";
181181
public static final String EVENT_INSTANCE_BOOT_GROUP_REBOOT = "INSTANCE.BOOT.GROUP.REBOOT";
182+
public static final String EVENT_INSTANCE_BOOT_GROUP_MEMBER_ADD = "INSTANCE.BOOT.GROUP.MEMBER.ADD";
183+
public static final String EVENT_INSTANCE_BOOT_GROUP_MEMBER_REMOVE = "INSTANCE.BOOT.GROUP.MEMBER.REMOVE";
184+
public static final String EVENT_INSTANCE_BOOT_GROUP_MEMBER_REORDER = "INSTANCE.BOOT.GROUP.MEMBER.REODER";
182185

183186
public static final String EVENT_NETWORK_CREATE = "NETWORK.CREATE";
184187
public static final String EVENT_NETWORK_DELETE = "NETWORK.DELETE";

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ public enum ApiCommandResourceType {
9191
Extension(org.apache.cloudstack.extension.Extension.class),
9292
ExtensionCustomAction(org.apache.cloudstack.extension.ExtensionCustomAction.class),
9393
KmsKey(org.apache.cloudstack.kms.KMSKey.class),
94-
HsmProfile(org.apache.cloudstack.kms.HSMProfile.class);
94+
HsmProfile(org.apache.cloudstack.kms.HSMProfile.class),
95+
InstanceBootGroup(org.apache.cloudstack.vm.bootgroup.InstanceBootGroup.class);
9596

9697
private final Class<?> clazz;
9798

‎api/src/main/java/org/apache/cloudstack/api/ApiConstants.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ public class ApiConstants {
9797
public static final String MEMBER_TYPE = "membertype";
9898
public static final String MEMBER_ID = "memberid";
9999
public static final String MEMBER_NAME = "membername";
100+
public static final String MEMBER_STATE = "memberstate";
100101
public static final String CA_CERTIFICATES = "cacertificates";
101102
public static final String CERTIFICATE = "certificate";
102103
public static final String CERTIFICATE_CHAIN = "certchain";
@@ -325,6 +326,7 @@ public class ApiConstants {
325326
public static final String INTERNAL_DNS2 = "internaldns2";
326327
public static final String INTERNET_PROTOCOL = "internetprotocol";
327328
public static final String INTERVAL_TYPE = "intervaltype";
329+
public static final String INSTANCE_GROUP_ID = "instancegroupid";
328330
public static final String INSTANCE_LEASE_DURATION = "leaseduration";
329331
public static final String INSTANCE_LEASE_ENABLED = "instanceleaseenabled";
330332
public static final String INSTANCE_LEASE_EXPIRY_ACTION = "leaseexpiryaction";

‎api/src/main/java/org/apache/cloudstack/api/command/user/bootgroup/AddMemberToInstanceBootGroupCmd.java‎

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.apache.cloudstack.acl.RoleType;
2323
import org.apache.cloudstack.api.APICommand;
24+
import org.apache.cloudstack.api.ApiCommandResourceType;
2425
import org.apache.cloudstack.api.ApiConstants;
2526
import org.apache.cloudstack.api.ApiErrorCode;
2627
import org.apache.cloudstack.api.BaseCmd;
@@ -48,26 +49,26 @@ public class AddMemberToInstanceBootGroupCmd extends BaseCmd implements UserCmd
4849
InstanceBootGroupService instanceBootGroupService;
4950

5051
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = InstanceBootGroupResponse.class, required = true, description = "The ID of the instance boot group")
51-
private String id;
52+
private Long id;
5253

5354
@Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class, description = "The ID of the VM to add (exclusive with instancegroupid)")
54-
private String virtualMachineId;
55+
private Long virtualMachineId;
5556

56-
@Parameter(name = ApiConstants.GROUP_ID, type = CommandType.UUID, entityType = InstanceGroupResponse.class, description = "The ID of the instance group to add (exclusive with virtualmachineid)")
57-
private String instanceGroupId;
57+
@Parameter(name = ApiConstants.INSTANCE_GROUP_ID, type = CommandType.UUID, entityType = InstanceGroupResponse.class, description = "The ID of the instance group to add (exclusive with virtualmachineid)")
58+
private Long instanceGroupId;
5859

5960
@Parameter(name = ApiConstants.BOOT_ORDER, type = CommandType.INTEGER, required = true, description = "The boot order value for this member (0 or greater; non-contiguous values are allowed)")
6061
private int order;
6162

62-
public String getId() {
63+
public Long getId() {
6364
return id;
6465
}
6566

66-
public String getVirtualMachineId() {
67+
public Long getVirtualMachineId() {
6768
return virtualMachineId;
6869
}
6970

70-
public String getInstanceGroupId() {
71+
public Long getInstanceGroupId() {
7172
return instanceGroupId;
7273
}
7374

@@ -80,6 +81,16 @@ public long getEntityOwnerId() {
8081
return CallContext.current().getCallingAccount().getId();
8182
}
8283

84+
@Override
85+
public Long getApiResourceId() {
86+
return id;
87+
}
88+
89+
@Override
90+
public ApiCommandResourceType getApiResourceType() {
91+
return ApiCommandResourceType.InstanceBootGroup;
92+
}
93+
8394
@Override
8495
public void execute() {
8596
InstanceBootGroupMember result = instanceBootGroupService.addMemberToInstanceBootGroup(this);

‎api/src/main/java/org/apache/cloudstack/api/command/user/bootgroup/CreateInstanceBootGroupCmd.java‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.apache.cloudstack.acl.RoleType;
2323
import org.apache.cloudstack.api.APICommand;
24+
import org.apache.cloudstack.api.ApiCommandResourceType;
2425
import org.apache.cloudstack.api.ApiConstants;
2526
import org.apache.cloudstack.api.ApiErrorCode;
2627
import org.apache.cloudstack.api.BaseCmd;
@@ -90,6 +91,11 @@ public long getEntityOwnerId() {
9091
return accountId;
9192
}
9293

94+
@Override
95+
public ApiCommandResourceType getApiResourceType() {
96+
return ApiCommandResourceType.InstanceBootGroup;
97+
}
98+
9399
@Override
94100
public void execute() {
95101
InstanceBootGroup result = instanceBootGroupService.createInstanceBootGroup(this);

‎api/src/main/java/org/apache/cloudstack/api/command/user/bootgroup/DeleteInstanceBootGroupCmd.java‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.apache.cloudstack.acl.RoleType;
2323
import org.apache.cloudstack.api.APICommand;
24+
import org.apache.cloudstack.api.ApiCommandResourceType;
2425
import org.apache.cloudstack.api.ApiConstants;
2526
import org.apache.cloudstack.api.ApiErrorCode;
2627
import org.apache.cloudstack.api.BaseCmd;
@@ -46,9 +47,9 @@ public class DeleteInstanceBootGroupCmd extends BaseCmd implements UserCmd {
4647
InstanceBootGroupService instanceBootGroupService;
4748

4849
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = InstanceBootGroupResponse.class, required = true, description = "The ID of the instance boot group")
49-
private String id;
50+
private Long id;
5051

51-
public String getId() {
52+
public Long getId() {
5253
return id;
5354
}
5455

@@ -57,6 +58,16 @@ public long getEntityOwnerId() {
5758
return CallContext.current().getCallingAccount().getId();
5859
}
5960

61+
@Override
62+
public Long getApiResourceId() {
63+
return id;
64+
}
65+
66+
@Override
67+
public ApiCommandResourceType getApiResourceType() {
68+
return ApiCommandResourceType.InstanceBootGroup;
69+
}
70+
6071
@Override
6172
public void execute() {
6273
boolean result = instanceBootGroupService.deleteInstanceBootGroup(this);

‎api/src/main/java/org/apache/cloudstack/api/command/user/bootgroup/ListInstanceBootGroupMembersCmd.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ public class ListInstanceBootGroupMembersCmd extends BaseListCmd implements User
4747
@Inject
4848
InstanceBootGroupService instanceBootGroupService;
4949

50-
@Parameter(name = ApiConstants.BOOT_GROUP_ID, type = CommandType.STRING, required = true, entityType = InstanceBootGroupResponse.class, description = "The ID of the instance boot group")
51-
private String bootGroupId;
50+
@Parameter(name = ApiConstants.BOOT_GROUP_ID, type = CommandType.UUID, required = true, entityType = InstanceBootGroupResponse.class, description = "The ID of the instance boot group")
51+
private Long bootGroupId;
5252

5353
@Parameter(name = ApiConstants.MEMBER_TYPE, type = CommandType.STRING, description = "Filter by member type: VirtualMachine or InstanceGroup")
5454
private String memberType;
5555

56-
public String getBootGroupId() {
56+
public Long getBootGroupId() {
5757
return bootGroupId;
5858
}
5959

‎api/src/main/java/org/apache/cloudstack/api/command/user/bootgroup/ListInstanceBootGroupsCmd.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ public class ListInstanceBootGroupsCmd extends BaseListProjectAndAccountResource
4848
@Inject
4949
InstanceBootGroupService instanceBootGroupService;
5050

51-
@Parameter(name = ApiConstants.ID, type = CommandType.STRING, entityType = InstanceBootGroupResponse.class, description = "List instance boot groups by ID")
52-
private String id;
51+
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = InstanceBootGroupResponse.class, description = "List instance boot groups by ID")
52+
private Long id;
5353

5454
@Parameter(name = ApiConstants.KEYWORD, type = CommandType.STRING, description = "List instance boot groups by name keyword")
5555
private String keyword;
5656

5757
@Parameter(name = ApiConstants.VIRTUAL_MACHINE_ID, type = CommandType.UUID, entityType = UserVmResponse.class, description = "List boot groups that contain this VM")
5858
private Long virtualMachineId;
5959

60-
@Parameter(name = ApiConstants.GROUP_ID, type = CommandType.UUID, entityType = InstanceGroupResponse.class, description = "List boot groups that contain this instance group")
60+
@Parameter(name = ApiConstants.INSTANCE_GROUP_ID, type = CommandType.UUID, entityType = InstanceGroupResponse.class, description = "List boot groups that contain this instance group")
6161
private Long instanceGroupId;
6262

63-
public String getId() {
63+
public Long getId() {
6464
return id;
6565
}
6666

‎api/src/main/java/org/apache/cloudstack/api/command/user/bootgroup/RebootInstanceBootGroupCmd.java‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.apache.cloudstack.acl.RoleType;
2323
import org.apache.cloudstack.api.APICommand;
24+
import org.apache.cloudstack.api.ApiCommandResourceType;
2425
import org.apache.cloudstack.api.ApiConstants;
2526
import org.apache.cloudstack.api.ApiErrorCode;
2627
import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -69,11 +70,21 @@ public String getEventDescription() {
6970
return "Rebooting instance boot group with ID: " + getResourceUuid(ApiConstants.ID);
7071
}
7172

73+
@Override
74+
public Long getApiResourceId() {
75+
return id;
76+
}
77+
78+
@Override
79+
public ApiCommandResourceType getApiResourceType() {
80+
return ApiCommandResourceType.InstanceBootGroup;
81+
}
82+
7283
@Override
7384
public void execute() {
7485
InstanceBootGroup result;
7586
try {
76-
result = instanceBootGroupService.rebootInstanceBootGroup(id);
87+
result = instanceBootGroupService.rebootInstanceBootGroup(this);
7788
} catch (CloudRuntimeException e) {
7889
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage());
7990
}

‎api/src/main/java/org/apache/cloudstack/api/command/user/bootgroup/RemoveInstanceBootGroupMemberCmd.java‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
import org.apache.cloudstack.acl.RoleType;
2323
import org.apache.cloudstack.api.APICommand;
24+
import org.apache.cloudstack.api.ApiCommandResourceType;
2425
import org.apache.cloudstack.api.ApiConstants;
2526
import org.apache.cloudstack.api.ApiErrorCode;
2627
import org.apache.cloudstack.api.BaseCmd;
@@ -46,9 +47,9 @@ public class RemoveInstanceBootGroupMemberCmd extends BaseCmd implements UserCmd
4647
InstanceBootGroupService instanceBootGroupService;
4748

4849
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = InstanceBootGroupMemberResponse.class, required = true, description = "The UUID of the boot group member entry to remove")
49-
private String id;
50+
private Long id;
5051

51-
public String getId() {
52+
public Long getId() {
5253
return id;
5354
}
5455

@@ -57,6 +58,16 @@ public long getEntityOwnerId() {
5758
return CallContext.current().getCallingAccount().getId();
5859
}
5960

61+
@Override
62+
public Long getApiResourceId() {
63+
return id;
64+
}
65+
66+
@Override
67+
public ApiCommandResourceType getApiResourceType() {
68+
return ApiCommandResourceType.InstanceBootGroup;
69+
}
70+
6071
@Override
6172
public void execute() {
6273
boolean result = instanceBootGroupService.removeInstanceBootGroupMember(this);

0 commit comments

Comments
 (0)