code: def _get_namespaces(apiserver_url, name=""):
      '''Get namespace is namespace is defined otherwise return all namespaces'''
      # Prepare URL
      url = "{0}/api/v1/namespaces/{1}".format(apiserver_url, name)
      # Make request
      ret = http.query(url)
      if ret.get("body"):
          return salt.utils.json.loads(ret.get("body"))
      else:
          return Nonf _get_namespaces(apiserver_url, name=""):
      '''Get namespace is namespace is defined otherwise return all namespaces'''
      # Prepare URL
      url = "{0}/api/v1/namespaces/{1}".format(apiserver_url, name)
      # Make request
      ret = http.query(url)
      if ret.get("body"):
          return salt.utils.json.loads(ret.get("body"))
      else:
          return None
docs: Get namespace is namespace is defined otherwise return all namespaces