2 * Copyright (C) 2018 Bell Canada. All rights reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.onap.so.heatbridge.openstack.api;
19 import java.util.List;
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;
26 public interface OpenstackClient {
29 * Get a server object by server ID
30 * @param serverId Unique server-name (simple name) or server-id (UUID)
31 * @return Server object
33 Server getServerById(String serverId);
36 * Get a port object by port ID
37 * @param portId Unique UUID of the port.
38 * @return Port object.
40 Port getPortById(String portId);
43 * Returns a list of all ports we have the right to see
44 * @return List of all Openstack ports
46 List<Port> getAllPorts();
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
54 List<Resource> getStackBasedResources(String stackId, int nestingDepth);
57 * Get a network instance by network ID
58 * @param networkId Unique UUID of the network.
59 * @return Network object.
61 Network getNetworkById(String networkId);
64 * List networks by filtering parameters
65 * @param filterParams key-value pairs for filtering params
66 * @return List of filtered Network objects
68 List<Network> listNetworksByFilter(Map<String, String> filterParams);