# Metadata API

API wrapper for retrieving metadata from the openvasd HTTP API using HEAD requests.

class Metadata

  Represents metadata returned by the openvasd API.

  api_version

    Comma separated list of available API versions

    Type:

      str

  feed_version

    Version of the feed.

    Type:

      str

  authentication

    Supported authentication methods

    Type:

      str

  __init__(api_version, feed_version, authentication)

class MetadataAPI

  Provides access to metadata endpoints exposed by the openvasd server using lightweight HTTP HEAD requests.

  These endpoints return useful information in HTTP headers such as: - API version - Feed version - Authentication type

  If the scanner is protected and the request is unauthorized, a 401 response is handled gracefully.

  get()

    Perform a HEAD request to / to retrieve top-level API metadata.

    Returns:

      A Metadata instance or MetadataError if exceptions are suppressed and an error occurs.

    Raises:

      httpx.HTTPStatusError – For non-401 HTTP errors if exceptions are not suppressed.

    Return type:

      Metadata | MetadataError

    See: HEAD / in the openvasd API documentation.

  get_scans()

    Perform a HEAD request to /scans to retrieve scan endpoint metadata.

    Returns:

      A Metadata instance or MetadataError if exceptions are suppressed and an error occurs.

      Raises:

        httpx.HTTPStatusError: For non-401 HTTP errors if exceptions are not suppressed.

      See: HEAD /scans in the openvasd API documentation.

    Return type:

      Metadata | MetadataError

class MetadataError

  Represents an error response from the metadata API.

  error

    Error message.

    Type:

      str

  status_code

    HTTP status code of the error response.

    Type:

      int

  __init__(error, status_code)