"Fossies" - the Fresh Open Source Software Archive

Member "tacker-4.0.0/tacker/vnfm/infra_drivers/abstract_driver.py" (14 Oct 2020, 4334 Bytes) of package /linux/misc/openstack/tacker-4.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "abstract_driver.py": 4.0.0_vs_5.0.0.

    1 # Copyright 2013, 2014 Intel Corporation.
    2 # All Rights Reserved.
    3 #
    4 #
    5 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    6 #    not use this file except in compliance with the License. You may obtain
    7 #    a copy of the License at
    8 #
    9 #         http://www.apache.org/licenses/LICENSE-2.0
   10 #
   11 #    Unless required by applicable law or agreed to in writing, software
   12 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   13 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   14 #    License for the specific language governing permissions and limitations
   15 #    under the License.
   16 
   17 import abc
   18 
   19 import six
   20 
   21 from tacker.api import extensions
   22 
   23 
   24 @six.add_metaclass(abc.ABCMeta)
   25 class VnfAbstractDriver(extensions.PluginInterface):
   26 
   27     @abc.abstractmethod
   28     def get_type(self):
   29         """Return one of predefined type of the hosting vnf drivers."""
   30         pass
   31 
   32     @abc.abstractmethod
   33     def get_name(self):
   34         """Return a symbolic name for the service VM plugin."""
   35         pass
   36 
   37     @abc.abstractmethod
   38     def get_description(self):
   39         pass
   40 
   41     @abc.abstractmethod
   42     def create(self, plugin, context, vnf):
   43         """Create vnf and return its id."""
   44 
   45     @abc.abstractmethod
   46     def create_wait(self, plugin, context, vnf_dict, vnf_id):
   47         """wait for vnf creation to complete."""
   48 
   49     @abc.abstractmethod
   50     def update(self, plugin, context, vnf_id, vnf_dict, vnf):
   51         # vnf_dict: old vnf_dict to be updated
   52         # vnf: update with vnf dict
   53         pass
   54 
   55     @abc.abstractmethod
   56     def update_wait(self, plugin, context, vnf_dict):
   57         pass
   58 
   59     @abc.abstractmethod
   60     def delete(self, plugin, context, vnf_id):
   61         pass
   62 
   63     @abc.abstractmethod
   64     def delete_wait(self, plugin, context, vnf_id):
   65         pass
   66 
   67     @abc.abstractmethod
   68     def get_resource_info(self, plugin, context, vnf_info, auth_attr,
   69                           region_name=None):
   70         '''Fetches optional details of a VNF'''
   71         pass
   72 
   73     @abc.abstractmethod
   74     def heal_vdu(self, plugin, context, vnf_dict, heal_request_data):
   75         pass
   76 
   77     @abc.abstractmethod
   78     def pre_instantiation_vnf(self, context, vnf_instance,
   79                               vim_connection_info, vnf_software_images):
   80         """Create resources required for instantiating Vnf.
   81 
   82         :param context: A RequestContext
   83         :param vnf_instance: Object tacker.objects.VnfInstance
   84         :vim_info: Credentials to initialize Vim connection
   85         :vnf_software_images: Dict of key:value pair,
   86           <VDU/Storage node name>:tacker.objects.VnfSoftwareImage.
   87         """
   88         pass
   89 
   90     @abc.abstractmethod
   91     def delete_vnf_instance_resource(self, context, vnf_instance,
   92             vim_connection_info, vnf_resource):
   93         pass
   94 
   95     @abc.abstractmethod
   96     def instantiate_vnf(self, context, vnf_instance, vnfd_dict,
   97                         vim_connection_info, instantiate_vnf_req,
   98                         grant_response):
   99         pass
  100 
  101     @abc.abstractmethod
  102     def post_vnf_instantiation(self, context, vnf_instance,
  103                                vim_connection_info):
  104         pass
  105 
  106     @abc.abstractmethod
  107     def heal_vnf(self, context, vnf_instance, vim_connection_info,
  108                  heal_vnf_request):
  109         """Heal vnf
  110 
  111         :param context: A RequestContext
  112         :param vnf_instance: tacker.objects.VnfInstance to be healed
  113         :vim_info: Credentials to initialize Vim connection
  114         :heal_vnf_request: tacker.objects.HealVnfRequest object containing
  115                            parameters passed in the heal request
  116         """
  117         pass
  118 
  119     @abc.abstractmethod
  120     def heal_vnf_wait(self, context, vnf_instance, vim_connection_info):
  121         """Check vnf is healed successfully"""
  122         pass
  123 
  124     @abc.abstractmethod
  125     def post_heal_vnf(self, context, vnf_instance, vim_connection_info,
  126                       heal_vnf_request):
  127         """Update resource_id for each vnfc resources
  128 
  129         :param context: A RequestContext
  130         :param vnf_instance: tacker.objects.VnfInstance to be healed
  131         :vim_info: Credentials to initialize Vim connection
  132         :heal_vnf_request: tacker.objects.HealVnfRequest object containing
  133                            parameters passed in the heal request
  134         """
  135         pass