Add Semicolon at the end
[vid.git] / vid-webpack-master / src / app / shared / storeUtil / utils / vnf / vnf.actions.ts
1 import {Action, ActionCreator} from "redux";
2 import {VnfInstance} from "../../../models/vnfInstance";
3 import {ActionOnFirstLevel} from "../firstLevel/firstLevel.actions";
4
5 export enum VNFActions {
6   CREATE_VNF_INSTANCE = "CREATE_VNF_INSTANCE",
7   UPDATE_VNF_INSTANCE = "UPDATE_VNF_INSTANCE",
8   REMOVE_VNF_INSTANCE = "REMOVE_VNF_INSTANCE",
9   DELETE_ACTION_VNF_INSTANCE = "DELETE_VNF_INSTANCE",
10   UNDO_DELETE_ACTION_VNF_INSTANCE = "UNDO_DELETE_VNF_INSTANCE",
11   UPDATE_VNF_POSITION = "UPDATE_VNF_POISTION"
12 }
13
14
15 export interface CreateVnfInstanceAction extends Action {
16   vnfInstance?: VnfInstance;
17   vnfModelName?: string;
18   serviceUuid?: string;
19   vnfStoreKey?:string;
20 }
21
22 export interface UpdateVnfPosition extends Action {
23   node: any,
24   instanceId : string,
25   vnfStoreKey?: string;
26 }
27
28 export interface UpdateVnfInstanceAction extends Action {
29   vnfInstance?: VnfInstance;
30   vnfModelName?: string;
31   serviceUuid?: string;
32   vnfStoreKey?:string;
33 }
34
35 export interface RemoveVnfInstanceAction extends Action {
36   vnfStoreKey: string;
37   serviceId?: string;
38 }
39
40 export const createVNFInstance: ActionCreator<CreateVnfInstanceAction> = (vnfInstance, vnfModelName, serviceUuid, vnfStoreKey) => ({
41   type: VNFActions.CREATE_VNF_INSTANCE,
42   vnfInstance: vnfInstance,
43   vnfModelName: vnfModelName,
44   serviceUuid: serviceUuid,
45   vnfStoreKey : vnfStoreKey
46 });
47
48
49 export const updateVNFInstance: ActionCreator<UpdateVnfInstanceAction> = (vnfInstance, vnfModelName, serviceUuid, vnfStoreKey) => ({
50   type: VNFActions.UPDATE_VNF_INSTANCE,
51   vnfInstance: vnfInstance,
52   vnfModelName: vnfModelName,
53   serviceUuid: serviceUuid,
54   vnfStoreKey : vnfStoreKey
55 });
56
57
58 export const deleteActionVnfInstance: ActionCreator<ActionOnFirstLevel> = (vnfStoreKey, serviceId) => ({
59   type: VNFActions.DELETE_ACTION_VNF_INSTANCE,
60   firstLevelName: 'vnfs',
61   storeKey: vnfStoreKey,
62   serviceId: serviceId
63 });
64
65 export const undoDeleteActionVnfInstance: ActionCreator<ActionOnFirstLevel> = (vnfStoreKey, serviceId) => ({
66   type: VNFActions.UNDO_DELETE_ACTION_VNF_INSTANCE,
67   firstLevelName: 'vnfs',
68   storeKey: vnfStoreKey,
69   serviceId: serviceId
70 });
71
72 export const removeVnfInstance: ActionCreator<RemoveVnfInstanceAction> = (vnfStoreKey, serviceId) => ({
73   type: VNFActions.REMOVE_VNF_INSTANCE,
74   vnfStoreKey: vnfStoreKey,
75   serviceId: serviceId
76 });
77
78 export const updateVnfPosition: ActionCreator<UpdateVnfPosition> = (node, instanceId, vnfStoreKey) => ({
79   type: VNFActions.UPDATE_VNF_POSITION,
80   node: node,
81   instanceId: instanceId,
82   vnfStoreKey : vnfStoreKey
83 });
84
85
86
87
88
89
90