def do_get_notification_methods(self, req, res): helpers.validate_authorization(req, self._default_authorized_roles) tenant_id = helpers.get_tenant_id(req) offset = helpers.normalize_offset(helpers.get_query_param(req, 'offset')) result = self._list_notifications(tenant_id, req.uri, offset) res.body = helpers.dumpit_utf8(result) res.status = falcon.HTTP_200
def do_get_notification_methods(self, req, res): helpers.validate_authorization(req, self._default_authorized_roles) tenant_id = helpers.get_tenant_id(req) offset = helpers.normalize_offset( helpers.get_query_param(req, 'offset')) result = self._list_notifications(tenant_id, req.uri, offset) res.body = helpers.dumpit_utf8(result) res.status = falcon.HTTP_200
def do_get_alarm_state_history(self, req, res, id): helpers.validate_authorization(req, self._default_authorized_roles) tenant_id = helpers.get_tenant_id(req) offset = helpers.normalize_offset(helpers.get_query_param(req, 'offset')) result = self._alarm_history(tenant_id, [id], req.uri, offset) res.body = helpers.dumpit_utf8(result) res.status = falcon.HTTP_200
def do_get_stream_definitions(self, req, res): helpers.validate_authorization(req, self._default_authorized_roles) tenant_id = helpers.get_tenant_id(req) name = helpers.get_query_name(req) offset = helpers.normalize_offset(helpers.get_query_param(req, 'offset')) limit = helpers.get_query_param(req, 'limit') result = self._stream_definition_list(tenant_id, name, req.uri, offset, limit) res.body = helpers.dumpit_utf8(result) res.status = falcon.HTTP_200
def do_get_metrics(self, req, res): helpers.validate_authorization(req, self._default_authorized_roles) tenant_id = helpers.get_tenant_id(req) name = helpers.get_query_name(req) helpers.validate_query_name(name) dimensions = helpers.get_query_dimensions(req) helpers.validate_query_dimensions(dimensions) offset = helpers.normalize_offset(helpers.get_query_param(req, 'offset')) result = self._list_metrics(tenant_id, name, dimensions, req.uri, offset) res.body = helpers.dumpit_utf8(result) res.status = falcon.HTTP_200
def do_get_metrics(self, req, res): helpers.validate_authorization(req, self._default_authorized_roles) tenant_id = helpers.get_tenant_id(req) name = helpers.get_query_name(req) helpers.validate_query_name(name) dimensions = helpers.get_query_dimensions(req) helpers.validate_query_dimensions(dimensions) offset = helpers.normalize_offset( helpers.get_query_param(req, 'offset')) result = self._list_metrics(tenant_id, name, dimensions, req.uri, offset) res.body = helpers.dumpit_utf8(result) res.status = falcon.HTTP_200
def do_get_alarms(self, req, res): helpers.validate_authorization(req, self._default_authorized_roles) tenant_id = helpers.get_tenant_id(req) query_parms = falcon.uri.parse_query_string(req.query_string) offset = helpers.normalize_offset(helpers.get_query_param(req, 'offset')) result = self._alarm_list(req.uri, tenant_id, query_parms, offset) res.body = helpers.dumpit_utf8(result) res.status = falcon.HTTP_200
def do_get_alarms_state_history(self, req, res): helpers.validate_authorization(req, self._default_authorized_roles) tenant_id = helpers.get_tenant_id(req) start_timestamp = helpers.get_query_starttime_timestamp(req, False) end_timestamp = helpers.get_query_endtime_timestamp(req, False) query_parms = falcon.uri.parse_query_string(req.query_string) offset = helpers.normalize_offset(helpers.get_query_param(req, 'offset')) result = self._alarm_history_list(tenant_id, start_timestamp, end_timestamp, query_parms, req.uri, offset) res.body = helpers.dumpit_utf8(result) res.status = falcon.HTTP_200
def do_get_measurements(self, req, res): helpers.validate_authorization(req, self._default_authorized_roles) tenant_id = helpers.get_tenant_id(req) name = helpers.get_query_name(req) helpers.validate_query_name(name) dimensions = helpers.get_query_dimensions(req) helpers.validate_query_dimensions(dimensions) start_timestamp = helpers.get_query_starttime_timestamp(req) end_timestamp = helpers.get_query_endtime_timestamp(req, False) offset = helpers.normalize_offset(helpers.get_query_param(req, 'offset')) result = self._measurement_list(tenant_id, name, dimensions, start_timestamp, end_timestamp, req.uri, offset) res.body = helpers.dumpit_utf8(result) res.status = falcon.HTTP_200
def do_get_measurements(self, req, res): helpers.validate_authorization(req, self._default_authorized_roles) tenant_id = helpers.get_tenant_id(req) name = helpers.get_query_name(req) helpers.validate_query_name(name) dimensions = helpers.get_query_dimensions(req) helpers.validate_query_dimensions(dimensions) start_timestamp = helpers.get_query_starttime_timestamp(req) end_timestamp = helpers.get_query_endtime_timestamp(req, False) offset = helpers.normalize_offset( helpers.get_query_param(req, 'offset')) result = self._measurement_list(tenant_id, name, dimensions, start_timestamp, end_timestamp, req.uri, offset) res.body = helpers.dumpit_utf8(result) res.status = falcon.HTTP_200