Skip to content

Commit 605ce3f

Browse files
committed
Break some overlong docstring lines
1 parent c145b93 commit 605ce3f

File tree

2 files changed

+54
-29
lines changed

2 files changed

+54
-29
lines changed

gvm/http/core/connector.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ def url_join(cls, base: str, rel_path: str) -> str:
3131
"""
3232
Combines a base URL and a relative path into one URL.
3333
34-
Unlike `urrlib.parse.urljoin` the base path will always be the parent of the relative path as if it
35-
ends with "/".
34+
Unlike `urrlib.parse.urljoin` the base path will always be the parent of the
35+
relative path as if it ends with "/".
3636
"""
3737
if base.endswith("/"):
3838
return urllib.parse.urljoin(base, rel_path)
@@ -50,12 +50,14 @@ def __init__(
5050
Create a new HTTP API Connector.
5151
5252
Args:
53-
base_url: The base server URL to which request-specific paths will be appended for the requests
53+
base_url: The base server URL to which request-specific paths will be appended
54+
for the requests
5455
server_ca_path: Optional path to a CA certificate for verifying the server.
5556
If none is given, server verification is disabled.
56-
client_cert_paths: Optional path to a client private key and certificate for authentication.
57-
Can be a combined key and certificate file or a tuple containing separate files.
58-
The key must not be encrypted.
57+
client_cert_paths: Optional path to a client private key and certificate
58+
for authentication.
59+
Can be a combined key and certificate file or a tuple containing separate files.
60+
The key must not be encrypted.
5961
"""
6062

6163
self.base_url = base_url
@@ -90,7 +92,8 @@ def delete(
9092
9193
Args:
9294
rel_path: The relative path for the request
93-
raise_for_status: Whether to raise an error if response has a non-success HTTP status code
95+
raise_for_status: Whether to raise an error if response has a
96+
non-success HTTP status code
9497
params: Optional dict of URL-encoded parameters
9598
headers: Optional additional headers added to the request
9699
@@ -116,7 +119,8 @@ def get(
116119
117120
Args:
118121
rel_path: The relative path for the request
119-
raise_for_status: Whether to raise an error if response has a non-success HTTP status code
122+
raise_for_status: Whether to raise an error if response has a
123+
non-success HTTP status code
120124
params: Optional dict of URL-encoded parameters
121125
headers: Optional additional headers added to the request
122126
@@ -139,12 +143,14 @@ def post_json(
139143
headers: Optional[Dict[str, str]] = None,
140144
) -> HttpResponse:
141145
"""
142-
Sends a ``POST`` request, using the given JSON-compatible object as the request body, and returns the response.
146+
Sends a ``POST`` request, using the given JSON-compatible object as the
147+
request body, and returns the response.
143148
144149
Args:
145150
rel_path: The relative path for the request
146151
json: The object to use as the request body.
147-
raise_for_status: Whether to raise an error if response has a non-success HTTP status code
152+
raise_for_status: Whether to raise an error if response has a
153+
non-success HTTP status code
148154
params: Optional dict of URL-encoded parameters
149155
headers: Optional additional headers added to the request
150156

gvm/http/openvasd/openvasd1.py

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def get_health_alive(
4444
Gets the "alive" health status of the scanner.
4545
4646
Args:
47-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
47+
raise_for_status: Whether to raise an error if scanner responded with a
48+
non-success HTTP status code.
4849
4950
Return:
5051
The HTTP response. See GET /health/alive in the openvasd API documentation.
@@ -60,7 +61,8 @@ def get_health_ready(
6061
Gets the "ready" health status of the scanner.
6162
6263
Args:
63-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
64+
raise_for_status: Whether to raise an error if scanner responded with a
65+
non-success HTTP status code.
6466
6567
Return:
6668
The HTTP response. See GET /health/ready in the openvasd API documentation.
@@ -76,7 +78,8 @@ def get_health_started(
7678
Gets the "started" health status of the scanner.
7779
7880
Args:
79-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
81+
raise_for_status: Whether to raise an error if scanner responded with a
82+
non-success HTTP status code.
8083
8184
Return:
8285
The HTTP response. See GET /health/started in the openvasd API documentation.
@@ -92,7 +95,8 @@ def get_notus_os_list(
9295
Gets the list of operating systems available in Notus.
9396
9497
Args:
95-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
98+
raise_for_status: Whether to raise an error if scanner responded with a
99+
non-success HTTP status code.
96100
97101
Return:
98102
The HTTP response. See GET /notus in the openvasd API documentation.
@@ -110,9 +114,11 @@ def run_notus_scan(
110114
Gets the Notus results for a given operating system and list of packages.
111115
112116
Args:
113-
os: Name of the operating system as returned in the list returned by get_notus_os_products.
117+
os: Name of the operating system as returned in the list returned by
118+
get_notus_os_products.
114119
package_list: List of package names to check.
115-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
120+
raise_for_status: Whether to raise an error if scanner responded with a
121+
non-success HTTP status code.
116122
117123
Return:
118124
The HTTP response. See POST /notus/{os} in the openvasd API documentation.
@@ -131,7 +137,8 @@ def get_scan_preferences(
131137
Gets the list of available scan preferences.
132138
133139
Args:
134-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
140+
raise_for_status: Whether to raise an error if scanner responded with a
141+
non-success HTTP status code.
135142
136143
Return:
137144
The HTTP response. See POST /scans/preferences in the openvasd API documentation.
@@ -157,7 +164,8 @@ def create_scan(
157164
target: The target definition for the scan.
158165
vt_selection: The VT selection for the scan, including VT preferences.
159166
scanner_params: The optional scanner parameters.
160-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
167+
raise_for_status: Whether to raise an error if scanner responded with a
168+
non-success HTTP status code.
161169
162170
Return:
163171
The HTTP response. See POST /scans in the openvasd API documentation.
@@ -180,7 +188,8 @@ def delete_scan(
180188
181189
Args:
182190
scan_id: The id of the scan to perform the action on.
183-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
191+
raise_for_status: Whether to raise an error if scanner responded with a
192+
non-success HTTP status code.
184193
185194
Return:
186195
The HTTP response. See DELETE /scans/{id} in the openvasd API documentation.
@@ -195,7 +204,8 @@ def get_scans(self, *, raise_for_status: bool = False) -> HttpResponse:
195204
Gets the list of available scans.
196205
197206
Args:
198-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
207+
raise_for_status: Whether to raise an error if scanner responded with a
208+
non-success HTTP status code.
199209
200210
Return:
201211
The HTTP response. See GET /scans in the openvasd API documentation.
@@ -210,7 +220,8 @@ def get_scan(
210220
211221
Args:
212222
scan_id: The id of the scan to get.
213-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
223+
raise_for_status: Whether to raise an error if scanner responded with a
224+
non-success HTTP status code.
214225
215226
Return:
216227
The HTTP response. See GET /scans/{id} in the openvasd API documentation.
@@ -235,7 +246,8 @@ def get_scan_results(
235246
scan_id: The id of the scan to get the results of.
236247
range_start: Optional index of the first result to get.
237248
range_end: Optional index of the last result to get.
238-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
249+
raise_for_status: Whether to raise an error if scanner responded with a
250+
non-success HTTP status code.
239251
240252
Return:
241253
The HTTP response. See GET /scans/{id}/results in the openvasd API documentation.
@@ -286,7 +298,8 @@ def get_scan_result(
286298
Args:
287299
scan_id: The id of the scan to get the results of.
288300
result_id: The id of the result to get.
289-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
301+
raise_for_status: Whether to raise an error if scanner responded with a
302+
non-success HTTP status code.
290303
291304
Return:
292305
The HTTP response. See GET /scans/{id}/{rid} in the openvasd API documentation.
@@ -307,7 +320,8 @@ def get_scan_status(
307320
308321
Args:
309322
scan_id: The id of the scan to get the status of.
310-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
323+
raise_for_status: Whether to raise an error if scanner responded with a
324+
non-success HTTP status code.
311325
312326
Return:
313327
The HTTP response. See GET /scans/{id}/{rid} in the openvasd API documentation.
@@ -326,7 +340,8 @@ def run_scan_action(
326340
Args:
327341
scan_id: The id of the scan to perform the action on.
328342
scan_action: The action to perform.
329-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
343+
raise_for_status: Whether to raise an error if scanner responded with a
344+
non-success HTTP status code.
330345
331346
Return:
332347
The HTTP response. See POST /scans/{id} in the openvasd API documentation.
@@ -347,7 +362,8 @@ def start_scan(
347362
348363
Args:
349364
scan_id: The id of the scan to perform the action on.
350-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
365+
raise_for_status: Whether to raise an error if scanner responded with a
366+
non-success HTTP status code.
351367
352368
Return:
353369
The HTTP response. See POST /scans/{id} in the openvasd API documentation.
@@ -364,7 +380,8 @@ def stop_scan(
364380
365381
Args:
366382
scan_id: The id of the scan to perform the action on.
367-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
383+
raise_for_status: Whether to raise an error if scanner responded with a
384+
non-success HTTP status code.
368385
369386
Return:
370387
The HTTP response. See POST /scans/{id} in the openvasd API documentation.
@@ -378,7 +395,8 @@ def get_vts(self, *, raise_for_status: bool = False) -> HttpResponse:
378395
Gets a list of available vulnerability tests (VTs) on the scanner.
379396
380397
Args:
381-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
398+
raise_for_status: Whether to raise an error if scanner responded with a
399+
non-success HTTP status code.
382400
383401
Return:
384402
The HTTP response. See GET /vts in the openvasd API documentation.
@@ -393,7 +411,8 @@ def get_vt(
393411
394412
Args:
395413
oid: OID of the VT to get.
396-
raise_for_status: Whether to raise an error if scanner responded with a non-success HTTP status code.
414+
raise_for_status: Whether to raise an error if scanner responded with a
415+
non-success HTTP status code.
397416
398417
Return:
399418
The HTTP response. See DELETE /scans/{id} in the openvasd API documentation.

0 commit comments

Comments
 (0)