def _get_namespaces(apiserver_url, name=''):
 url = '{0}/api/v1/namespaces/{1}'.format(apiserver_url, name)
 ret = http.query(url)
 if ret.get('body'):
  return json.loads(ret.get('body'))
 else:
  return None

def _get_namespaces ( apiserver_url , name = '' ) : url = '{0}/api/v1/namespaces/{1}' . format ( apiserver_url , name ) ret = http . query ( url ) if ret . get ( 'body' ) : return json . loads ( ret . get ( 'body' ) ) else : return None
get namespace is namespace is defined otherwise return all namespaces .