From 0b80c76c3b9a5b0d28c5e850ed05426077c0841f Mon Sep 17 00:00:00 2001 From: Luka Peschke Date: Wed, 7 Mar 2018 12:07:17 +0100 Subject: [PATCH] Deprecate collector mappings Change-Id: I4c93d5829ebc3a0cb81ce1a3e464d16cb6438341 Task: 6587 Story: 2001612 --- cloudkitty/api/v1/controllers/collector.py | 7 +++++++ .../deprecate-collector-mappings-5a69b31c8037fc01.yaml | 5 +++++ 2 files changed, 12 insertions(+) create mode 100644 releasenotes/notes/deprecate-collector-mappings-5a69b31c8037fc01.yaml diff --git a/cloudkitty/api/v1/controllers/collector.py b/cloudkitty/api/v1/controllers/collector.py index a138bfbc..a4ef0316 100644 --- a/cloudkitty/api/v1/controllers/collector.py +++ b/cloudkitty/api/v1/controllers/collector.py @@ -15,6 +15,7 @@ # # @author: Stéphane Albert # +from oslo_log import log as logging import pecan from pecan import rest import six @@ -25,6 +26,8 @@ from cloudkitty.api.v1.datamodels import collector as collector_models from cloudkitty.common import policy from cloudkitty.db import api as db_api +LOG = logging.getLogger(__name__) + class MappingController(rest.RestController): """REST Controller managing service to collector mappings.""" @@ -39,6 +42,7 @@ class MappingController(rest.RestController): :param service: Name of the service to filter on. """ + LOG.warning("Collector mappings are deprecated and shouldn't be used.") policy.authorize(pecan.request.context, 'collector:get_mapping', {}) try: mapping = self._db.get_mapping(service) @@ -55,6 +59,7 @@ class MappingController(rest.RestController): :param collector: Filter on the collector name. :return: Service to collector mappings collection. """ + LOG.warning("Collector mappings are deprecated and shouldn't be used.") policy.authorize(pecan.request.context, 'collector:list_mappings', {}) mappings = [collector_models.ServiceToCollectorMapping( **mapping.as_dict()) @@ -71,6 +76,7 @@ class MappingController(rest.RestController): :param collector: Name of the collector to apply mapping on. :param service: Name of the service to apply mapping on. """ + LOG.warning("Collector mappings are deprecated and shouldn't be used.") policy.authorize(pecan.request.context, 'collector:manage_mapping', {}) new_mapping = self._db.set_mapping(service, collector) return collector_models.ServiceToCollectorMapping( @@ -85,6 +91,7 @@ class MappingController(rest.RestController): :param service: Name of the service to filter on. """ + LOG.warning("Collector mappings are deprecated and shouldn't be used.") policy.authorize(pecan.request.context, 'collector:manage_mapping', {}) try: self._db.delete_mapping(service) diff --git a/releasenotes/notes/deprecate-collector-mappings-5a69b31c8037fc01.yaml b/releasenotes/notes/deprecate-collector-mappings-5a69b31c8037fc01.yaml new file mode 100644 index 00000000..96b7b127 --- /dev/null +++ b/releasenotes/notes/deprecate-collector-mappings-5a69b31c8037fc01.yaml @@ -0,0 +1,5 @@ +--- +deprecations: + - | + Collector mappings have been deprecated and should not be used anymore. They + will be removed during OpenStack's S cycle.