dwave.cloud.regions.get_regions#

get_regions(config: ClientConfig | str | dict | None = None, *, refresh: bool = False, maxage: float | None = None, no_cache: bool = False) list[Region][source]#

Retrieve available Solver API regions.

Parameters:
  • config – Client configuration used for requests to Metadata API. Given as a ClientConfig object, it defines connection parameters in full. Raw config (full or partial) loaded from a file/env with load_config() can be passed in as a dict and is validated as ClientConfig. A string config value is interpreted as metadata_api_endpoint.

  • refresh – Force regions cache refresh.

  • maxage – Default maximum allowed age, in seconds, of cached regions metadata. Overridden by Metadata API cache control.

  • no_cache – Do not use cache.

Returns:

List of Region objects, each describing one region.

Added in version 0.11.0: Added get_regions().

Changed in version 0.12.2: maxage parameter is now just a default value for the maximum allowed cache age, and it’s typically overridden by regions API’s cache control.