def get(self, node_uuid, processed=True, get_json=False): suffix = None if processed else _UNPROCESSED_DATA_STORE_SUFFIX LOG.debug('Fetching introspection data from Swift for %s', node_uuid) data = swift.get_introspection_data(node_uuid, suffix=suffix) if get_json: return json.loads(data) return data
def api_introspection_data(uuid): utils.check_auth(flask.request) if CONF.processing.store_data == 'swift': res = swift.get_introspection_data(uuid) return res, 200, {'Content-Type': 'application/json'} else: return error_response(_('Inspector is not configured to store data. ' 'Set the [processing] store_data ' 'configuration option to change this.'), code=404)
def _get_unprocessed_data(uuid): if CONF.processing.store_data == 'swift': LOG.debug( 'Fetching unprocessed introspection data from ' 'Swift for %s', uuid) return json.loads( swift.get_introspection_data( uuid, suffix=_UNPROCESSED_DATA_STORE_SUFFIX)) else: raise utils.Error(_('Swift support is disabled'), code=400)
def api_introspection_data(node_id): if CONF.processing.store_data == 'swift': if not uuidutils.is_uuid_like(node_id): node = ir_utils.get_node(node_id, fields=['uuid']) node_id = node.uuid res = swift.get_introspection_data(node_id) return res, 200, {'Content-Type': 'application/json'} else: return error_response(_('Inspector is not configured to store data. ' 'Set the [processing] store_data ' 'configuration option to change this.'), code=404)
def _get_unprocessed_data(uuid): if CONF.processing.store_data == 'swift': LOG.debug('Fetching unprocessed introspection data from ' 'Swift for %s', uuid) return json.loads( swift.get_introspection_data( uuid, suffix=_UNPROCESSED_DATA_STORE_SUFFIX ) ) else: raise utils.Error(_('Swift support is disabled'), code=400)
def api_introspection_data(node_id): utils.check_auth(flask.request) if CONF.processing.store_data == 'swift': if not uuidutils.is_uuid_like(node_id): node = ir_utils.get_node(node_id, fields=['uuid']) node_id = node.uuid res = swift.get_introspection_data(node_id) return res, 200, {'Content-Type': 'application/json'} else: return error_response(_('Inspector is not configured to store data. ' 'Set the [processing] store_data ' 'configuration option to change this.'), code=404)