Merge "add fluent type builder support to A&AI client"
[so.git] / adapters / etsi-sol003-adapter / etsi-sol003-lcm / etsi-sol003-lcm-adapter / src / main / java / org / onap / so / adapters / etsi / sol003 / adapter / lcm / extclients / vnfm / VnfmServiceProvider.java
1 /*-
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
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
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.
16  *
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm;
22
23 import org.onap.aai.domain.yang.EsrVnfm;
24 import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.CreateVnfRequest;
25 import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse200;
26 import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse2001;
27 import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InlineResponse201;
28 import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.InstantiateVnfRequest;
29 import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.LccnSubscriptionRequest;
30 import org.onap.so.adapters.etsi.sol003.adapter.lcm.extclients.vnfm.model.TerminateVnfRequest;
31 import com.google.common.base.Optional;
32
33 /**
34  * Provides methods for invoking REST calls to a VNFM.
35  */
36 public interface VnfmServiceProvider {
37
38     /**
39      * Invoke a get request for a VNF.
40      *
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
44      */
45     Optional<InlineResponse201> getVnf(final EsrVnfm vnfm, final String vnfSelfLink);
46
47     /**
48      * Invoke an instantiate request for a VNF.
49      *
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
54      */
55     String instantiateVnf(final EsrVnfm vnfm, final String vnfSelfLink,
56             final InstantiateVnfRequest instantiateVnfRequest);
57
58     /**
59      * Invoke a notification subscription request to a VNFM.
60      *
61      * @param vnfm the VNFM in AAI
62      * @param subscriptionRequest
63      * @return the response to the subscription request
64      */
65     InlineResponse2001 subscribeForNotifications(final EsrVnfm vnfm, final LccnSubscriptionRequest subscriptionRequest);
66
67     /**
68      * Invoke a terminate request for a VNF.
69      *
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
74      */
75     String terminateVnf(final EsrVnfm vnfm, final String vnfSelfLink, final TerminateVnfRequest terminateVnfRequest);
76
77     /**
78      * Invoke a delete request for a VNF.
79      *
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
83      */
84     void deleteVnf(final EsrVnfm vnfm, final String vnfSelfLink);
85
86     /**
87      * Invoke a get request for a VNFM operation.
88      *
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
92      */
93     Optional<InlineResponse200> getOperation(final EsrVnfm vnfm, final String operationId);
94
95     /**
96      * Invoke a create request to a VNFM
97      *
98      * @param vnfm the VNFM in AAI
99      * @param createVnfRequest the parameters for creating a VNF
100      * @return the newly created VNF
101      */
102     Optional<InlineResponse201> createVnf(final EsrVnfm vnfm, final CreateVnfRequest createVnfRequest);
103
104 }