def _get_labels(node, apiserver_url):
 url = '{0}/api/v1/nodes/{1}'.format(apiserver_url, node)
 ret = http.query(url)
 if ('body' in ret):
  ret = json.loads(ret.get('body'))
 elif (ret.get('status', 0) == 404):
  return "Node {0} doesn't exist".format(node)
 else:
  return ret
 return ret.get('metadata', {}).get('labels', {})

def _get_labels ( node , apiserver_url ) : url = '{0}/api/v1/nodes/{1}' . format ( apiserver_url , node ) ret = http . query ( url ) if ( 'body' in ret ) : ret = json . loads ( ret . get ( 'body' ) ) elif ( ret . get ( 'status' , 0 ) == 404 ) : return "Node {0} doesn't exist" . format ( node ) else : return ret return ret . get ( 'metadata' , { } ) . get ( 'labels' , { } )
get all labels from a kube node .