Skip to content

api_conf

Classes:

  • APIconf

    Configuration for connecting to the Antares Web API.

APIconf

APIconf(api_host: str, token: str, verify: bool = True)

Configuration for connecting to the Antares Web API.

Attributes:

  • api_host (str) –

    Base URL of the Antares Web API (e.g., https://antares-web.mydomain).

  • token (str) –

    Bearer token used for authentication.

  • verify (bool) –

    Whether to verify the server's TLS certificate. Defaults to True.

Example
api_config = APIconf(api_host="https://antares-web.mydomain", token="my-token")

Methods:

Source code in src/antares/craft/api_conf/api_conf.py
def __init__(self, api_host: str, token: str, verify: bool = True) -> None:
    self._api_host: str = api_host
    self._token: str = token
    self._verify: bool = verify

token property writable

token: str

Bearer token used for API authentication.

verify property

verify: bool

Whether TLS certificate verification is enabled.

get_host

get_host() -> str

Get the API host URL.

Source code in src/antares/craft/api_conf/api_conf.py
def get_host(self) -> str:
    """Get the API host URL."""
    return self._api_host

get_token

get_token() -> str

Return the authentication token.

Returns:

  • str

    The bearer token used for API authentication.

Source code in src/antares/craft/api_conf/api_conf.py
def get_token(self) -> str:
    """Return the authentication token.

    Returns:
        The bearer token used for API authentication.
    """
    return self._token