"Fossies" - the Fresh Open Source Software Archive

Member "tacker-2.0.0/tacker/vnfm/policy_actions/autoscaling/autoscaling.py" (16 Oct 2019, 1367 Bytes) of package /linux/misc/openstack/tacker-2.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. For more information about "autoscaling.py" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 0.9.0_vs_1.0.0.

    1 #
    2 #    Licensed under the Apache License, Version 2.0 (the "License"); you may
    3 #    not use this file except in compliance with the License. You may obtain
    4 #    a copy of the License at
    5 #
    6 #         http://www.apache.org/licenses/LICENSE-2.0
    7 #
    8 #    Unless required by applicable law or agreed to in writing, software
    9 #    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
   10 #    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
   11 #    License for the specific language governing permissions and limitations
   12 #    under the License.
   13 #
   14 
   15 from oslo_log import log as logging
   16 
   17 from tacker.plugins.common import constants
   18 from tacker.vnfm.policy_actions import abstract_action
   19 from tacker.vnfm import utils as vnfm_utils
   20 
   21 LOG = logging.getLogger(__name__)
   22 
   23 
   24 class VNFActionAutoscaling(abstract_action.AbstractPolicyAction):
   25     def get_type(self):
   26         return 'autoscaling'
   27 
   28     def get_name(self):
   29         return 'autoscaling'
   30 
   31     def get_description(self):
   32         return 'Tacker VNF auto-scaling policy'
   33 
   34     def execute_action(self, plugin, context, vnf_dict, args):
   35         vnf_id = vnf_dict['id']
   36         vnfm_utils.log_events(context, vnf_dict,
   37                               constants.RES_EVT_MONITOR,
   38                               "ActionAutoscalingHeat invoked")
   39         plugin.create_vnf_scale(context, vnf_id, args)