def _get_self_href(response):
 data = jsonutils.loads(response.body)
 for link in data['versions'][0]['links']:
  if (link['rel'] == 'self'):
   return link['href']
 return ''

def _get_self_href ( response ) : data = jsonutils . loads ( response . body ) for link in data [ 'versions' ] [ 0 ] [ 'links' ] : if ( link [ 'rel' ] == 'self' ) : return link [ 'href' ] return ''
extract the url to self from response data .