aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts')
-rw-r--r--vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts102
1 files changed, 102 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts b/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts
new file mode 100644
index 000000000..e4e7e494e
--- /dev/null
+++ b/vid-webpack-master/src/app/shared/storeUtil/utils/service/service.actions.ts
@@ -0,0 +1,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
+});
+
+