143e33581d529f21f12e29a83261102bc4986b30
[so.git] / adapters / mso-openstack-adapters / src / main / java / org / onap / so / heatbridge / openstack / api / OpenstackClient.java
1 /*-
2  * Copyright (C) 2018 Bell Canada. All rights reserved.
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
17 package org.onap.so.heatbridge.openstack.api;
18
19 import java.util.List;
20 import java.util.Map;
21 import org.openstack4j.model.compute.Server;
22 import org.openstack4j.model.heat.Resource;
23 import org.openstack4j.model.network.Network;
24 import org.openstack4j.model.network.Port;
25
26 public interface OpenstackClient {
27
28     /**
29      * Get a server object by server ID
30      * @param serverId Unique server-name (simple name) or server-id (UUID)
31      * @return Server object
32      */
33     Server getServerById(String serverId);
34
35     /**
36      * Get a port object by port ID
37      * @param portId Unique UUID of the port.
38      * @return Port object.
39      */
40     Port getPortById(String portId);
41
42     /**
43      * Returns a list of all ports we have the right to see
44      * @return List of all Openstack ports
45      */
46     List<Port> getAllPorts();
47
48     /**
49      * Returns a list of all the resources for the stack
50      * @param stackId Stack name or unique UUID
51      * @param nestingDepth The recursion level for which resources will be listed.
52      * @return List of Openstack Stack resources
53      */
54     List<Resource> getStackBasedResources(String stackId, int nestingDepth);
55
56     /**
57      * Get a network instance by network ID
58      * @param networkId Unique UUID of the network.
59      * @return Network object.
60      */
61     Network getNetworkById(String networkId);
62
63     /**
64      * List networks by filtering parameters
65      * @param filterParams key-value pairs for filtering params
66      * @return List of filtered Network objects
67      */
68     List<Network> listNetworksByFilter(Map<String, String> filterParams);
69 }