Skip to content

Commit c25264b

Browse files
authored
UI Fixes: allow filtering on alertype in UI & add events tab (#8630)
1 parent b8f8321 commit c25264b

30 files changed

Lines changed: 448 additions & 2 deletions

api/src/main/java/org/apache/cloudstack/alert/AlertService.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ private static AlertType getAlertType(short type) {
9191
return null;
9292
}
9393

94+
public static Set<AlertType> getAlertTypes() {
95+
return defaultAlertTypes;
96+
}
97+
9498
@Override
9599
public String toString() {
96100
return String.valueOf(this.getType());

api/src/main/java/org/apache/cloudstack/api/command/admin/acl/project/CreateProjectRoleCmd.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.apache.cloudstack.acl.ProjectRole;
2121
import org.apache.cloudstack.acl.RoleType;
2222
import org.apache.cloudstack.api.APICommand;
23+
import org.apache.cloudstack.api.ApiCommandResourceType;
2324
import org.apache.cloudstack.api.ApiConstants;
2425
import org.apache.cloudstack.api.ApiErrorCode;
2526
import org.apache.cloudstack.api.BaseCmd;
@@ -70,4 +71,13 @@ public long getEntityOwnerId() {
7071
return Account.ACCOUNT_ID_SYSTEM;
7172
}
7273

74+
@Override
75+
public Long getApiResourceId() {
76+
return getProjectId();
77+
}
78+
79+
@Override
80+
public ApiCommandResourceType getApiResourceType() {
81+
return ApiCommandResourceType.Project;
82+
}
7383
}

api/src/main/java/org/apache/cloudstack/api/command/admin/acl/project/CreateProjectRolePermissionCmd.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import org.apache.cloudstack.acl.RoleType;
2323
import org.apache.cloudstack.api.APICommand;
2424
import org.apache.cloudstack.api.ApiArgValidator;
25+
import org.apache.cloudstack.api.ApiCommandResourceType;
2526
import org.apache.cloudstack.api.ApiConstants;
2627
import org.apache.cloudstack.api.ApiErrorCode;
2728
import org.apache.cloudstack.api.Parameter;
@@ -96,4 +97,14 @@ private void setupResponse(final ProjectRolePermission rolePermission, final Pro
9697
response.setObjectName("projectrolepermission");
9798
setResponseObject(response);
9899
}
100+
101+
@Override
102+
public Long getApiResourceId() {
103+
return getProjectId();
104+
}
105+
106+
@Override
107+
public ApiCommandResourceType getApiResourceType() {
108+
return ApiCommandResourceType.Project;
109+
}
99110
}

api/src/main/java/org/apache/cloudstack/api/command/admin/acl/project/DeleteProjectRoleCmd.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.apache.cloudstack.acl.RoleType;
2222
import org.apache.cloudstack.api.APICommand;
2323
import org.apache.cloudstack.api.ApiArgValidator;
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;
@@ -79,4 +80,14 @@ public void execute() {
7980
public long getEntityOwnerId() {
8081
return CallContext.current().getCallingAccountId();
8182
}
83+
84+
@Override
85+
public Long getApiResourceId() {
86+
return getProjectId();
87+
}
88+
89+
@Override
90+
public ApiCommandResourceType getApiResourceType() {
91+
return ApiCommandResourceType.Project;
92+
}
8293
}

api/src/main/java/org/apache/cloudstack/api/command/admin/acl/project/DeleteProjectRolePermissionCmd.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.apache.cloudstack.acl.RoleType;
2222
import org.apache.cloudstack.api.APICommand;
2323
import org.apache.cloudstack.api.ApiArgValidator;
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;
@@ -80,4 +81,14 @@ public void execute() {
8081
public long getEntityOwnerId() {
8182
return CallContext.current().getCallingAccountId();
8283
}
84+
85+
@Override
86+
public Long getApiResourceId() {
87+
return getProjectId();
88+
}
89+
90+
@Override
91+
public ApiCommandResourceType getApiResourceType() {
92+
return ApiCommandResourceType.Project;
93+
}
8394
}

api/src/main/java/org/apache/cloudstack/api/command/admin/acl/project/UpdateProjectRoleCmd.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.apache.cloudstack.acl.RoleType;
2222
import org.apache.cloudstack.api.APICommand;
2323
import org.apache.cloudstack.api.ApiArgValidator;
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;
@@ -76,4 +77,14 @@ public void execute() {
7677
public long getEntityOwnerId() {
7778
return 0;
7879
}
80+
81+
@Override
82+
public Long getApiResourceId() {
83+
return getProjectId();
84+
}
85+
86+
@Override
87+
public ApiCommandResourceType getApiResourceType() {
88+
return ApiCommandResourceType.Project;
89+
}
7990
}

api/src/main/java/org/apache/cloudstack/api/command/admin/acl/project/UpdateProjectRolePermissionCmd.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.apache.cloudstack.acl.RoleType;
2727
import org.apache.cloudstack.api.APICommand;
2828
import org.apache.cloudstack.api.ApiArgValidator;
29+
import org.apache.cloudstack.api.ApiCommandResourceType;
2930
import org.apache.cloudstack.api.ApiConstants;
3031
import org.apache.cloudstack.api.ApiErrorCode;
3132
import org.apache.cloudstack.api.BaseCmd;
@@ -154,4 +155,14 @@ private boolean updateProjectRolePermissionOrder(ProjectRole projectRole) {
154155
public long getEntityOwnerId() {
155156
return CallContext.current().getCallingAccountId();
156157
}
158+
159+
@Override
160+
public Long getApiResourceId() {
161+
return getProjectId();
162+
}
163+
164+
@Override
165+
public ApiCommandResourceType getApiResourceType() {
166+
return ApiCommandResourceType.Project;
167+
}
157168
}

api/src/main/java/org/apache/cloudstack/api/command/admin/outofbandmanagement/ChangeOutOfBandManagementPasswordCmd.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.apache.cloudstack.acl.RoleType;
2727
import org.apache.cloudstack.api.APICommand;
2828
import org.apache.cloudstack.api.ApiArgValidator;
29+
import org.apache.cloudstack.api.ApiCommandResourceType;
2930
import org.apache.cloudstack.api.ApiConstants;
3031
import org.apache.cloudstack.api.ApiErrorCode;
3132
import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -102,4 +103,14 @@ public String getEventType() {
102103
public String getEventDescription() {
103104
return "change out-of-band management password for host: " + getHostId();
104105
}
106+
107+
@Override
108+
public Long getApiResourceId() {
109+
return getHostId();
110+
}
111+
112+
@Override
113+
public ApiCommandResourceType getApiResourceType() {
114+
return ApiCommandResourceType.Host;
115+
}
105116
}

api/src/main/java/org/apache/cloudstack/api/command/admin/outofbandmanagement/ConfigureOutOfBandManagementCmd.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import org.apache.cloudstack.acl.RoleType;
2727
import org.apache.cloudstack.api.APICommand;
2828
import org.apache.cloudstack.api.ApiArgValidator;
29+
import org.apache.cloudstack.api.ApiCommandResourceType;
2930
import org.apache.cloudstack.api.ApiConstants;
3031
import org.apache.cloudstack.api.ApiErrorCode;
3132
import org.apache.cloudstack.api.BaseCmd;
@@ -112,4 +113,14 @@ protected void putOptionIfIsNotEmpty(ImmutableMap.Builder<OutOfBandManagement.Op
112113
builder.put(option, value);
113114
}
114115
}
116+
117+
@Override
118+
public Long getApiResourceId() {
119+
return getHostId();
120+
}
121+
122+
@Override
123+
public ApiCommandResourceType getApiResourceType() {
124+
return ApiCommandResourceType.Host;
125+
}
115126
}

api/src/main/java/org/apache/cloudstack/api/command/admin/outofbandmanagement/DisableOutOfBandManagementForClusterCmd.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.apache.cloudstack.acl.RoleType;
2828
import org.apache.cloudstack.api.APICommand;
2929
import org.apache.cloudstack.api.ApiArgValidator;
30+
import org.apache.cloudstack.api.ApiCommandResourceType;
3031
import org.apache.cloudstack.api.ApiConstants;
3132
import org.apache.cloudstack.api.ApiErrorCode;
3233
import org.apache.cloudstack.api.BaseAsyncCmd;
@@ -94,4 +95,14 @@ public String getEventType() {
9495
public String getEventDescription() {
9596
return "disable out-of-band management password for cluster: " + getClusterId();
9697
}
98+
99+
@Override
100+
public Long getApiResourceId() {
101+
return getClusterId();
102+
}
103+
104+
@Override
105+
public ApiCommandResourceType getApiResourceType() {
106+
return ApiCommandResourceType.Cluster;
107+
}
97108
}

0 commit comments

Comments
 (0)