Add SvcLogicContext interaction with netbox-client
[ccsdk/sli/adaptors.git] / netbox-client / provider / src / main / java / org / onap / ccsdk / sli / adaptors / netbox / api / NetboxClient.java
1 /*
2  * Copyright (C) 2018 Bell Canada.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.onap.ccsdk.sli.adaptors.netbox.api;
17
18 import java.util.Map;
19 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
20 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
21 import org.onap.ccsdk.sli.core.sli.SvcLogicResource.QueryStatus;
22
23 /**
24  * This client is meant to interact both with the IPAM system, and the SDNC DB, in order to provide, at any time,
25  * an up to date status of the assigned resources.
26  */
27 public interface NetboxClient extends SvcLogicJavaPlugin {
28
29     /**
30      * Assign next available IP in prefix and store it in the SDNC database, table IPAM_IP_ASSIGNEMENT.
31      *
32      * @param parameters HashMap<String,String> of parameters passed by the DG to this function
33      * <table border="1">
34      * <thead><th>parameter</th><th>Mandatory/Optional</th><th>description</th></thead>
35      * <tbody>
36      * <tr><td>service_instance_id</td><td>Mandatory</td><td>The service instance ID uniquely identifying the service.</td></tr>
37      * <tr><td>vf_module_id</td><td>Mandatory</td><td>The VF module ID uniquely identifying the VF.</td></tr>
38      * <tr><td>prefix_id</td><td>Mandatory</td><td>The prefix from which to get next available IP.</td></tr>
39      * </tbody>
40      * </table>
41      */
42     QueryStatus assignIpAddress(Map<String, String> parameters, SvcLogicContext ctx);
43
44     /**
45      * Release the IP and update the entry in the SDNC database, table IPAM_IP_ASSIGNEMENT.
46      *
47      * @param parameters HashMap<String,String> of parameters passed by the DG to this function
48      * <table border="1">
49      * <thead><th>parameter</th><th>Mandatory/Optional</th><th>description</th></thead>
50      * <tbody>
51      * <tr><td>service_instance_id</td><td>Mandatory</td><td>The service instance ID uniquely identifying the service.</td></tr>
52      * <tr><td>vf_module_id</td><td>Mandatory</td><td>The VF module ID uniquely identifying the VF.</td></tr>
53      * <tr><td>ip_address_id</td><td>Mandatory</td><td>The IP to release.</td></tr>
54      * </tbody>
55      * </table>
56      */
57     QueryStatus unassignIpAddress(Map<String, String> parameters, SvcLogicContext ctx);
58 }
59