Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions gvm/protocols/gmp/_gmpnext.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
Credentials,
CredentialStoreCredentialType,
CredentialStores,
Features,
IntegrationConfigs,
OCIImageTargets,
ReportApplications,
Expand All @@ -35,6 +36,7 @@
ScanReports,
Targets,
Tasks,
Timezones,
WebApplicationTargets,
)
from .requests.v224 import AliveTest as AliveTestV224
Expand Down Expand Up @@ -2042,3 +2044,19 @@ def cancel_report_export(
report_export_id=report_export_id,
)
)

def get_features(
self,
) -> T:
"""Request a list of optional features."""
return self._send_request_and_transform_response(
Features.get_features()
)

def get_timezones(
self,
) -> T:
"""Request a list of supported timezones."""
return self._send_request_and_transform_response(
Timezones.get_timezones()
)
8 changes: 8 additions & 0 deletions gvm/protocols/gmp/requests/next/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
Credentials,
CredentialStoreCredentialType,
)
from gvm.protocols.gmp.requests.next._features import (
Features,
)
from gvm.protocols.gmp.requests.next._integration_configs import (
IntegrationConfigs,
)
Expand Down Expand Up @@ -51,6 +54,9 @@
from gvm.protocols.gmp.requests.next._scan_report import ScanReports
from gvm.protocols.gmp.requests.next._targets import AliveTest, Targets
from gvm.protocols.gmp.requests.next._tasks import Tasks
from gvm.protocols.gmp.requests.next._timezones import (
Timezones,
)
from gvm.protocols.gmp.requests.next._web_application_targets import (
WebApplicationTargets,
)
Expand Down Expand Up @@ -150,6 +156,7 @@
"DfnCertAdvisories",
"EntityID",
"EntityType",
"Features",
"Feed",
"FeedType",
"FilterType",
Expand Down Expand Up @@ -207,6 +214,7 @@
"Tasks",
"TicketStatus",
"Tickets",
"Timezones",
"TrashCan",
"UserAuthType",
"UserSettings",
Expand Down
13 changes: 13 additions & 0 deletions gvm/protocols/gmp/requests/next/_features.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: 2026 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later

from gvm.protocols.core import Request
from gvm.xml import XmlCommand


class Features:
@classmethod
def get_features(cls) -> Request:
"""Request a list of optional features."""
return XmlCommand("get_features")
13 changes: 13 additions & 0 deletions gvm/protocols/gmp/requests/next/_timezones.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: 2026 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later

from gvm.protocols.core import Request
from gvm.xml import XmlCommand


class Timezones:
@classmethod
def get_timezones(cls) -> Request:
"""Request a list of supported timezones."""
return XmlCommand("get_timezones")
10 changes: 10 additions & 0 deletions tests/protocols/gmpnext/entities/features/test_get_features.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2026 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later


class GmpGetFeaturesTestMixin:
def test_get_features(self):
self.gmp.get_features()

self.connection.send.has_been_called_with(b"<get_features/>")
14 changes: 14 additions & 0 deletions tests/protocols/gmpnext/entities/test_features.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: 2026 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later
#


from ...gmpnext import GMPTestCase
from .features.test_get_features import (
GmpGetFeaturesTestMixin,
)


class GmpGetFeaturesTestCase(GmpGetFeaturesTestMixin, GMPTestCase):
pass
14 changes: 14 additions & 0 deletions tests/protocols/gmpnext/entities/test_timezones.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: 2026 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later
#


from ...gmpnext import GMPTestCase
from .timezones.test_get_timezones import (
GmpGetTimezonesTestMixin,
)


class GmpGetTimezonesTestCase(GmpGetTimezonesTestMixin, GMPTestCase):
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SPDX-FileCopyrightText: 2026 Greenbone AG
#
# SPDX-License-Identifier: GPL-3.0-or-later


class GmpGetTimezonesTestMixin:
def test_get_timezones(self):
self.gmp.get_timezones()

self.connection.send.has_been_called_with(b"<get_timezones/>")
Loading