config
¶
Classes:
-
OqtopusConfig–A configuration information class for using OQTOPUS backend.
OqtopusConfig
¶
A configuration information class for using OQTOPUS backend.
Parameters:
Raises:
-
ValueError–If
urlorapi_tokenis None.
Methods:
-
from_file–Read configuration information from a file.
Attributes:
-
api_token(str) –Return the API token.
-
proxy(str | None) –Return the proxy.
-
url(str) –Return the url.
api_token
property
¶
api_token: str
Return the API token.
Returns:
-
str(str) –the API token to access OCTOPUS Cloud.
proxy
property
¶
proxy: str | None
Return the proxy.
Returns:
-
str | None–str | None: the proxy to access OCTOPUS Cloud.
from_file
staticmethod
¶
from_file(
section: str | None = "default",
path: str | None = "~/.oqtopus",
) -> OqtopusConfig
Read configuration information from a file.
Parameters:
-
(section¶str | None, default:'default') –A :class:
OqtopusConfigfor circuit execution. -
(path¶str | None, default:'~/.oqtopus') –A path for config file.
Returns:
-
OqtopusConfig–Configuration information :class:
OqtopusConfig.
Raises:
ValueError: If path is None.
Examples:
The OQTOPUS configuration file describes configuration information for each
section. A section has a header in the form [section].
The default file path is ~/.oqtopus and the default section name is
default. Each section describes a setting in the format key=value.
An example of a configuration file description is as below:
.. code-block::
[default]
url=<base URL>
api_token=<API token>
[sectionA]
url=<base URL>
api_token=<API token>
[sectioB]
url=<base URL>
api_token=<API token>
proxy=http://<proxy>:<port>
If sectionA settings are to be used, initialize
OqtopusSamplingBackend as follows
.. code-block::
backend = OqtopusSamplingBackend(OqtopusConfig.from_file("sectionA"))