2  * ============LICENSE_START=======================================================
 
   3  *  Copyright (C) 2019 Nordix Foundation.
 
   4  * ================================================================================
 
   5  * Licensed under the Apache License, Version 2.0 (the "License");
 
   6  * you may not use this file except in compliance with the License.
 
   7  * You may obtain a copy of the License at
 
   9  *      http://www.apache.org/licenses/LICENSE-2.0
 
  11  * Unless required by applicable law or agreed to in writing, software
 
  12  * distributed under the License is distributed on an "AS IS" BASIS,
 
  13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
  14  * See the License for the specific language governing permissions and
 
  15  * limitations under the License.
 
  17  * SPDX-License-Identifier: Apache-2.0
 
  18  * ============LICENSE_END=========================================================
 
  21 package org.onap.so.adapters.vnfmadapter.extclients.vnfm;
 
  23 import com.google.common.base.Optional;
 
  24 import org.onap.aai.domain.yang.EsrVnfm;
 
  25 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.CreateVnfRequest;
 
  26 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse200;
 
  27 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse2001;
 
  28 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InlineResponse201;
 
  29 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.InstantiateVnfRequest;
 
  30 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.LccnSubscriptionRequest;
 
  31 import org.onap.so.adapters.vnfmadapter.extclients.vnfm.model.TerminateVnfRequest;
 
  34  * Provides methods for invoking REST calls to a VNFM.
 
  36 public interface VnfmServiceProvider {
 
  39      * Invoke a get request for a VNF.
 
  41      * @param vnfm the VNFM in AAI
 
  42      * @param vnfSelfLink the link to the VNF in the VNFM
 
  43      * @return the VNF from the VNFM
 
  45     Optional<InlineResponse201> getVnf(final EsrVnfm vnfm, final String vnfSelfLink);
 
  48      * Invoke an instantiate request for a VNF.
 
  50      * @param vnfm the VNFM in AAI
 
  51      * @param vnfSelfLink the link to he VNF on the VNFM
 
  52      * @param instantiateVnfRequest the instantiate request
 
  53      * @return the operation ID of the instantiation operation
 
  55     String instantiateVnf(final EsrVnfm vnfm, final String vnfSelfLink,
 
  56             final InstantiateVnfRequest instantiateVnfRequest);
 
  59      * Invoke a notification subscription request to a VNFM.
 
  61      * @param vnfm the VNFM in AAI
 
  62      * @param subscriptionRequest
 
  63      * @return the response to the subscription request
 
  65     InlineResponse2001 subscribeForNotifications(final EsrVnfm vnfm, final LccnSubscriptionRequest subscriptionRequest);
 
  68      * Invoke a terminate request for a VNF.
 
  70      * @param vnfm the VNFM in AAI
 
  71      * @param vnfSelfLink the link to he VNF on the VNFM
 
  72      * @param terminateVnfRequest the terminate request
 
  73      * @return the operation ID of the termination operation
 
  75     String terminateVnf(final EsrVnfm vnfm, final String vnfSelfLink, final TerminateVnfRequest terminateVnfRequest);
 
  78      * Invoke a delete request for a VNF.
 
  80      * @param vnfm the VNFM in AAI
 
  81      * @param vnfSelfLink the link to he VNF on the VNFM
 
  82      * @return the operation ID of the instantiation operation
 
  84     void deleteVnf(final EsrVnfm vnfm, final String vnfSelfLink);
 
  87      * Invoke a get request for a VNFM operation.
 
  89      * @param vnfm the VNFM in AAI
 
  90      * @param operationId the id of the operation on the VNFM
 
  91      * @return the operation from the VNFM
 
  93     Optional<InlineResponse200> getOperation(final EsrVnfm vnfm, final String operationId);
 
  96      * Invoke a create request to a VNFM
 
  98      * @param vnfm the VNFM in AAI
 
  99      * @param createVnfRequest the parameters for creating a VNF
 
 100      * @return the newly created VNF
 
 102     Optional<InlineResponse201> createVnf(final EsrVnfm vnfm, final CreateVnfRequest createVnfRequest);