7184ec1e9312ac73241b177d165f5ac54b0e963a
[so.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
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  * Copyright (C) 2018 Bell Canada. All rights reserved.
23  *
24  * Licensed under the Apache License, Version 2.0 (the "License");
25  * you may not use this file except in compliance with the License.
26  * You may obtain a copy of the License at
27  *
28  *      http://www.apache.org/licenses/LICENSE-2.0
29  *
30  * Unless required by applicable law or agreed to in writing, software
31  * distributed under the License is distributed on an "AS IS" BASIS,
32  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
33  * See the License for the specific language governing permissions and
34  * limitations under the License.
35  */
36
37 package org.onap.so.heatbridge.openstack.api;
38
39 import java.util.List;
40 import java.util.Map;
41 import org.openstack4j.model.compute.Server;
42 import org.openstack4j.model.heat.Resource;
43 import org.openstack4j.model.network.Network;
44 import org.openstack4j.model.network.Port;
45
46 public interface OpenstackClient {
47
48     /**
49      * Get a server object by server ID
50      * 
51      * @param serverId Unique server-name (simple name) or server-id (UUID)
52      * @return Server object
53      */
54     Server getServerById(String serverId);
55
56     /**
57      * Get a port object by port ID
58      * 
59      * @param portId Unique UUID of the port.
60      * @return Port object.
61      */
62     Port getPortById(String portId);
63
64     /**
65      * Returns a list of all ports we have the right to see
66      * 
67      * @return List of all Openstack ports
68      */
69     List<Port> getAllPorts();
70
71     /**
72      * Returns a list of all the resources for the stack
73      * 
74      * @param stackId Stack name or unique UUID
75      * @param nestingDepth The recursion level for which resources will be listed.
76      * @return List of Openstack Stack resources
77      */
78     List<Resource> getStackBasedResources(String stackId, int nestingDepth);
79
80     /**
81      * Get a network instance by network ID
82      * 
83      * @param networkId Unique UUID of the network.
84      * @return Network object.
85      */
86     Network getNetworkById(String networkId);
87
88     /**
89      * List networks by filtering parameters
90      * 
91      * @param filterParams key-value pairs for filtering params
92      * @return List of filtered Network objects
93      */
94     List<Network> listNetworksByFilter(Map<String, String> filterParams);
95 }