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",
12 UPGRADE_VNF_ACTION = "UPGRADE_VNF_ACTION",
13 UNDO_UPGRADE_VNF_ACTION = "UNDO_UPGRADE_VNF_ACTION"
16 export enum VNFMethods{
18 UNDO_UPGRADE = "undoUpgrade"
22 export interface CreateVnfInstanceAction extends Action {
23 vnfInstance?: VnfInstance;
24 vnfModelName?: string;
29 export interface UpdateVnfPosition extends Action {
35 export interface UpdateVnfInstanceAction extends Action {
36 vnfInstance?: VnfInstance;
37 vnfModelName?: string;
42 export interface UpgradeVnfAction extends Action {
47 export interface UndoUpgradeVnfAction extends Action {
52 export interface RemoveVnfInstanceAction extends Action {
57 export const createVNFInstance: ActionCreator<CreateVnfInstanceAction> = (vnfInstance, vnfModelName, serviceUuid, vnfStoreKey) => ({
58 type: VNFActions.CREATE_VNF_INSTANCE,
59 vnfInstance: vnfInstance,
60 vnfModelName: vnfModelName,
61 serviceUuid: serviceUuid,
62 vnfStoreKey : vnfStoreKey
66 export const updateVNFInstance: ActionCreator<UpdateVnfInstanceAction> = (vnfInstance, vnfModelName, serviceUuid, vnfStoreKey) => ({
67 type: VNFActions.UPDATE_VNF_INSTANCE,
68 vnfInstance: vnfInstance,
69 vnfModelName: vnfModelName,
70 serviceUuid: serviceUuid,
71 vnfStoreKey : vnfStoreKey
75 export const deleteActionVnfInstance: ActionCreator<ActionOnFirstLevel> = (vnfStoreKey, serviceId) => ({
76 type: VNFActions.DELETE_ACTION_VNF_INSTANCE,
77 firstLevelName: 'vnfs',
78 storeKey: vnfStoreKey,
82 export const undoDeleteActionVnfInstance: ActionCreator<ActionOnFirstLevel> = (vnfStoreKey, serviceId) => ({
83 type: VNFActions.UNDO_DELETE_ACTION_VNF_INSTANCE,
84 firstLevelName: 'vnfs',
85 storeKey: vnfStoreKey,
89 export const removeVnfInstance: ActionCreator<RemoveVnfInstanceAction> = (vnfStoreKey, serviceId) => ({
90 type: VNFActions.REMOVE_VNF_INSTANCE,
91 vnfStoreKey: vnfStoreKey,
95 export const updateVnfPosition: ActionCreator<UpdateVnfPosition> = (node, instanceId, vnfStoreKey) => ({
96 type: VNFActions.UPDATE_VNF_POSITION,
98 instanceId: instanceId,
99 vnfStoreKey : vnfStoreKey
102 export const upgradeVnf: ActionCreator<UpgradeVnfAction> = (vnfStoreKey, serviceUuid) => ({
103 type: VNFActions.UPGRADE_VNF_ACTION,
108 export const undoUpgradeVnf: ActionCreator<UndoUpgradeVnfAction> = (vnfStoreKey, serviceUuid) => ({
109 type: VNFActions.UNDO_UPGRADE_VNF_ACTION,