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
31 * @param serverId Unique server-name (simple name) or server-id (UUID)
32 * @return Server object
34 Server getServerById(String serverId);
37 * Get a port object by port ID
39 * @param portId Unique UUID of the port.
40 * @return Port object.
42 Port getPortById(String portId);
45 * Returns a list of all ports we have the right to see
47 * @return List of all Openstack ports
49 List<Port> getAllPorts();
52 * Returns a list of all the resources for the stack
54 * @param stackId Stack name or unique UUID
55 * @param nestingDepth The recursion level for which resources will be listed.
56 * @return List of Openstack Stack resources
58 List<Resource> getStackBasedResources(String stackId, int nestingDepth);
61 * Get a network instance by network ID
63 * @param networkId Unique UUID of the network.
64 * @return Network object.
66 Network getNetworkById(String networkId);
69 * List networks by filtering parameters
71 * @param filterParams key-value pairs for filtering params
72 * @return List of filtered Network objects
74 List<Network> listNetworksByFilter(Map<String, String> filterParams);