Skip to content

Commit 71482c5

Browse files
authored
Merge branch 'main' into feature-ui-logs
2 parents de925b1 + cd55796 commit 71482c5

Some content is hidden

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

42 files changed

+4312
-127
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ public class ApiConstants {
381381
public static final String MAC_ADDRESS = "macaddress";
382382
public static final String MAC_ADDRESSES = "macaddresses";
383383
public static final String MANUAL_UPGRADE = "manualupgrade";
384+
public static final String MATCH_TYPE = "matchtype";
384385
public static final String MAX = "max";
385386
public static final String MAX_SNAPS = "maxsnaps";
386387
public static final String MAX_BACKUPS = "maxbackups";

api/src/main/java/org/apache/cloudstack/api/command/user/backup/CreateBackupCmd.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
import javax.inject.Inject;
2121

22+
import com.cloud.vm.VirtualMachine;
2223
import org.apache.cloudstack.acl.RoleType;
2324
import org.apache.cloudstack.api.APICommand;
2425
import org.apache.cloudstack.api.ApiCommandResourceType;
@@ -138,7 +139,8 @@ public String getEventType() {
138139

139140
@Override
140141
public String getEventDescription() {
141-
return "Creating backup for Instance " + vmId;
142+
String vmUuid = _uuidMgr.getUuid(VirtualMachine.class, getVmId());
143+
return "Creating backup for Instance " + vmUuid;
142144
}
143145

144146
@Override

api/src/main/java/org/apache/cloudstack/api/command/user/backup/DeleteBackupCmd.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.apache.cloudstack.api.ServerApiException;
2929
import org.apache.cloudstack.api.response.BackupResponse;
3030
import org.apache.cloudstack.api.response.SuccessResponse;
31+
import org.apache.cloudstack.backup.Backup;
3132
import org.apache.cloudstack.backup.BackupManager;
3233
import org.apache.cloudstack.context.CallContext;
3334
import org.apache.commons.lang3.BooleanUtils;
@@ -111,6 +112,7 @@ public String getEventType() {
111112

112113
@Override
113114
public String getEventDescription() {
114-
return "Deleting backup ID " + backupId;
115+
String backupUuid = _uuidMgr.getUuid(Backup.class, getId());
116+
return "Deleting backup ID " + backupUuid;
115117
}
116118
}

api/src/main/java/org/apache/cloudstack/api/command/user/backup/RestoreBackupCmd.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.apache.cloudstack.api.ServerApiException;
2929
import org.apache.cloudstack.api.response.SuccessResponse;
3030
import org.apache.cloudstack.api.response.BackupResponse;
31+
import org.apache.cloudstack.backup.Backup;
3132
import org.apache.cloudstack.backup.BackupManager;
3233
import org.apache.cloudstack.context.CallContext;
3334

@@ -99,6 +100,7 @@ public String getEventType() {
99100

100101
@Override
101102
public String getEventDescription() {
102-
return "Restoring Instance from backup: " + backupId;
103+
String backupUuid = _uuidMgr.getUuid(Backup.class, getBackupId());
104+
return "Restoring Instance from backup: " + backupUuid;
103105
}
104106
}

engine/schema/src/main/resources/META-INF/db/schema-42210to42300.sql

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,22 @@
2525
UPDATE `cloud`.`configuration` SET value='random' WHERE name IN ('vm.allocation.algorithm', 'volume.allocation.algorithm') AND value='userconcentratedpod_random';
2626
UPDATE `cloud`.`configuration` SET value='firstfit' WHERE name IN ('vm.allocation.algorithm', 'volume.allocation.algorithm') AND value='userconcentratedpod_firstfit';
2727

28+
-- Create webhook_filter table
29+
DROP TABLE IF EXISTS `cloud`.`webhook_filter`;
30+
CREATE TABLE IF NOT EXISTS `cloud`.`webhook_filter` (
31+
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id of the webhook filter',
32+
`uuid` varchar(255) COMMENT 'uuid of the webhook filter',
33+
`webhook_id` bigint unsigned NOT NULL COMMENT 'id of the webhook',
34+
`type` varchar(20) COMMENT 'type of the filter',
35+
`mode` varchar(20) COMMENT 'mode of the filter',
36+
`match_type` varchar(20) COMMENT 'match type of the filter',
37+
`value` varchar(256) NOT NULL COMMENT 'value of the filter used for matching',
38+
`created` datetime NOT NULL COMMENT 'date created',
39+
PRIMARY KEY (`id`),
40+
INDEX `i_webhook_filter__webhook_id`(`webhook_id`),
41+
CONSTRAINT `fk_webhook_filter__webhook_id` FOREIGN KEY(`webhook_id`) REFERENCES `webhook`(`id`) ON DELETE CASCADE
42+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
43+
2844
-- Add management_server_details table to allow ManagementServer scope configs
2945
CREATE TABLE IF NOT EXISTS `cloud`.`management_server_details` (
3046
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',

plugins/event-bus/webhook/src/main/java/org/apache/cloudstack/mom/webhook/Webhook.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
import org.apache.cloudstack.api.InternalIdentity;
2525

2626
public interface Webhook extends ControlledEntity, Identity, InternalIdentity {
27-
public static final long ID_DUMMY = 0L;
28-
public static final String NAME_DUMMY = "Test";
27+
long ID_DUMMY = 0L;
28+
String NAME_DUMMY = "Test";
2929
enum State {
3030
Enabled, Disabled;
3131
};

plugins/event-bus/webhook/src/main/java/org/apache/cloudstack/mom/webhook/WebhookApiService.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@
1818
package org.apache.cloudstack.mom.webhook;
1919

2020
import org.apache.cloudstack.api.response.ListResponse;
21+
import org.apache.cloudstack.mom.webhook.api.command.user.AddWebhookFilterCmd;
2122
import org.apache.cloudstack.mom.webhook.api.command.user.CreateWebhookCmd;
2223
import org.apache.cloudstack.mom.webhook.api.command.user.DeleteWebhookCmd;
2324
import org.apache.cloudstack.mom.webhook.api.command.user.DeleteWebhookDeliveryCmd;
25+
import org.apache.cloudstack.mom.webhook.api.command.user.DeleteWebhookFilterCmd;
2426
import org.apache.cloudstack.mom.webhook.api.command.user.ExecuteWebhookDeliveryCmd;
2527
import org.apache.cloudstack.mom.webhook.api.command.user.ListWebhookDeliveriesCmd;
28+
import org.apache.cloudstack.mom.webhook.api.command.user.ListWebhookFiltersCmd;
2629
import org.apache.cloudstack.mom.webhook.api.command.user.ListWebhooksCmd;
2730
import org.apache.cloudstack.mom.webhook.api.command.user.UpdateWebhookCmd;
2831
import org.apache.cloudstack.mom.webhook.api.response.WebhookDeliveryResponse;
32+
import org.apache.cloudstack.mom.webhook.api.response.WebhookFilterResponse;
2933
import org.apache.cloudstack.mom.webhook.api.response.WebhookResponse;
3034

3135
import com.cloud.utils.component.PluggableService;
@@ -41,4 +45,7 @@ public interface WebhookApiService extends PluggableService {
4145
ListResponse<WebhookDeliveryResponse> listWebhookDeliveries(ListWebhookDeliveriesCmd cmd);
4246
int deleteWebhookDelivery(DeleteWebhookDeliveryCmd cmd) throws CloudRuntimeException;
4347
WebhookDeliveryResponse executeWebhookDelivery(ExecuteWebhookDeliveryCmd cmd) throws CloudRuntimeException;
48+
ListResponse<WebhookFilterResponse> listWebhookFilters(ListWebhookFiltersCmd cmd) throws CloudRuntimeException;
49+
WebhookFilterResponse addWebhookFilter(AddWebhookFilterCmd cmd) throws CloudRuntimeException;
50+
int deleteWebhookFilter(DeleteWebhookFilterCmd cmd) throws CloudRuntimeException;
4451
}

0 commit comments

Comments
 (0)