Completed
Push — master ( 31f8dc...fc9f1c )
by
unknown
16s queued 12s
created

gmp.protocol.v7.Gmp.get_tasks()   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
2
# Copyright (C) 2018 Greenbone Networks GmbH
3
#
4
# SPDX-License-Identifier: GPL-3.0-or-later
5
#
6
# This program is free software: you can redistribute it and/or modify
7
# it under the terms of the GNU General Public License as published by
8
# the Free Software Foundation, either version 3 of the License, or
9
# (at your option) any later version.
10
#
11
# This program is distributed in the hope that it will be useful,
12
# but WITHOUT ANY WARRANTY; without even the implied warranty of
13
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
# GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License
17
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
"""
19
Module for communication with gvmd in Greenbone Management Protocol version 7
20
"""
21
22
import logging
23
24
from lxml import etree
25
26
from gmp.error import GmpError
27
from gmp.xml import _GmpCommandFactory as GmpCommandFactory
28
29
logger = logging.getLogger(__name__)
0 ignored issues
show
Coding Style Naming introduced by
The name logger does not conform to the constant naming conventions ((([A-Z_][A-Z0-9_]*)|(__.*__))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
30
31
PROTOCOL_VERSION = (7,)
32
33
def arguments_to_string(kwargs):
34
    """Convert arguments
35
36
    Converts dictionaries into gmp arguments string
37
38
    Arguments:
39
        kwargs {dict} -- Arguments
40
41
    Returns:
42
        string -- Arguments as string
43
    """
44
    msg = ''
45
    for key, value in kwargs.items():
46
        msg += str(key) + '=\'' + str(value) + '\' '
47
48
    return msg
49
50
def _check_command_status(xml):
51
    """Check gmp response
52
53
    Look into the gmp response and check for the status in the root element
54
55
    Arguments:
56
        xml {string} -- XML-Source
57
58
    Returns:
59
        bool -- True if valid, otherwise False
60
    """
61
62
    if xml is 0 or xml is None:
63
        logger.error('XML Command is empty')
64
        return False
65
66
    try:
67
        parser = etree.XMLParser(encoding='utf-8', recover=True)
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named XMLParser.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
68
69
        root = etree.XML(xml, parser=parser)
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named XML.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
70
        status = root.attrib['status']
71
        return status is not None and status[0] == '2'
72
73
    except etree.Error as e:
0 ignored issues
show
Bug introduced by
The Module lxml.etree does not seem to have a member named Error.

This check looks for calls to members that are non-existent. These calls will fail.

The member could have been renamed or removed.

Loading history...
Coding Style Naming introduced by
The name e does not conform to the variable naming conventions ((([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$).

This check looks for invalid names for a range of different identifiers.

You can set regular expressions to which the identifiers must conform if the defaults do not match your requirements.

If your project includes a Pylint configuration file, the settings contained in that file take precedence.

To find out more about Pylint, please refer to their site.

Loading history...
74
        logger.error('etree.XML(xml): %s', e)
75
        return False
76
77
78
class Gmp:
0 ignored issues
show
Unused Code introduced by
The variable __class__ seems to be unused.
Loading history...
best-practice introduced by
Too many public methods (115/20)
Loading history...
79
    """Wrapper for Greenbone Management Protocol
80
    """
81
82
    def __init__(self, connection, transform=None):
83
        # GMP Message Creator
84
        self._generator = GmpCommandFactory()
85
        self._connection = connection
86
87
        self._connected = False
88
89
        # Is authenticated on gvm
90
        self._authenticated = False
91
92
        self._transform_callable = transform
93
94
    @staticmethod
95
    def get_protocol_version():
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
96
        return '.'.join(str(x) for x in PROTOCOL_VERSION)
97
98
    def _read(self):
99
        """Read a command response from gvmd
100
101
        Returns:
102
            <string> -- Response from server.
103
        """
104
        response = self._connection.read()
105
106
        logger.debug('read() %i Bytes response: %s', len(response), response)
107
108
        if response is None or len(str(response)) == 0:
0 ignored issues
show
Unused Code introduced by
Do not use len(SEQUENCE) as condition value
Loading history...
109
            raise GmpError('Connection was closed by remote server')
110
111
        return response
112
113
    def _send(self, data):
114
        """Send a command to gsad
115
        """
116
        self._connect()
117
        self._connection.send(data)
118
119
    def _connect(self):
120
        if not self.is_connected():
121
            self._connection.connect()
122
            self._connected = True
123
124
    def _transform(self, data):
125
        transform = self._transform_callable
126
        if transform is None:
127
            return data
128
        return transform(data)
129
130
    def is_connected(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
131
        return self._connected
132
133
    def is_authenticated(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
134
        return self._authenticated
135
136
    def disconnect(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
137
        if self.is_connected():
138
            self._connection.disconnect()
139
            self._connected = False
140
141
    def send_command(self, cmd):
142
        """Send a command to gsad
143
        """
144
        self._send(cmd)
145
        response = self._read()
146
        return self._transform(response)
147
148
    def authenticate(self, username, password):
149
        """Authenticate on GVM.
150
151
        The generated authenticate command will be send to server.
152
        After that a response is read from socket.
153
154
        Keyword Arguments:
155
            username {str} -- Username
156
            password {str} -- Password
157
158
        Returns:
159
            <string> -- Response from server.
160
        """
161
        cmd = self._generator.create_authenticate_command(
162
            username=username, password=password)
163
164
        self._send(cmd)
165
        response = self._read()
166
167
        if _check_command_status(response):
168
            self._authenticated = True
169
170
        return self._transform(response)
171
172
    def create_agent(self, installer, signature, name, comment='', copy='',
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (8/5)
Loading history...
173
                     howto_install='', howto_use=''):
174
        cmd = self._generator.create_agent_command(
175
            installer, signature, name, comment, copy, howto_install,
176
            howto_use)
177
        return self.send_command(cmd)
178
179
    def create_alert(self, name, condition, event, method, filter_id='',
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (8/5)
Loading history...
180
                     copy='', comment=''):
181
        cmd = self._generator.create_alert_command(name, condition, event,
182
                                                   method, filter_id, copy,
183
                                                   comment)
184
        return self.send_command(cmd)
185
186
    def create_asset(self, name, asset_type, comment=''):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
187
        # TODO: Add the missing second method. Also the docs are not complete!
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
188
        cmd = self._generator.create_asset_command(name, asset_type, comment)
189
        return self.send_command(cmd)
190
191
    def create_config(self, copy_id, name):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
192
        cmd = self._generator.create_config_command(copy_id, name)
193
        return self.send_command(cmd)
194
195
    def create_credential(self, name, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
196
        cmd = self._generator.create_credential_command(name, kwargs)
197
        return self.send_command(cmd)
198
199
    def create_filter(self, name, make_unique, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
200
        cmd = self._generator.create_filter_command(name, make_unique,
201
                                                    kwargs)
202
        return self.send_command(cmd)
203
204
    def create_group(self, name, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
205
        cmd = self._generator.create_group_command(name, kwargs)
206
        return self.send_command(cmd)
207
208
    # TODO: Create notes with comment returns bogus element. Research
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
209
    def create_note(self, text, nvt_oid, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
210
        cmd = self._generator.create_note_command(text, nvt_oid, kwargs)
211
        return self.send_command(cmd)
212
213
    def create_override(self, text, nvt_oid, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
214
        cmd = self._generator.create_override_command(text, nvt_oid, kwargs)
215
        return self.send_command(cmd)
216
217
    def create_permission(self, name, subject_id, permission_type, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
218
        cmd = self._generator.create_permission_command(
219
            name, subject_id, permission_type, kwargs)
220
        return self.send_command(cmd)
221
222
    def create_port_list(self, name, port_range, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
223
        cmd = self._generator.create_port_list_command(name, port_range, kwargs)
224
        return self.send_command(cmd)
225
226
    def create_port_range(self, port_list_id, start, end, port_range_type,
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (6/5)
Loading history...
227
                          comment=''):
228
        cmd = self._generator.create_port_range_command(
229
            port_list_id, start, end, port_range_type, comment)
230
        return self.send_command(cmd)
231
232
    def create_report(self, report_xml_string, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
233
        cmd = self._generator.create_report_command(report_xml_string, kwargs)
234
        return self.send_command(cmd)
235
236
    def create_role(self, name, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
237
        cmd = self._generator.create_role_command(name, kwargs)
238
        return self.send_command(cmd)
239
240
    def create_scanner(self, name, host, port, scanner_type, ca_pub,
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (7/5)
Loading history...
241
                       credential_id, **kwargs):
242
        cmd = self._generator.create_scanner_command(name, host, port,
243
                                                     scanner_type, ca_pub,
244
                                                     credential_id, kwargs)
245
        return self.send_command(cmd)
246
247
    def create_schedule(self, name, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
248
        cmd = self._generator.create_schedule_command(name, kwargs)
249
        return self.send_command(cmd)
250
251
    def create_tag(self, name, resource_id, resource_type, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
252
        cmd = self._generator.create_tag_command(name, resource_id,
253
                                                 resource_type, kwargs)
254
        return self.send_command(cmd)
255
256
    def create_target(self, name, make_unique, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
257
        # TODO: Missing variables
0 ignored issues
show
Coding Style introduced by
TODO and FIXME comments should generally be avoided.
Loading history...
258
        cmd = self._generator.create_target_command(name, make_unique, kwargs)
259
        return self.send_command(cmd)
260
261
    def create_task(self, name, config_id, target_id, scanner_id,
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (7/5)
Loading history...
262
                    alert_ids=None, comment=''):
263
        if alert_ids is None:
264
            alert_ids = []
265
        cmd = self._generator.create_task_command(
266
            name, config_id, target_id, scanner_id, alert_ids, comment)
267
        return self.send_command(cmd)
268
269
    def create_user(self, name, password, copy='', hosts_allow='0',
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
best-practice introduced by
Too many arguments (9/5)
Loading history...
270
                    ifaces_allow='0', role_ids=(), hosts=None, ifaces=None):
271
        cmd = self._generator.create_user_command(
272
            name, password, copy, hosts_allow, ifaces_allow, role_ids, hosts,
273
            ifaces)
274
        return self.send_command(cmd)
275
276
    def delete_agent(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
277
        cmd = '<delete_agent {0}/>'.format(arguments_to_string(kwargs))
278
        return self.send_command(cmd)
279
280
    def delete_alert(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
281
        cmd = '<delete_alert {0}/>'.format(arguments_to_string(kwargs))
282
        return self.send_command(cmd)
283
284
    def delete_asset(self, asset_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
285
        cmd = '<delete_asset asset_id="{0}" ultimate="{1}"/>'.format(
286
            asset_id, ultimate)
287
        return self.send_command(cmd)
288
289
    def delete_config(self, config_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
290
        cmd = '<delete_config config_id="{0}" ultimate="{1}"/>'.format(
291
            config_id, ultimate)
292
        return self.send_command(cmd)
293
294
    def delete_credential(self, credential_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
295
        cmd = '<delete_credential credential_id="{0}" ultimate="{1}"/>'.format(
296
            credential_id, ultimate)
297
        return self.send_command(cmd)
298
299
    def delete_filter(self, filter_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
300
        cmd = '<delete_filter filter_id="{0}" ultimate="{1}"/>'.format(
301
            filter_id, ultimate)
302
        return self.send_command(cmd)
303
304
    def delete_group(self, group_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
305
        cmd = '<delete_group group_id="{0}" ultimate="{1}"/>'.format(
306
            group_id, ultimate)
307
        return self.send_command(cmd)
308
309
    def delete_note(self, note_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
310
        cmd = '<delete_note note_id="{0}" ultimate="{1}"/>'.format(
311
            note_id, ultimate)
312
        return self.send_command(cmd)
313
314
    def delete_override(self, override_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
315
        cmd = '<delete_override override_id="{0}" ultimate="{1}"/>'.format(
316
            override_id, ultimate)
317
        return self.send_command(cmd)
318
319
    def delete_permission(self, permission_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
320
        cmd = '<delete_permission permission_id="{0}" ultimate="{1}"/>'.format(
321
            permission_id, ultimate)
322
        return self.send_command(cmd)
323
324
    def delete_port_list(self, port_list_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
325
        cmd = '<delete_port_list port_list_id="{0}" ultimate="{1}"/>'.format(
326
            port_list_id, ultimate)
327
        return self.send_command(cmd)
328
329
    def delete_port_range(self, port_range_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
330
        cmd = '<delete_port_range port_range_id="{0}"/>'.format(port_range_id)
331
        return self.send_command(cmd)
332
333
    def delete_report(self, report_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
334
        cmd = '<delete_report report_id="{0}"/>'.format(report_id)
335
        return self.send_command(cmd)
336
337
    def delete_report_format(self, report_format_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
338
        cmd = '<delete_report_format report_format_id="{0}" ' \
339
            'ultimate="{1}"/>'.format(report_format_id, ultimate)
340
        return self.send_command(cmd)
341
342
    def delete_role(self, role_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
343
        cmd = '<delete_role role_id="{0}" ultimate="{1}"/>'.format(
344
            role_id, ultimate)
345
        return self.send_command(cmd)
346
347
    def delete_scanner(self, scanner_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
348
        cmd = '<delete_scanner scanner_id="{0}" ultimate="{1}"/>'.format(
349
            scanner_id, ultimate)
350
        return self.send_command(cmd)
351
352
    def delete_schedule(self, schedule_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
353
        # if self.ask_yes_or_no('Are you sure to delete this schedule? '):
354
        cmd = '<delete_schedule schedule_id="{0}" ultimate="{1}"/>'.format(
355
            schedule_id, ultimate)
356
        return self.send_command(cmd)
357
358
    def delete_tag(self, tag_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
359
        cmd = '<delete_tag tag_id="{0}" ultimate="{1}"/>'.format(
360
            tag_id, ultimate)
361
        return self.send_command(cmd)
362
363
    def delete_target(self, target_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
364
        cmd = '<delete_target target_id="{0}" ultimate="{1}"/>'.format(
365
            target_id, ultimate)
366
        return self.send_command(cmd)
367
368
    def delete_task(self, task_id, ultimate=0):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
369
        cmd = '<delete_task task_id="{0}" ultimate="{1}"/>'.format(
370
            task_id, ultimate)
371
        return self.send_command(cmd)
372
373
    def delete_user(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
374
        user_id = kwargs.get('user_id', '')
375
        if user_id:
376
            user_id = ' user_id="%s"' % user_id
377
378
        name = kwargs.get('name', '')
379
        if name:
380
            name = ' name="%s"' % name
381
382
        inheritor_id = kwargs.get('inheritor_id', '')
383
        if inheritor_id:
384
            inheritor_id = ' inheritor_id="%s"' % inheritor_id
385
386
        inheritor_name = kwargs.get('inheritor_name', '')
387
        if inheritor_name:
388
            inheritor_name = ' inheritor_name="%s"' % inheritor_name
389
390
        cmd = '<delete_user{0}{1}{2}{3}/>'.format(
391
            user_id, name, inheritor_id, inheritor_name)
392
        return self.send_command(cmd)
393
394
    def describe_auth(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
395
        return self.send_command('<describe_auth/>')
396
397
    def empty_trashcan(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
398
        return self.send_command('<empty_trashcan/>')
399
400
    def get_agents(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
401
        cmd = '<get_agents {0}/>'.format(arguments_to_string(kwargs))
402
        return self.send_command(cmd)
403
404
    def get_aggregates(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
405
        cmd = '<get_aggregates {0}/>'.format(arguments_to_string(kwargs))
406
        return self.send_command(cmd)
407
408
    def get_alerts(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
409
        cmd = '<get_alerts {0}/>'.format(arguments_to_string(kwargs))
410
        return self.send_command(cmd)
411
412
    def get_assets(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
413
        cmd = '<get_assets {0}/>'.format(arguments_to_string(kwargs))
414
        return self.send_command(cmd)
415
416
    def get_credentials(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
417
        cmd = '<get_credentials {0}/>'.format(arguments_to_string(kwargs))
418
        return self.send_command(cmd)
419
420
    def get_configs(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
421
        cmd = '<get_configs {0}/>'.format(arguments_to_string(kwargs))
422
        return self.send_command(cmd)
423
424
    def get_feeds(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
425
        cmd = '<get_feeds {0}/>'.format(arguments_to_string(kwargs))
426
        return self.send_command(cmd)
427
428
    def get_filters(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
429
        cmd = '<get_filters {0}/>'.format(arguments_to_string(kwargs))
430
        return self.send_command(cmd)
431
432
    def get_groups(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
433
        cmd = '<get_groups {0}/>'.format(arguments_to_string(kwargs))
434
        return self.send_command(cmd)
435
436
    def get_info(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
437
        cmd = '<get_info {0}/>'.format(arguments_to_string(kwargs))
438
        return self.send_command(cmd)
439
440
    def get_notes(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
441
        cmd = '<get_notes {0}/>'.format(arguments_to_string(kwargs))
442
        return self.send_command(cmd)
443
444
    def get_nvts(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
445
        cmd = '<get_nvts {0}/>'.format(arguments_to_string(kwargs))
446
        return self.send_command(cmd)
447
448
    def get_nvt_families(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
449
        cmd = '<get_nvt_families {0}/>'.format(arguments_to_string(kwargs))
450
        return self.send_command(cmd)
451
452
    def get_overrides(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
453
        cmd = '<get_overrides {0}/>'.format(arguments_to_string(kwargs))
454
        return self.send_command(cmd)
455
456
    def get_permissions(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
457
        cmd = '<get_permissions {0}/>'.format(arguments_to_string(kwargs))
458
        return self.send_command(cmd)
459
460
    def get_port_lists(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
461
        cmd = '<get_port_lists {0}/>'.format(arguments_to_string(kwargs))
462
        return self.send_command(cmd)
463
464
    def get_preferences(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
465
        cmd = '<get_preferences {0}/>'.format(arguments_to_string(kwargs))
466
        return self.send_command(cmd)
467
468
    def get_reports(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
469
        cmd = '<get_reports {0}/>'.format(arguments_to_string(kwargs))
470
        return self.send_command(cmd)
471
472
    def get_report_formats(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
473
        cmd = '<get_report_formats {0}/>'.format(arguments_to_string(kwargs))
474
        return self.send_command(cmd)
475
476
    def get_results(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
477
        cmd = '<get_results {0}/>'.format(arguments_to_string(kwargs))
478
        return self.send_command(cmd)
479
480
    def get_roles(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
481
        cmd = '<get_roles {0}/>'.format(arguments_to_string(kwargs))
482
        return self.send_command(cmd)
483
484
    def get_scanners(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
485
        cmd = '<get_scanners {0}/>'.format(arguments_to_string(kwargs))
486
        return self.send_command(cmd)
487
488
    def get_schedules(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
489
        cmd = '<get_schedules {0}/>'.format(arguments_to_string(kwargs))
490
        return self.send_command(cmd)
491
492
    def get_settings(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
493
        cmd = '<get_settings {0}/>'.format(arguments_to_string(kwargs))
494
        return self.send_command(cmd)
495
496
    def get_system_reports(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
497
        cmd = '<get_system_reports {0}/>'.format(arguments_to_string(kwargs))
498
        return self.send_command(cmd)
499
500
    def get_tags(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
501
        cmd = '<get_tags {0}/>'.format(arguments_to_string(kwargs))
502
        return self.send_command(cmd)
503
504
    def get_targets(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
505
        cmd = '<get_targets {0}/>'.format(arguments_to_string(kwargs))
506
        return self.send_command(cmd)
507
508
    def get_tasks(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
509
        cmd = '<get_tasks {0}/>'.format(arguments_to_string(kwargs))
510
        return self.send_command(cmd)
511
512
    def get_users(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
513
        cmd = '<get_users {0}/>'.format(arguments_to_string(kwargs))
514
        return self.send_command(cmd)
515
516
    def get_version(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
517
        return self.send_command('<get_version/>')
518
519
    def help(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
520
        cmd = '<help {0} />'.format(arguments_to_string(kwargs))
521
        return self.send_command(cmd)
522
523
    def modify_agent(self, agent_id, name='', comment=''):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
524
        cmd = self._generator.modify_agent_command(agent_id, name, comment)
525
        return self.send_command(cmd)
526
527
    def modify_alert(self, alert_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
528
        cmd = self._generator.modify_alert_command(alert_id, kwargs)
529
        return self.send_command(cmd)
530
531
    def modify_asset(self, asset_id, comment):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
532
        cmd = '<modify_asset asset_id="%s"><comment>%s</comment>' \
533
              '</modify_asset>' % (asset_id, comment)
534
        return self.send_command(cmd)
535
536
    def modify_auth(self, group_name, auth_conf_settings):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
537
        cmd = self._generator.modify_auth_command(group_name,
538
                                                  auth_conf_settings)
539
        return self.send_command(cmd)
540
541
    def modify_config(self, selection, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
542
        cmd = self._generator.modify_config_command(selection, kwargs)
543
        return self.send_command(cmd)
544
545
    def modify_credential(self, credential_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
546
        cmd = self._generator.modify_credential_command(
547
            credential_id, kwargs)
548
        return self.send_command(cmd)
549
550
    def modify_filter(self, filter_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
551
        cmd = self._generator.modify_filter_command(filter_id, kwargs)
552
        return self.send_command(cmd)
553
554
    def modify_group(self, group_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
555
        cmd = self._generator.modify_group_command(group_id, kwargs)
556
        return self.send_command(cmd)
557
558
    def modify_note(self, note_id, text, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
559
        cmd = self._generator.modify_note_command(note_id, text, kwargs)
560
        return self.send_command(cmd)
561
562
    def modify_override(self, override_id, text, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
563
        cmd = self._generator.modify_override_command(override_id, text,
564
                                                      kwargs)
565
        return self.send_command(cmd)
566
567
    def modify_permission(self, permission_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
568
        cmd = self._generator.modify_permission_command(
569
            permission_id, kwargs)
570
        return self.send_command(cmd)
571
572
    def modify_port_list(self, port_list_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
573
        cmd = self._generator.modify_port_list_command(port_list_id, kwargs)
574
        return self.send_command(cmd)
575
576
    def modify_report(self, report_id, comment):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
577
        cmd = '<modify_report report_id="{0}"><comment>{1}</comment>' \
578
              '</modify_report>'.format(report_id, comment)
579
        return self.send_command(cmd)
580
581
    def modify_report_format(self, report_format_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
582
        cmd = self._generator.modify_report_format_command(report_format_id,
583
                                                           kwargs)
584
        return self.send_command(cmd)
585
586
    def modify_role(self, role_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
587
        cmd = self._generator.modify_role_command(role_id, kwargs)
588
        return self.send_command(cmd)
589
590
    def modify_scanner(self, scanner_id, host, port, scanner_type, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
591
        cmd = self._generator.modify_scanner_command(scanner_id, host, port,
592
                                                     scanner_type, kwargs)
593
        return self.send_command(cmd)
594
595
    def modify_schedule(self, schedule_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
596
        cmd = self._generator.modify_schedule_command(schedule_id, kwargs)
597
        return self.send_command(cmd)
598
599
    def modify_setting(self, setting_id, name, value):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
600
        cmd = '<modify_setting setting_id="{0}"><name>{1}</name>' \
601
              '<value>{2}</value></modify_setting>' \
602
              ''.format(setting_id, name, value)
603
        return self.send_command(cmd)
604
605
    def modify_tag(self, tag_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
606
        cmd = self._generator.modify_tag_command(tag_id, kwargs)
607
        return self.send_command(cmd)
608
609
    def modify_target(self, target_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
610
        cmd = self._generator.modify_target_command(target_id, kwargs)
611
        return self.send_command(cmd)
612
613
    def modify_task(self, task_id, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
614
        cmd = self._generator.modify_task_command(task_id, kwargs)
615
        return self.send_command(cmd)
616
617
    def modify_user(self, **kwargs):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
618
        cmd = self._generator.modify_user_command(kwargs)
619
        return self.send_command(cmd)
620
621
    def move_task(self, task_id, slave_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
622
        cmd = '<move_task task_id="{0}" slave_id="{1}"/>'.format(
623
            task_id, slave_id)
624
        return self.send_command(cmd)
625
626
    def restore(self, entity_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
627
        cmd = '<restore id="{0}"/>'.format(entity_id)
628
        return self.send_command(cmd)
629
630
    def resume_task(self, task_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
631
        cmd = '<resume_task task_id="{0}"/>'.format(task_id)
632
        return self.send_command(cmd)
633
634
    def start_task(self, task_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
635
        cmd = '<start_task task_id="{0}"/>'.format(task_id)
636
        return self.send_command(cmd)
637
638
    def stop_task(self, task_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
639
        cmd = '<stop_task task_id="{0}"/>'.format(task_id)
640
        return self.send_command(cmd)
641
642
    def sync_cert(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
643
        cmd = '<sync_cert/>'
644
        return self.send_command(cmd)
645
646
    def sync_config(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
647
        cmd = '<sync_config/>'
648
        return self.send_command(cmd)
649
650
    def sync_feed(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
651
        cmd = '<sync_feed/>'
652
        return self.send_command(cmd)
653
654
    def sync_scap(self):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
655
        cmd = '<sync_scap/>'
656
        return self.send_command(cmd)
657
658
    def test_alert(self, alert_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
659
        cmd = '<test_alert alert_id="{0}"/>'.format(alert_id)
660
        return self.send_command(cmd)
661
662
    def verify_agent(self, agent_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
663
        cmd = '<verify_agent agent_id="{0}"/>'.format(agent_id)
664
        return self.send_command(cmd)
665
666
    def verify_report_format(self, report_format_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
667
        cmd = '<verify_report_format report_format_id="{0}"/>'.format(
668
            report_format_id)
669
        return self.send_command(cmd)
670
671
    def verify_scanner(self, scanner_id):
0 ignored issues
show
Coding Style introduced by
This method should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
672
        cmd = '<verify_scanner scanner_id="{0}"/>'.format(scanner_id)
673
        return self.send_command(cmd)
674