1 import {ServiceInstance} from "../../../models/serviceInstance";
2 import {ServiceInstanceActions} from "../../../models/serviceInstanceActions";
3 import {Action, ActionCreator} from "redux";
5 export enum ServiceActions {
6 CREATE_SERVICE_INSTANCE = 'CREATE_SERVICE_INSTANCE',
7 UPDATE_SERVICE_INSTANCE = 'UPDATE_SERVICE_INSTANCE',
8 DELETE_ALL_SERVICE_INSTANCES = 'DELETE_ALL_SERVICE_INSTANCES',
9 UPDATE_MODEL = 'UPDATE_MODEL',
10 ADD_SERVICE_ACTION = 'ADD_SERVICE_ACTION',
11 DELETE_ACTION_SERVICE_INSTANCE = "DELETE_ACTION_SERVICE_INSTANCE",
12 UNDO_DELETE_ACTION_SERVICE_INSTANCE = "UNDO_DELETE_ACTION_SERVICE_INSTANCE",
13 CHANGE_SERVICE_IS_DIRTY = "CHANGE_SERVICE_IS_DIRTY"
16 export interface CreateServiceInstanceAction extends Action {
18 serviceInstance?: ServiceInstance;
21 export interface UpdateServiceInstanceAction extends Action {
23 serviceInstance?: ServiceInstance;
26 export interface DeleteServiceInstanceAction extends Action {
30 export interface DeleteServiceInstanceAction extends Action {
34 export interface UpdateServiceModelAction extends Action {
35 serviceHierarchy?: any;
38 export interface AddServiceAction extends Action{
40 action: ServiceInstanceActions;
44 export interface DeleteActionServiceInstanceAction extends Action {
48 export interface UndoDeleteActionServiceInstanceAction extends Action {
52 export interface ChangeServiceDirty extends Action {
57 export const addServiceAction: ActionCreator<AddServiceAction> = (serviceUuid : string, actionName : ServiceInstanceActions) => ({
58 type: ServiceActions.ADD_SERVICE_ACTION,
59 serviceUuid: serviceUuid,
64 export const deleteAllServiceInstances: ActionCreator<DeleteServiceInstanceAction> = () => ({
65 type: ServiceActions.DELETE_ALL_SERVICE_INSTANCES
68 export const createServiceInstance: ActionCreator<CreateServiceInstanceAction> = (serviceInstance, serviceUuid) => ({
69 type: ServiceActions.CREATE_SERVICE_INSTANCE,
70 serviceInstance: serviceInstance,
71 serviceUuid: serviceUuid
74 export const updateServiceInstance: ActionCreator<UpdateServiceInstanceAction> = (serviceInstance, serviceUuid) => ({
75 type: ServiceActions.UPDATE_SERVICE_INSTANCE,
76 serviceInstance: serviceInstance,
77 serviceUuid: serviceUuid
80 export const updateModel: ActionCreator<UpdateServiceModelAction> = serviceHierarchy => ({
81 type: ServiceActions.UPDATE_MODEL,
82 serviceHierarchy: serviceHierarchy
86 export const deleteActionServiceInstance: ActionCreator<DeleteActionServiceInstanceAction> = (vnfStoreKey, serviceId) => ({
87 type: ServiceActions.DELETE_ACTION_SERVICE_INSTANCE,
91 export const undoDeleteActionServiceInstance: ActionCreator<UndoDeleteActionServiceInstanceAction> = (vnfStoreKey, serviceId) => ({
92 type: ServiceActions.UNDO_DELETE_ACTION_SERVICE_INSTANCE,
96 export const changeServiceIsDirty: ActionCreator<ChangeServiceDirty> = (nodes, serviceId) => ({
97 type: ServiceActions.CHANGE_SERVICE_IS_DIRTY,