File: _api.py

package info (click to toggle)
python-gvm 26.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 5,132 kB
  • sloc: python: 44,662; makefile: 18
file content (23 lines) | stat: -rw-r--r-- 696 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# SPDX-FileCopyrightText: 2025 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later


import httpx


class OpenvasdAPI:
    def __init__(
        self, client: httpx.Client, *, suppress_exceptions: bool = False
    ):
        """
        Initialize the OpenvasdAPI entry point.

        Args:
            client: An initialized `httpx.Client` configured for communicating
                    with the openvasd server.
            suppress_exceptions: If True, suppress exceptions and return structured error responses.
                Default is False, which means exceptions will be raised.
        """
        self._client = client
        self._suppress_exceptions = suppress_exceptions