"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "monasca_api/v2/reference/helpers.py" between
monasca-api-3.1.0.tar.gz and monasca-api-4.0.0.tar.gz

About: OpenStack Monasca API is a RESTful API server that is designed with a layered architecture and supports Monitoring as a Service (MONaaS).
The "Ussuri" series (latest release).

helpers.py  (monasca-api-3.1.0):helpers.py  (monasca-api-4.0.0)
skipping to change at line 27 skipping to change at line 27
import datetime import datetime
import falcon import falcon
from oslo_log import log from oslo_log import log
from oslo_utils import encodeutils from oslo_utils import encodeutils
from oslo_utils import timeutils from oslo_utils import timeutils
import six import six
import six.moves.urllib.parse as urlparse import six.moves.urllib.parse as urlparse
from monasca_api.common.rest import utils as rest_utils
from monasca_api import conf from monasca_api import conf
from monasca_api.v2.common.exceptions import HTTPUnprocessableEntityError from monasca_api.v2.common.exceptions import HTTPUnprocessableEntityError
from monasca_common.rest import utils as rest_utils
from monasca_common.validation import metrics as metric_validation from monasca_common.validation import metrics as metric_validation
LOG = log.getLogger(__name__) LOG = log.getLogger(__name__)
CONF = conf.CONF CONF = conf.CONF
def from_json(req): def from_json(req):
"""Read the json_msg from the http request body and return them as JSON. """Read the json_msg from the http request body and return them as JSON.
:param req: HTTP request object. :param req: HTTP request object.
:return: Returns the metrics as a JSON object. :return: Returns the metrics as a JSON object.
skipping to change at line 686 skipping to change at line 686
else: else:
resource = {u'links': ([{u'rel': u'self', resource = {u'links': ([{u'rel': u'self',
u'href': self_link}]), u'href': self_link}]),
u'elements': []} u'elements': []}
return resource return resource
def create_alarms_count_next_link(uri, offset, limit): def create_alarms_count_next_link(uri, offset, limit):
if offset is None: if offset is None:
offset = 0 offset = 0
parsed_url = urlparse.urlparse(uri) parsed_url = urlparse.urlparse(uri)
base_url = build_base_uri(parsed_url) base_url = build_base_uri(parsed_url)
new_query_params = [u'offset=' + urlparse.quote(str(offset + limit))] new_query_params = [u'offset=' + urlparse.quote(str(offset + limit))]
_get_old_query_params_except_offset(new_query_params, parsed_url) _get_old_query_params_except_offset(new_query_params, parsed_url)
next_link = base_url next_link = base_url
if new_query_params: if new_query_params:
next_link += '?' + '&'.join(new_query_params) next_link += '?' + '&'.join(new_query_params)
return next_link return next_link
 End of changes. 3 change blocks. 
2 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)