2  * ============LICENSE_START=======================================================
 
   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
 
  11  *      http://www.apache.org/licenses/LICENSE-2.0
 
  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=========================================================
 
  22  * Copyright (C) 2018 Bell Canada. All rights reserved.
 
  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
 
  28  *      http://www.apache.org/licenses/LICENSE-2.0
 
  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.
 
  37 package org.onap.so.heatbridge.openstack.api;
 
  39 import java.util.List;
 
  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;
 
  47 public interface OpenstackClient {
 
  50      * Get a server object by server ID
 
  52      * @param serverId Unique server-name (simple name) or server-id (UUID)
 
  53      * @return Server object
 
  55     Server getServerById(String serverId);
 
  58      * Get a port object by port ID
 
  60      * @param portId Unique UUID of the port.
 
  61      * @return Port object.
 
  63     Port getPortById(String portId);
 
  66      * Returns a list of all ports we have the right to see
 
  68      * @return List of all Openstack ports
 
  70     List<Port> getAllPorts();
 
  73      * Returns a list of all the resources for the stack
 
  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
 
  79     List<Resource> getStackBasedResources(String stackId, int nestingDepth);
 
  82      * Get a network instance by network ID
 
  84      * @param networkId Unique UUID of the network.
 
  85      * @return Network object.
 
  87     Network getNetworkById(String networkId);
 
  90      * List networks by filtering parameters
 
  92      * @param filterParams key-value pairs for filtering params
 
  93      * @return List of filtered Network objects
 
  95     List<Network> listNetworksByFilter(Map<String, String> filterParams);
 
  98      * Get a subnet object by subnet ID
 
 100      * @param subnetId Unique UUID of the subnet.
 
 101      * @return Subnet object.
 
 103     Subnet getSubnetById(String subnetId);