GMP¶
Protocol implementations for the Greenbone Management Protocol (GMP).
In most circumstances you will want to use the GMP
class which
dynamically selects the supported GMP protocol of the remote manager daemon.
If you need to use a specific GMP version, you can use the GMPv224
or
GMPv225
classes.
GMP
- Dynamically select supported GMP protocol of the remote manager daemon.GMPv224
- GMP version 22.4GMPv225
- GMP version 22.5
- class GMP¶
Dynamically select supported GMP protocol of the remote manager daemon.
Must be used as a Context Manager
Example
from gvm.protocols.gmp import GMP with GMP(connection) as gmp: # gmp can be an instance of gvm.protocols.gmp.GMPv224 or # gvm.protocols.gmp.GMPv225 depending # on the supported GMP version of the remote manager daemon resp = gmp.get_tasks()
- __init__(connection, *, transform=<function str_transform>)¶
Create a new GMP instance.
- Parameters:
connection (GvmConnection) – Connection to use to talk with the remote daemon. See
gvm.connections
for possible connection types.transform (Callable[[Response], T]) –
Optional transform callable to convert response data. After each request the callable gets passed the plain response data which can be used to check the data and/or conversion into different representations like a xml dom.
See
gvm.transforms
for existing transforms.
- determine_remote_gmp_version()¶
Determine the supported GMP version of the remote daemon
- determine_supported_gmp()¶
Determine supported GMP version of the remote daemon and return a corresponding GMP class instance