besapi 3.7.2__tar.gz → 3.7.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {besapi-3.7.2/src/besapi.egg-info → besapi-3.7.6}/PKG-INFO +1 -1
- {besapi-3.7.2 → besapi-3.7.6}/src/besapi/besapi.py +4 -1
- {besapi-3.7.2 → besapi-3.7.6/src/besapi.egg-info}/PKG-INFO +1 -1
- {besapi-3.7.2 → besapi-3.7.6}/src/bescli/bescli.py +29 -2
- {besapi-3.7.2 → besapi-3.7.6}/LICENSE.txt +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/MANIFEST.in +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/README.md +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/pyproject.toml +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/setup.cfg +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/setup.py +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/besapi/__init__.py +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/besapi/__main__.py +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/besapi/plugin_utilities.py +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/besapi/schemas/BES.xsd +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/besapi/schemas/BESAPI.xsd +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/besapi/schemas/BESActionSettings.xsd +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/besapi.egg-info/SOURCES.txt +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/besapi.egg-info/dependency_links.txt +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/besapi.egg-info/requires.txt +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/besapi.egg-info/top_level.txt +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/bescli/__init__.py +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/src/bescli/__main__.py +0 -0
- {besapi-3.7.2 → besapi-3.7.6}/tests/tests.py +0 -0
|
@@ -29,7 +29,7 @@ import requests
|
|
|
29
29
|
from lxml import etree, objectify
|
|
30
30
|
from pkg_resources import resource_filename
|
|
31
31
|
|
|
32
|
-
__version__ = "3.7.
|
|
32
|
+
__version__ = "3.7.6"
|
|
33
33
|
|
|
34
34
|
besapi_logger = logging.getLogger("besapi")
|
|
35
35
|
|
|
@@ -345,8 +345,11 @@ class BESConnection:
|
|
|
345
345
|
besapi_logger.info("Query did not return any results")
|
|
346
346
|
else:
|
|
347
347
|
besapi_logger.error("%s\n%s", err2, rel_result.text)
|
|
348
|
+
result.append("ERROR: " + rel_result.text)
|
|
348
349
|
raise
|
|
349
350
|
else:
|
|
351
|
+
besapi_logger.error("%s\n%s", err, rel_result.text)
|
|
352
|
+
result.append("ERROR: " + rel_result.text)
|
|
350
353
|
raise
|
|
351
354
|
return result
|
|
352
355
|
|
|
@@ -54,6 +54,9 @@ class BESCLInterface(Cmd):
|
|
|
54
54
|
def do_get(self, line):
|
|
55
55
|
"""Perform get request to BigFix server using provided api endpoint argument"""
|
|
56
56
|
|
|
57
|
+
# remove any extra whitespace
|
|
58
|
+
line = line.strip()
|
|
59
|
+
|
|
57
60
|
# Remove root server prefix:
|
|
58
61
|
# if root server prefix is not removed
|
|
59
62
|
# and root server is given as IP Address,
|
|
@@ -80,6 +83,26 @@ class BESCLInterface(Cmd):
|
|
|
80
83
|
else:
|
|
81
84
|
self.pfeedback("Not currently logged in. Type 'login'.")
|
|
82
85
|
|
|
86
|
+
def do_delete(self, line):
|
|
87
|
+
"""Perform delete request to BigFix server using provided api endpoint argument"""
|
|
88
|
+
|
|
89
|
+
# remove any extra whitespace
|
|
90
|
+
line = line.strip()
|
|
91
|
+
|
|
92
|
+
# Remove root server prefix:
|
|
93
|
+
if "/api/" in line:
|
|
94
|
+
line = str(line).split("/api/", 1)[1]
|
|
95
|
+
self.pfeedback("get " + line)
|
|
96
|
+
|
|
97
|
+
if self.bes_conn:
|
|
98
|
+
output_item = self.bes_conn.delete(line)
|
|
99
|
+
|
|
100
|
+
print(output_item)
|
|
101
|
+
# print(output_item.besdict)
|
|
102
|
+
# print(output_item.besjson)
|
|
103
|
+
else:
|
|
104
|
+
self.pfeedback("Not currently logged in. Type 'login'.")
|
|
105
|
+
|
|
83
106
|
def do_post(self, statement):
|
|
84
107
|
"""post file as data to path"""
|
|
85
108
|
print(statement)
|
|
@@ -366,9 +389,13 @@ class BESCLInterface(Cmd):
|
|
|
366
389
|
def do_import_bes(self, statement):
|
|
367
390
|
"""import bes file"""
|
|
368
391
|
|
|
369
|
-
|
|
392
|
+
bes_file_path = str(statement.args).strip()
|
|
393
|
+
|
|
394
|
+
site_path = self.bes_conn.get_current_site_path(None)
|
|
395
|
+
|
|
396
|
+
self.poutput(f"Import file: {bes_file_path}")
|
|
370
397
|
|
|
371
|
-
self.poutput(self.bes_conn.import_bes_to_site(
|
|
398
|
+
self.poutput(self.bes_conn.import_bes_to_site(bes_file_path, site_path))
|
|
372
399
|
|
|
373
400
|
complete_upload = Cmd.path_complete
|
|
374
401
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|