Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
7bc15c3
api,server,ui: weebhoks feature
shwstppr Jan 16, 2024
8442350
fix
shwstppr Feb 12, 2024
a69192c
fix
shwstppr Feb 13, 2024
af388a0
changes
shwstppr Feb 13, 2024
d17ded0
registry of message busses
DaanHoogland Sep 21, 2023
fa874ed
test bus
shwstppr Feb 13, 2024
75a56f7
refactor
shwstppr Feb 13, 2024
0c2a5c7
test
shwstppr Feb 13, 2024
d82863b
fix and refactor
shwstppr Feb 13, 2024
d273921
Merge branch 'message-buses' into add-feature-webhooks
shwstppr Feb 13, 2024
f74ffee
changes for webhook dispatch history
shwstppr Feb 14, 2024
a06b8f6
changes, initial ui
shwstppr Feb 14, 2024
d2c3d40
improvements
shwstppr Feb 15, 2024
23621eb
changes for account webhook cleanup
shwstppr Feb 16, 2024
d4bd086
fix remaining event bus usage
shwstppr Feb 16, 2024
3821fac
changes for testing webhook dispatch
shwstppr Feb 16, 2024
e8f4c1c
wip
shwstppr Feb 16, 2024
291ead5
fix test
shwstppr Feb 16, 2024
8a88be7
make element
shwstppr Feb 19, 2024
1072909
missing
shwstppr Feb 19, 2024
4952ac2
Merge remote-tracking branch 'apache/main' into add-feature-webhooks
shwstppr Feb 19, 2024
a1a10ec
buid fix
shwstppr Feb 19, 2024
cf2eb1f
fix lint
shwstppr Feb 19, 2024
e7911a8
Merge remote-tracking branch 'apache/main' into add-feature-webhooks
shwstppr Feb 19, 2024
684f6d6
changes for project delete check
shwstppr Feb 19, 2024
2d097dd
fix
shwstppr Feb 19, 2024
02a1196
add collapse in create
shwstppr Feb 19, 2024
30f4c48
ui fix and refactor for eventditributor publish
shwstppr Feb 19, 2024
a89a428
update org.json and add json validation
shwstppr Feb 19, 2024
2debb85
schema fixes
shwstppr Feb 20, 2024
c7caf30
wordings
shwstppr Feb 21, 2024
5c04e87
ui: improve progress button
shwstppr Feb 21, 2024
e4e5ff0
ui improvements
shwstppr Feb 23, 2024
05f0590
remove unrelated change
shwstppr Feb 23, 2024
ac651e2
search and count
shwstppr Feb 23, 2024
3e3ca82
add payloadurl in info
shwstppr Feb 23, 2024
8dc662d
Merge branch 'main' into add-feature-webhooks
DaanHoogland Feb 26, 2024
85059c5
positive progress
shwstppr Feb 26, 2024
10a5e32
fix hmac key
shwstppr Feb 26, 2024
5cde6e8
create webhook form fixes
shwstppr Feb 26, 2024
819eb47
refactor, address feedback
shwstppr Feb 27, 2024
c70df5c
indentation
shwstppr Feb 27, 2024
64b52bf
fix filters
shwstppr Feb 28, 2024
07eae2f
remove test eventbus
shwstppr Feb 28, 2024
85edf96
default scope be Local
shwstppr Feb 28, 2024
fcd161d
add lifecycle smoke test
shwstppr Feb 28, 2024
dd522ca
add test for webhook deliveries
shwstppr Feb 28, 2024
7bc36ae
refactor
shwstppr Feb 29, 2024
3a739d4
fix lint
shwstppr Feb 29, 2024
27e683e
refactor - losgs and others
shwstppr Mar 4, 2024
38f3adc
unit tests
shwstppr Mar 4, 2024
31d85ef
Merge remote-tracking branch 'apache/main' into add-feature-webhooks
shwstppr Mar 4, 2024
2a4226a
fix lint
shwstppr Mar 4, 2024
dc79745
build fix
shwstppr Mar 4, 2024
e40d7ac
smoke test fix, log refactor
shwstppr Mar 5, 2024
398bc10
get bean from all components
shwstppr Mar 6, 2024
980dfb5
ui: missing label
shwstppr Mar 7, 2024
256f7a6
Merge remote-tracking branch 'apache/main' into add-feature-webhooks
shwstppr Mar 8, 2024
52b4fc3
address review comments
shwstppr Mar 14, 2024
4353a69
Merge remote-tracking branch 'apache/main' into add-feature-webhooks
shwstppr Mar 14, 2024
b054e0c
Merge remote-tracking branch 'apache/main' into add-feature-webhooks
shwstppr Apr 2, 2024
6a3949a
add some more tests
shwstppr Apr 8, 2024
ca83c0a
lint
shwstppr Apr 8, 2024
623496c
rename setting
shwstppr Apr 8, 2024
9bd4f1e
upgrade: move 4.19.0->4.20.0 to 4.19.1->4.20.0
weizhouapache Apr 8, 2024
426c120
fix test delivery layout
shwstppr Apr 15, 2024
ddadf22
fix webhook secret display
shwstppr Apr 15, 2024
54ad344
add http to payloadurl when no scheme
shwstppr Apr 15, 2024
9956375
allow removing secretkey for webhook
shwstppr Apr 15, 2024
8c5f2a6
fix update sslverification
shwstppr Apr 18, 2024
8a9039a
disallow same payload url for same account
shwstppr Apr 18, 2024
5c7b33e
fix delivery with url w/o scheme
shwstppr Apr 18, 2024
4f245b8
api: listApis should return params based on caller
shwstppr Apr 24, 2024
2748743
Merge branch 'main' into add-feature-webhooks
shwstppr Apr 29, 2024
e26432b
wip changes
shwstppr Apr 29, 2024
ef00a8c
Update engine/schema/src/main/resources/META-INF/db/schema-41900to420…
shwstppr Apr 30, 2024
8e1d53e
remove unique constraint for now
shwstppr Apr 30, 2024
3c9cca9
fixes
shwstppr May 1, 2024
7f54693
ui: add option to delete multiple deliveries
shwstppr May 1, 2024
21e051e
add filter for deliveries, delete api start/endtime support
shwstppr May 5, 2024
0497c5c
do not throw error when no deliveries removed
shwstppr May 5, 2024
36d0cad
Merge branch 'main' into 4.20-fix-upgrade-path-from-4191
weizhouapache May 7, 2024
67498fc
ui: fix deliveries table column sorting, time filter cancel
shwstppr May 7, 2024
12baadc
Merge remote-tracking branch 'apache/main' into add-feature-webhooks
shwstppr May 28, 2024
a75e138
Merge remote-tracking branch 'wei/4.20-fix-upgrade-path-from-4191' in…
shwstppr May 29, 2024
c67bf4c
Merge remote-tracking branch 'apache/main' into add-feature-webhooks
shwstppr Jun 3, 2024
757d113
remove isDebugEnabled wrapping
shwstppr Jun 5, 2024
4e72012
Merge remote-tracking branch 'apache/main' into add-feature-webhooks
shwstppr Jun 7, 2024
b15bba5
merge fix
shwstppr Jun 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
refactor, address feedback
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
  • Loading branch information
shwstppr committed Feb 27, 2024
commit 819eb47c4a630f6a868bc97464139635b43edfac
5 changes: 3 additions & 2 deletions api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@ public class ApiConstants {
public static final String HA_PROVIDER = "haprovider";
public static final String HA_STATE = "hastate";
public static final String HEALTH = "health";
public static final String HEADERS = "headers";
public static final String HIDE_IP_ADDRESS_USAGE = "hideipaddressusage";
public static final String HOST_ID = "hostid";
public static final String HOST_IDS = "hostids";
Expand Down Expand Up @@ -1103,8 +1104,8 @@ public class ApiConstants {

public static final String PARAMETER_DESCRIPTION_IS_TAG_A_RULE = "Whether the informed tag is a JS interpretable rule or not.";

public static final String WEBHOOK_RULE_ID = "webhookruleid";
public static final String WEBHOOK_RULE_NAME = "webhookrulename";
public static final String WEBHOOK_ID = "webhookid";
public static final String WEBHOOK_NAME = "webhookname";

/**
* This enum specifies IO Drivers, each option controls specific policies on I/O.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,19 @@ CREATE TABLE `cloud`.`webhook` (
CONSTRAINT `fk_webhook__account_id` FOREIGN KEY (`account_id`) REFERENCES `account`(`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `cloud`.`webhook_dispatch`;
CREATE TABLE `cloud`.`webhook_dispatch` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id of the webhook dispatch',
DROP TABLE IF EXISTS `cloud`.`webhook_delivery`;
CREATE TABLE `cloud`.`webhook_delivery` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'id of the webhook delivery',
`uuid` varchar(255) COMMENT 'uuid of the webhook',
`event_id` bigint unsigned NOT NULL COMMENT 'id of the event',
`webhook_id` bigint unsigned NOT NULL COMMENT 'id of the webhook rule',
`webhook_id` bigint unsigned NOT NULL COMMENT 'id of the webhook',
`mshost_msid` bigint unsigned NOT NULL COMMENT 'msid of the management server',
`payload` TEXT COMMENT 'payload for the webhook dispatch',
`success` boolean COMMENT 'webhook dispatch succeeded or not',
`response` TEXT COMMENT 'response of the webhook dispatch',
`start_time` datetime COMMENT 'start timestamp of the webhook dispatch',
`end_time` datetime COMMENT 'end timestamp of the webhook dispatch',
`headers` TEXT COMMENT 'headers for the webhook delivery',
`payload` TEXT COMMENT 'payload for the webhook delivery',
`success` boolean COMMENT 'webhook delivery succeeded or not',
`response` TEXT COMMENT 'response of the webhook delivery',
`start_time` datetime COMMENT 'start timestamp of the webhook delivery',
`end_time` datetime COMMENT 'end timestamp of the webhook delivery',
PRIMARY KEY(`id`),
INDEX `i_webhook__event_id`(`event_id`),
INDEX `i_webhook__webhook_id`(`webhook_id`),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@
-- specific language governing permissions and limitations
-- under the License.

-- VIEW `cloud`.`webhook_dispatch_view`;
-- VIEW `cloud`.`webhook_delivery_view`;

DROP VIEW IF EXISTS `cloud`.`webhook_dispatch_view`;
CREATE VIEW `cloud`.`webhook_dispatch_view` AS
DROP VIEW IF EXISTS `cloud`.`webhook_delivery_view`;
CREATE VIEW `cloud`.`webhook_delivery_view` AS
SELECT
webhook_dispatch.id,
webhook_dispatch.uuid,
webhook_dispatch.payload,
webhook_dispatch.success,
webhook_dispatch.response,
webhook_dispatch.start_time,
webhook_dispatch.end_time,
webhook_delivery.id,
webhook_delivery.uuid,
webhook_delivery.headers,
webhook_delivery.payload,
webhook_delivery.success,
webhook_delivery.response,
webhook_delivery.start_time,
webhook_delivery.end_time,
event.id event_id,
event.uuid event_uuid,
event.type event_type,
Expand All @@ -38,10 +39,10 @@ CREATE VIEW `cloud`.`webhook_dispatch_view` AS
mshost.msid mshost_msid,
mshost.name mshost_name
FROM
`cloud`.`webhook_dispatch`
`cloud`.`webhook_delivery`
INNER JOIN
`cloud`.`event` ON webhook_dispatch.event_id = event.id
`cloud`.`event` ON webhook_delivery.event_id = event.id
INNER JOIN
`cloud`.`webhook` ON webhook_dispatch.webhook_id = webhook.id
`cloud`.`webhook` ON webhook_delivery.webhook_id = webhook.id
LEFT JOIN
`cloud`.`mshost` ON mshost.msid = webhook_dispatch.mshost_msid;
`cloud`.`mshost` ON mshost.msid = webhook_delivery.mshost_msid;
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import org.apache.cloudstack.api.Identity;
import org.apache.cloudstack.api.InternalIdentity;

public interface WebhookRule extends ControlledEntity, Identity, InternalIdentity {
public static final long ID_DUMMY_RULE = 0L;
public static final String NAME_DUMMY_RULE = "Test";
public interface Webhook extends ControlledEntity, Identity, InternalIdentity {
public static final long ID_DUMMY = 0L;
public static final String NAME_DUMMY = "Test";
enum State {
Enabled, Disabled;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,27 @@
package org.apache.cloudstack.mom.webhook;

import org.apache.cloudstack.api.response.ListResponse;
import org.apache.cloudstack.mom.webhook.api.command.user.CreateWebhookRuleCmd;
import org.apache.cloudstack.mom.webhook.api.command.user.DeleteWebhookDispatchHistoryCmd;
import org.apache.cloudstack.mom.webhook.api.command.user.DeleteWebhookRuleCmd;
import org.apache.cloudstack.mom.webhook.api.command.user.ListWebhookDispatchHistoryCmd;
import org.apache.cloudstack.mom.webhook.api.command.user.ListWebhookRulesCmd;
import org.apache.cloudstack.mom.webhook.api.command.user.TestWebhookDispatchCmd;
import org.apache.cloudstack.mom.webhook.api.command.user.UpdateWebhookRuleCmd;
import org.apache.cloudstack.mom.webhook.api.response.WebhookDispatchResponse;
import org.apache.cloudstack.mom.webhook.api.response.WebhookRuleResponse;
import org.apache.cloudstack.mom.webhook.api.command.user.CreateWebhookCmd;
import org.apache.cloudstack.mom.webhook.api.command.user.DeleteRuleCmd;
import org.apache.cloudstack.mom.webhook.api.command.user.DeleteWebhookDeliveryCmd;
import org.apache.cloudstack.mom.webhook.api.command.user.ExecuteWebhookDeliveryCmd;
import org.apache.cloudstack.mom.webhook.api.command.user.ListWebhookDeliveries;
import org.apache.cloudstack.mom.webhook.api.command.user.ListWebhooksCmd;
import org.apache.cloudstack.mom.webhook.api.command.user.UpdateWebhookCmd;
import org.apache.cloudstack.mom.webhook.api.response.WebhookDeliveryResponse;
import org.apache.cloudstack.mom.webhook.api.response.WebhookResponse;

import com.cloud.utils.component.PluggableService;
import com.cloud.utils.exception.CloudRuntimeException;

public interface WebhookApiService extends PluggableService {

ListResponse<WebhookRuleResponse> listWebhookRules(ListWebhookRulesCmd cmd);
WebhookRuleResponse createWebhookRule(CreateWebhookRuleCmd cmd) throws CloudRuntimeException;
boolean deleteWebhookRule(DeleteWebhookRuleCmd cmd) throws CloudRuntimeException;
WebhookRuleResponse updateWebhookRule(UpdateWebhookRuleCmd cmd) throws CloudRuntimeException;
WebhookRuleResponse createWebhookRuleResponse(long webhookRuleId);
ListResponse<WebhookDispatchResponse> listWebhookDispatchHistory(ListWebhookDispatchHistoryCmd cmd);
boolean deleteWebhookDispatchHistory(DeleteWebhookDispatchHistoryCmd cmd) throws CloudRuntimeException;
WebhookDispatchResponse testWebhookDispatch(TestWebhookDispatchCmd cmd) throws CloudRuntimeException;
ListResponse<WebhookResponse> listWebhooks(ListWebhooksCmd cmd);
WebhookResponse createWebhook(CreateWebhookCmd cmd) throws CloudRuntimeException;
boolean deleteWebhook(DeleteRuleCmd cmd) throws CloudRuntimeException;
WebhookResponse updateWebhook(UpdateWebhookCmd cmd) throws CloudRuntimeException;
WebhookResponse createWebhookResponse(long webhookId);
ListResponse<WebhookDeliveryResponse> listWebhookDeliveries(ListWebhookDeliveries cmd);
boolean deleteWebhookDelivery(DeleteWebhookDeliveryCmd cmd) throws CloudRuntimeException;
WebhookDeliveryResponse executeWebhookDelivery(ExecuteWebhookDeliveryCmd cmd) throws CloudRuntimeException;
}
Loading