1 import {Action, ActionCreator} from "redux";
2 import {VnfInstance} from "../../../models/vnfInstance";
3 import {ActionOnFirstLevel} from "../firstLevel/firstLevel.actions";
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"
15 export interface CreateVnfInstanceAction extends Action {
16 vnfInstance?: VnfInstance;
17 vnfModelName?: string;
22 export interface UpdateVnfPosition extends Action {
28 export interface UpdateVnfInstanceAction extends Action {
29 vnfInstance?: VnfInstance;
30 vnfModelName?: string;
35 export interface RemoveVnfInstanceAction extends Action {
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
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
58 export const deleteActionVnfInstance: ActionCreator<ActionOnFirstLevel> = (vnfStoreKey, serviceId) => ({
59 type: VNFActions.DELETE_ACTION_VNF_INSTANCE,
60 firstLevelName: 'vnfs',
61 storeKey: vnfStoreKey,
65 export const undoDeleteActionVnfInstance: ActionCreator<ActionOnFirstLevel> = (vnfStoreKey, serviceId) => ({
66 type: VNFActions.UNDO_DELETE_ACTION_VNF_INSTANCE,
67 firstLevelName: 'vnfs',
68 storeKey: vnfStoreKey,
72 export const removeVnfInstance: ActionCreator<RemoveVnfInstanceAction> = (vnfStoreKey, serviceId) => ({
73 type: VNFActions.REMOVE_VNF_INSTANCE,
74 vnfStoreKey: vnfStoreKey,
78 export const updateVnfPosition: ActionCreator<UpdateVnfPosition> = (node, instanceId, vnfStoreKey) => ({
79 type: VNFActions.UPDATE_VNF_POSITION,
81 instanceId: instanceId,
82 vnfStoreKey : vnfStoreKey