aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/service.actions.ts
blob: a62fec673d6e9ae022abff6401f30825a303c1b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
import { Action, ActionCreator } from "redux";
import { LcpRegionsAndTenants } from "./shared/models/lcpRegionsAndTenants";
import { ServiceInstance } from "./shared/models/serviceInstance";
import { SelectOptionInterface } from "./shared/models/selectOption";
import { ServiceType } from "./shared/models/serviceType";
import { VnfInstance } from "./shared/models/vnfInstance";

export const UPDATE_MODEL = "[MODEL] Update";
export const UPDATE_SERVICE_INSTANCE = "[SERVICE INSTANCE] Update";
export const UPDATE_VNF_INSTANCE = "[VNF INSTANCE] Update";
export const UPDATE_VF_MODULE = "[VF MODULE] Update";
export const CREATE_VF_MODULE = "[VF MODULE] Create";

export const UPDATE_LCP_REGIONS_AND_TENANTS = "[LCP_REGIONS_AND_TENANTS] Update";
export const UPDATE_SUBSCRIBERS = "[SUBSCRIBERS] Update";
export const UPDATE_PRODUCT_FAMILIES = "[PRODUCT_FAMILIES] Update";
export const UPDATE_SERVICE_TYPES = "[SERVICE_TYPE] Update";
export const UPDATE_AIC_ZONES = "[AIC_ZONES] Update";
export const DELETE_SERVICE_INSTANCE = "[SERVICE_INSTANCE] Delete";
export const DELETE_VNF_INSTANCE = "[VNF_INSTANCE] Delete";
export const DELETE_VNF_MODULE_INSTANCE = "[VNF_MODULE_INSTANCE] Delete";
export const UPDATE_CATEGORY_PARAMETERS = "[CATEGORY_PARAMETERS] Update";
export const UPDATE_NETWORK_FUNCTION = "[UPDATE_NETWORK_FUNCTION] Update";
export const UPDATE_USER_ID = "[UPDATE_USER_ID] Update";


export interface UpdateServiceModelAction extends Action {
  serviceHierarchy?: any;
}

export interface UpdateNetworkCollectionFunction extends Action {
  networksAccordingToNetworkCollection: any;
  network_function: any;
}

export interface UpdateServiceInstanceAction extends Action {
  serviceUuid?: string;
  serviceInstance?: ServiceInstance;
}

export interface UpdateVFModuleInstanceAction extends Action {
  vfInstance: any;
  vfId: string;
  serviceUuid: string;
}

export interface CreateVFModuleInstanceAction extends Action {
  vfInstance: any;
  vfId: string;
  serviceUuid: string;
  index : number
}

export interface UpdateUserIdAction extends Action {
  userId: string;
}

export interface UpdateVnfInstanceAction extends Action {
  vnfInstance?: VnfInstance;
  vnfModelName?: string;
  serviceUuid?: string;
}

export interface UpdateLcpRegionsAndTenantsAction extends Action {
  lcpRegionsAndTenants?: LcpRegionsAndTenants;
}

export interface UpdateSubscribersAction extends Action {
  subscribers?: SelectOptionInterface[];
}

export interface UpdateProductFamiliesAction extends Action {
  productFamilies?: SelectOptionInterface[];
}

export interface UpdateAicZonesAction extends Action {
  aicZones?: SelectOptionInterface[];
}

export interface UpdateServiceTypesAction extends Action {
  serviceTypes?: ServiceType[];
  subscriberId: string;
}

export interface DeleteServiceInstanceAction extends Action {
  serviceUuid?: string;
}

export interface DeleteVnfInstanceAction extends Action {
  modelName?: string;
  serviceModelId: string;
}

export interface DeleteVfModuleInstanceAction extends Action {
  modelName?: string;
  serviceModelId?: string;
  vfName?: string;
}

export interface UpdateCategoryParametersAction extends Action {
  categoryParameters?: string;
}

export const updateModel: ActionCreator<UpdateServiceModelAction> = serviceHierarchy => ({
  type: UPDATE_MODEL,
  serviceHierarchy: serviceHierarchy
});

export const updateServiceInstance: ActionCreator<UpdateServiceInstanceAction> = (serviceInstance, serviceUuid) => ({
  type: UPDATE_SERVICE_INSTANCE,
  serviceInstance: serviceInstance,
  serviceUuid: serviceUuid
});

export const updateVFModuleInstance: ActionCreator<UpdateVFModuleInstanceAction> = (vfInstance, vfId, serviceUuid) => ({
  type: UPDATE_VF_MODULE,
  vfInstance: vfInstance,
  vfId: vfId,
  serviceUuid: serviceUuid
})

export const createVFModuleInstance: ActionCreator<CreateVFModuleInstanceAction> = (vfInstance, vfId, serviceUuid, index) => ({
  type: CREATE_VF_MODULE,
  vfInstance: vfInstance,
  vfId: vfId,
  serviceUuid: serviceUuid,
  index : index
})



export const updateVNFInstance: ActionCreator<UpdateVnfInstanceAction> = (vnfInstance, vnfModelName, serviceUuid) => ({
  type: UPDATE_VNF_INSTANCE,
  vnfInstance: vnfInstance,
  vnfModelName: vnfModelName,
  serviceUuid: serviceUuid
});

export const updateLcpRegionsAndTenants: ActionCreator<UpdateLcpRegionsAndTenantsAction> = lcpRegionsAndTenants => ({
  type: UPDATE_LCP_REGIONS_AND_TENANTS,
  lcpRegionsAndTenants: lcpRegionsAndTenants
});

export const updateSubscribers: ActionCreator<UpdateSubscribersAction> = subscribers => ({
  type: UPDATE_SUBSCRIBERS,
  subscribers: subscribers
});

export const updateProductFamilies: ActionCreator<UpdateProductFamiliesAction> = productFamilies => ({
  type: UPDATE_PRODUCT_FAMILIES,
  productFamilies: productFamilies
});

export const updateAicZones: ActionCreator<UpdateAicZonesAction> = aicZones => ({
  type: UPDATE_AIC_ZONES,
  aicZones: aicZones
});

export const updateUserId: ActionCreator<UpdateUserIdAction> = userId => ({
  type: UPDATE_USER_ID,
  userId: userId
});

export const updateCategoryParameters: ActionCreator<UpdateCategoryParametersAction> = categoryParameters => ({
  type: UPDATE_CATEGORY_PARAMETERS,
  categoryParameters: categoryParameters
});

export const updateServiceTypes: ActionCreator<UpdateServiceTypesAction> = (serviceTypes, subscriberId) => ({
  type: UPDATE_SERVICE_TYPES,
  serviceTypes: serviceTypes,
  subscriberId: subscriberId
});

export const updateNetworkCollectionFunction: ActionCreator<UpdateNetworkCollectionFunction> = (ncf, networksAccordingToNetworkCollection) => ({
  type: UPDATE_NETWORK_FUNCTION,
  networksAccordingToNetworkCollection: networksAccordingToNetworkCollection["results"],
  network_function: ncf
});

export const deleteServiceInstance: ActionCreator<DeleteServiceInstanceAction> = serviceUuid => ({
  type: DELETE_SERVICE_INSTANCE,
  serviceUuid: serviceUuid
});

export const deleteVnfInstance: ActionCreator<DeleteVnfInstanceAction> = (modelName, serviceModelId) => ({
  type: DELETE_VNF_INSTANCE,
  modelName: modelName,
  serviceModelId: serviceModelId
});

export const deleteVfModuleInstance: ActionCreator<DeleteVfModuleInstanceAction> = (modelName, serviceModelId, vfName) => ({
  type: DELETE_VNF_MODULE_INSTANCE,
  modelName: modelName,
  serviceModelId: serviceModelId,
  vfName: vfName
});