ooiservices/app/uframe/assets.py
def delete_asset(id):
    """ Delete an asset by id.
    """
    this_asset = ""
    try:
        url = current_app.config['UFRAME_ASSETS_URL'] + '/assets/%s' % str(id)
        response = requests.delete(url, headers=_uframe_headers())

        asset_cache = cache.get('asset_list')
        if asset_cache:
            cache.delete('asset_list')
            for row in asset_cache:
                if row['id'] == id:
                    this_asset = row
                    break
            if this_asset:
                cache.delete('asset_list')
                asset_cache.remove(this_asset)
                cache.set('asset_list', asset_cache, timeout=CACHE_TIMEOUT)

        return response.text, response.status_code

    except ConnectionError:
        message = 'ConnectionError during delete asset.'
        current_app.logger.info(message)
        return bad_request(message)
    except Timeout:
        message = 'Timeout during during delete asset.'
        current_app.logger.info(message)
        return bad_request(message)
    except Exception as err:
        message = str(err)
        current_app.logger.info(message)
        return bad_request(message)
 Delete an asset by id.
    
Delete an asset by id.
Delete an asset by id .
def delete_asset(id):
    this_asset = ""
    try:
        url = current_app.config['UFRAME_ASSETS_URL'] + '/assets/%s' % str(id)
        response = requests.delete(url, headers=_uframe_headers())
        asset_cache = cache.get('asset_list')
        if asset_cache:
            cache.delete('asset_list')
            for row in asset_cache:
                if row['id'] == id:
                    this_asset = row
                    break
            if this_asset:
                cache.delete('asset_list')
                asset_cache.remove(this_asset)
                cache.set('asset_list', asset_cache, timeout=CACHE_TIMEOUT)
        return response.text, response.status_code
    except ConnectionError:
        message = 'ConnectionError during delete asset.'
        current_app.logger.info(message)
        return bad_request(message)
    except Timeout:
        message = 'Timeout during during delete asset.'
        current_app.logger.info(message)
        return bad_request(message)
    except Exception as err:
        message = str(err)
        current_app.logger.info(message)
        return bad_request(message)
def delete_asset ( id ) : this_asset = "" try : url = current_app . config [ 'UFRAME_ASSETS_URL' ] + '/assets/%s' % str ( id ) response = requests . delete ( url , headers = _uframe_headers ( ) ) asset_cache = cache . get ( 'asset_list' ) if asset_cache : cache . delete ( 'asset_list' ) for row in asset_cache : if row [ 'id' ] == id : this_asset = row break if this_asset : cache . delete ( 'asset_list' ) asset_cache . remove ( this_asset ) cache . set ( 'asset_list' , asset_cache , timeout = CACHE_TIMEOUT ) return response . text , response . status_code except ConnectionError : message = 'ConnectionError during delete asset.' current_app . logger . info ( message ) return bad_request ( message ) except Timeout : message = 'Timeout during during delete asset.' current_app . logger . info ( message ) return bad_request ( message ) except Exception as err : message = str ( err ) current_app . logger . info ( message ) return bad_request ( message )
Delete an asset by id.
Delete an asset by id .
""" Delete an asset by id.
    """
id