1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
import {ServiceInstance} from "../../../models/serviceInstance";
import {ServiceInstanceActions} from "../../../models/serviceInstanceActions";
import {Action, ActionCreator} from "redux";
export enum ServiceActions {
CREATE_SERVICE_INSTANCE = 'CREATE_SERVICE_INSTANCE',
UPDATE_SERVICE_INSTANCE = 'UPDATE_SERVICE_INSTANCE',
DELETE_ALL_SERVICE_INSTANCES = 'DELETE_ALL_SERVICE_INSTANCES',
UPDATE_MODEL = 'UPDATE_MODEL',
ADD_SERVICE_ACTION = 'ADD_SERVICE_ACTION',
DELETE_ACTION_SERVICE_INSTANCE = "DELETE_ACTION_SERVICE_INSTANCE",
UNDO_DELETE_ACTION_SERVICE_INSTANCE = "UNDO_DELETE_ACTION_SERVICE_INSTANCE",
CHANGE_SERVICE_IS_DIRTY = "CHANGE_SERVICE_IS_DIRTY"
}
export interface CreateServiceInstanceAction extends Action {
serviceUuid?: string;
serviceInstance?: ServiceInstance;
}
export interface UpdateServiceInstanceAction extends Action {
serviceUuid?: string;
serviceInstance?: ServiceInstance;
}
export interface DeleteServiceInstanceAction extends Action {
serviceUuid?: string;
}
export interface DeleteServiceInstanceAction extends Action {
serviceUuid?: string;
}
export interface UpdateServiceModelAction extends Action {
serviceHierarchy?: any;
}
export interface AddServiceAction extends Action{
serviceUuid: string;
action: ServiceInstanceActions;
}
export interface DeleteActionServiceInstanceAction extends Action {
serviceId?: string;
}
export interface UndoDeleteActionServiceInstanceAction extends Action {
serviceId?: string;
}
export interface ChangeServiceDirty extends Action {
nodes: any[];
serviceId : string;
}
export const addServiceAction: ActionCreator<AddServiceAction> = (serviceUuid : string, actionName : ServiceInstanceActions) => ({
type: ServiceActions.ADD_SERVICE_ACTION,
serviceUuid: serviceUuid,
action : actionName
});
export const deleteAllServiceInstances: ActionCreator<DeleteServiceInstanceAction> = () => ({
type: ServiceActions.DELETE_ALL_SERVICE_INSTANCES
});
export const createServiceInstance: ActionCreator<CreateServiceInstanceAction> = (serviceInstance, serviceUuid) => ({
type: ServiceActions.CREATE_SERVICE_INSTANCE,
serviceInstance: serviceInstance,
serviceUuid: serviceUuid
});
export const updateServiceInstance: ActionCreator<UpdateServiceInstanceAction> = (serviceInstance, serviceUuid) => ({
type: ServiceActions.UPDATE_SERVICE_INSTANCE,
serviceInstance: serviceInstance,
serviceUuid: serviceUuid
});
export const updateModel: ActionCreator<UpdateServiceModelAction> = serviceHierarchy => ({
type: ServiceActions.UPDATE_MODEL,
serviceHierarchy: serviceHierarchy
});
export const deleteActionServiceInstance: ActionCreator<DeleteActionServiceInstanceAction> = (vnfStoreKey, serviceId) => ({
type: ServiceActions.DELETE_ACTION_SERVICE_INSTANCE,
serviceId: serviceId
});
export const undoDeleteActionServiceInstance: ActionCreator<UndoDeleteActionServiceInstanceAction> = (vnfStoreKey, serviceId) => ({
type: ServiceActions.UNDO_DELETE_ACTION_SERVICE_INSTANCE,
serviceId: serviceId
});
export const changeServiceIsDirty: ActionCreator<ChangeServiceDirty> = (nodes, serviceId) => ({
type: ServiceActions.CHANGE_SERVICE_IS_DIRTY,
nodes: nodes,
serviceId : serviceId
});
|