8d47ff4ceb1b0168e79cb364c507d1a9fbc91c77
[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 import org.openstack4j.model.network.Subnet;
46
47 public interface OpenstackClient {
48
49     /**
50      * Get a server object by server ID
51      * 
52      * @param serverId Unique server-name (simple name) or server-id (UUID)
53      * @return Server object
54      */
55     Server getServerById(String serverId);
56
57     /**
58      * Get a port object by port ID
59      * 
60      * @param portId Unique UUID of the port.
61      * @return Port object.
62      */
63     Port getPortById(String portId);
64
65     /**
66      * Returns a list of all ports we have the right to see
67      * 
68      * @return List of all Openstack ports
69      */
70     List<Port> getAllPorts();
71
72     /**
73      * Returns a list of all the resources for the stack
74      * 
75      * @param stackId Stack name or unique UUID
76      * @param nestingDepth The recursion level for which resources will be listed.
77      * @return List of Openstack Stack resources
78      */
79     List<Resource> getStackBasedResources(String stackId, int nestingDepth);
80
81     /**
82      * Get a network instance by network ID
83      * 
84      * @param networkId Unique UUID of the network.
85      * @return Network object.
86      */
87     Network getNetworkById(String networkId);
88
89     /**
90      * List networks by filtering parameters
91      * 
92      * @param filterParams key-value pairs for filtering params
93      * @return List of filtered Network objects
94      */
95     List<Network> listNetworksByFilter(Map<String, String> filterParams);
96
97     /**
98      * Get a subnet object by subnet ID
99      * 
100      * @param subnetId Unique UUID of the subnet.
101      * @return Subnet object.
102      */
103     Subnet getSubnetById(String subnetId);
104 }