-def api(version=None, cache=True, host=None, token=None, insecure=False):
- global services
-
- if 'ARVADOS_DEBUG' in config.settings():
- logging.basicConfig(level=logging.DEBUG)
+def api(version=None, cache=True, host=None, token=None, insecure=False, **kwargs):
+ """Return an apiclient Resources object for an Arvados instance.
+
+ Arguments:
+ * version: A string naming the version of the Arvados API to use (for
+ example, 'v1').
+ * cache: If True (default), return an existing Resources object if
+ one already exists with the same endpoint and credentials. If
+ False, create a new one, and do not keep it in the cache (i.e.,
+ do not return it from subsequent api(cache=True) calls with
+ matching endpoint and credentials).
+ * host: The Arvados API server host (and optional :port) to connect to.
+ * token: The authentication token to send with each API call.
+ * insecure: If True, ignore SSL certificate validation errors.
+
+ Additional keyword arguments will be passed directly to
+ `apiclient_discovery.build` if a new Resource object is created.
+ If the `discoveryServiceUrl` or `http` keyword arguments are
+ missing, this function will set default values for them, based on
+ the current Arvados configuration settings.
+
+ """