Aharoni, Pavel (pa0916) | ca3cb01 | 2018-10-22 15:29:57 +0300 | [diff] [blame] | 1 | /*-
|
| 2 | * ============LICENSE_START=======================================================
|
| 3 | * OSAM
|
| 4 | * ================================================================================
|
| 5 | * Copyright (C) 2018 AT&T
|
| 6 | * ================================================================================
|
| 7 | * Licensed under the Apache License, Version 2.0 (the "License");
|
| 8 | * you may not use this file except in compliance with the License.
|
| 9 | * You may obtain a copy of the License at
|
| 10 | *
|
| 11 | * http://www.apache.org/licenses/LICENSE-2.0
|
| 12 | *
|
| 13 | * Unless required by applicable law or agreed to in writing, software
|
| 14 | * distributed under the License is distributed on an "AS IS" BASIS,
|
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 16 | * See the License for the specific language governing permissions and
|
| 17 | * limitations under the License.
|
| 18 | * ============LICENSE_END=========================================================
|
| 19 | */
|
| 20 |
|
| 21 |
|
| 22 | package org.onap.osam.mso;
|
| 23 |
|
| 24 | import io.joshworks.restclient.http.HttpResponse;
|
| 25 | import io.joshworks.restclient.http.mapper.ObjectMapper;
|
| 26 | import lombok.SneakyThrows;
|
| 27 | import org.onap.osam.aai.util.CustomJacksonJaxBJsonProvider;
|
| 28 | import org.onap.osam.mso.rest.RequestDetails;
|
| 29 | import org.onap.osam.mso.rest.RequestDetailsWrapper;
|
| 30 |
|
| 31 | public interface MsoInterface {
|
| 32 |
|
| 33 | MsoResponseWrapper createSvcInstance(RequestDetails requestDetails, String endpoint);
|
| 34 |
|
| 35 | //For VoLTE E2E services
|
| 36 | MsoResponseWrapper createE2eSvcInstance(Object requestDetails, String endpoint);
|
| 37 | MsoResponseWrapper deleteE2eSvcInstance(Object requestDetails, String endpoint);
|
| 38 |
|
| 39 | /**
|
| 40 | * will create a virtual network function using MSO service.
|
| 41 | * @param requestDetails - information about the vnf to create
|
| 42 | * @return - the response body recived from MSO
|
| 43 | * @throws Exception
|
| 44 | */
|
| 45 | MsoResponseWrapper createVnf(RequestDetails requestDetails, String endpoint);
|
| 46 |
|
| 47 | MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String endpoint);
|
| 48 | /**
|
| 49 | *
|
| 50 | * @param requestDetails
|
| 51 | * @param path
|
| 52 | * @return
|
| 53 | * @throws Exception
|
| 54 | */
|
| 55 | MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String path);
|
| 56 |
|
| 57 | /**
|
| 58 | *
|
| 59 | * @param requestDetails
|
| 60 | * @return
|
| 61 | * @throws Exception
|
| 62 | */
|
| 63 | MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String endpoint);
|
| 64 |
|
| 65 | MsoResponseWrapper createConfigurationInstance(org.onap.osam.mso.rest.RequestDetailsWrapper requestDetailsWrapper, String endpoint);
|
| 66 |
|
| 67 | MsoResponseWrapper scaleOutVFModuleInstance(RequestDetailsWrapper requestDetailsWrapper, String endpoint);
|
| 68 |
|
| 69 | MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint);
|
| 70 |
|
| 71 | MsoResponseWrapper unassignSvcInstance(RequestDetails requestDetails, String endpoint);
|
| 72 |
|
| 73 | MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String endpoint);
|
| 74 |
|
| 75 | MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String endpoint);
|
| 76 |
|
| 77 | MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String endpoint);
|
| 78 |
|
| 79 | MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String endpoint);
|
| 80 |
|
| 81 | MsoResponseWrapper getOrchestrationRequest(String endpoint);
|
| 82 |
|
| 83 | MsoResponseWrapper getOrchestrationRequestsForDashboard(String t , String sourceId , String endpoint , RestObject restObject);
|
| 84 |
|
| 85 | MsoResponseWrapper getManualTasksByRequestId(String t , String sourceId , String endpoint , RestObject restObject);
|
| 86 |
|
| 87 | MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject restObject);
|
| 88 |
|
| 89 | //MsoResponseWrapper updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint);
|
| 90 |
|
| 91 | //MsoResponseWrapper replaceVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint);
|
| 92 |
|
| 93 | MsoResponseWrapper deleteConfiguration(org.onap.osam.mso.rest.RequestDetailsWrapper requestDetailsWrapper, String pmc_endpoint);
|
| 94 |
|
| 95 | MsoResponseWrapper setConfigurationActiveStatus(RequestDetails requestDetails, String endpoint);
|
| 96 |
|
| 97 | MsoResponseWrapper setPortOnConfigurationStatus(RequestDetails requestDetails, String endpoint);
|
| 98 |
|
| 99 | void setServiceInstanceStatus(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject);
|
| 100 |
|
| 101 | MsoResponseWrapperInterface changeManagementUpdate(RequestDetailsWrapper requestDetails, String endpoint);
|
| 102 |
|
| 103 | MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String endpoint);
|
| 104 |
|
| 105 | MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String addRelationshipsPath);
|
| 106 |
|
| 107 | <T> HttpResponse<T> get(String path, Class<T> responseClass);
|
| 108 |
|
| 109 | <T> HttpResponse<T> post(String path, RequestDetailsWrapper requestDetailsWrapper,
|
| 110 | Class<T> responseClass);
|
| 111 |
|
| 112 | static ObjectMapper objectMapper() {
|
| 113 | return new ObjectMapper() {
|
| 114 | CustomJacksonJaxBJsonProvider mapper = new CustomJacksonJaxBJsonProvider();
|
| 115 |
|
| 116 | @SneakyThrows
|
| 117 | @Override
|
| 118 | public <T> T readValue(String s, Class<T> aClass) {
|
| 119 | return mapper.getMapper().readValue(s, aClass);
|
| 120 | }
|
| 121 |
|
| 122 | @SneakyThrows
|
| 123 | @Override
|
| 124 | public String writeValue(Object o) {
|
| 125 | return mapper.getMapper().writeValueAsString(o);
|
| 126 | }
|
| 127 | };
|
| 128 | }
|
| 129 | }
|
| 130 |
|