Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / mso / MsoInterface.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * Modifications Copyright (C) 2018 Nokia. All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21 package org.onap.vid.mso;
22
23 import io.joshworks.restclient.http.HttpResponse;
24 import org.onap.vid.changeManagement.RequestDetailsWrapper;
25 import org.onap.vid.mso.rest.RequestDetails;
26
27 /**
28  * Created by pickjonathan on 21/06/2017.
29  */
30 public interface MsoInterface {
31
32     /**
33      * This function will post MSO service with information about how to instantiate the requested service
34      * @param requestDetails The details about the service as they come from the web.
35      * @return MsoResponseWrapper containing information about the service instantiation
36      * --> success : see JSON at resources folder mso_create_instance_response.
37      * --> failure : would return 200 with failure data.
38      * @throws Exception
39      */
40     MsoResponseWrapper createSvcInstance(RequestDetails requestDetails, String endpoint);
41
42     //For VoLTE E2E services
43     MsoResponseWrapper createE2eSvcInstance(Object requestDetails, String endpoint);
44     MsoResponseWrapper deleteE2eSvcInstance(Object requestDetails, String endpoint);
45
46     /**
47      * will create a virtual network function using MSO service.
48      * @param requestDetails - information about the vnf to create
49      * @return - the response body recived from MSO
50      * @throws Exception
51      */
52     MsoResponseWrapper createVnf(RequestDetails requestDetails, String endpoint);
53
54     MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String endpoint);
55     /**
56      *
57      * @param requestDetails
58      * @param path
59      * @return
60      * @throws Exception
61      */
62     MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String path);
63
64     /**
65      *
66      * @param requestDetails
67      * @return
68      * @throws Exception
69      */
70     MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String endpoint);
71
72     MsoResponseWrapper createConfigurationInstance(org.onap.vid.mso.rest.RequestDetailsWrapper requestDetailsWrapper, String endpoint);
73
74     MsoResponseWrapper scaleOutVFModuleInstance(RequestDetailsWrapper requestDetailsWrapper, String endpoint);
75
76     MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint);
77
78     MsoResponseWrapper unassignSvcInstance(RequestDetails requestDetails, String endpoint);
79
80     MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String endpoint);
81
82     MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String endpoint);
83
84     MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String endpoint);
85
86     MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String endpoint);
87
88     MsoResponseWrapper getOrchestrationRequest(String t, String sourceId, String endpoint, RestObject restObject, boolean warpException);
89
90     MsoResponseWrapper getOrchestrationRequest(String endpoint);
91
92     MsoResponseWrapper getManualTasksByRequestId(String t , String sourceId , String endpoint , RestObject restObject);
93
94     MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject restObject);
95
96         MsoResponseWrapper updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String vnfEndpoint);
97
98         MsoResponseWrapper replaceVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String vnfEndpoint);
99
100     MsoResponseWrapper deleteConfiguration(org.onap.vid.mso.rest.RequestDetailsWrapper requestDetailsWrapper, String pmcEndpoint);
101
102     MsoResponseWrapper setConfigurationActiveStatus(RequestDetails requestDetails, String endpoint);
103
104     MsoResponseWrapper setPortOnConfigurationStatus(RequestDetails requestDetails, String endpoint);
105
106     void setServiceInstanceStatus(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject);
107
108     MsoResponseWrapperInterface changeManagementUpdate(RequestDetailsWrapper requestDetails, String endpoint);
109
110     MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String endpoint);
111
112     MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String addRelationshipsPath);
113
114     <T> HttpResponse<T> get(String path, Class<T> responseClass);
115
116     <T> HttpResponse<T> post(String path, RequestDetailsWrapper<?> requestDetailsWrapper,
117       Class<T> responseClass);
118 }
119