X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=policy_module%2Fosm_policy_module%2Fcommon%2Flcm_client.py;h=be44efe361eb381909cfe2905de870bb2220119d;hb=d9a55971b0b87f0d43883f840478f6fbc5f62fde;hp=710b59acb6042aeb1589ca5c5a8dc68c4a446ae3;hpb=925ff50f55485470e3243c090d89ceb715e6518d;p=osm%2FMON.git diff --git a/policy_module/osm_policy_module/common/lcm_client.py b/policy_module/osm_policy_module/common/lcm_client.py index 710b59a..be44efe 100644 --- a/policy_module/osm_policy_module/common/lcm_client.py +++ b/policy_module/osm_policy_module/common/lcm_client.py @@ -1,3 +1,26 @@ +# -*- coding: utf-8 -*- + +# Copyright 2018 Whitestack, LLC +# ************************************************************* + +# This file is part of OSM Monitoring module +# All Rights Reserved to Whitestack, LLC + +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at + +# http://www.apache.org/licenses/LICENSE-2.0 + +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +# For those usages not covered by the Apache License, Version 2.0 please +# contact: bdiaz@whitestack.com or glavado@whitestack.com +## import json import logging @@ -17,13 +40,13 @@ class LcmClient: key_serializer=str.encode, value_serializer=str.encode) - def scale(self, nsr_id, name, action): + def scale(self, nsr_id: str, name: str, action: str): msg = self._create_scale_action_payload(nsr_id, name, action) log.info("Sending scale action message: %s", json.dumps(msg)) self.producer.send(topic='lcm_pm', key='trigger_scaling', value=json.dumps(msg)) self.producer.flush() - def _create_scale_action_payload(self, nsr_id, name, action): + def _create_scale_action_payload(self, nsr_id: str, name: str, action: str): msg = { "ns_id": nsr_id, "scaling_group_descriptor": {