algosec-appviz 0.0.8__tar.gz → 0.0.9__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: algosec_appviz
3
- Version: 0.0.8
3
+ Version: 0.0.9
4
4
  Summary: AlgoSec AppViz Library
5
5
  Home-page: https://github.com/bogdan-iot/algosec-appviz
6
6
  License: LICENSE
@@ -6,7 +6,7 @@ build-backend = "poetry.core.masonry.api"
6
6
  name = "algosec_appviz"
7
7
  repository = "https://github.com/bogdan-iot/algosec-appviz"
8
8
  documentation = "https://github.com/bogdan-iot/algosec-appviz/blob/master/README.md"
9
- version = "0.0.8"
9
+ version = "0.0.9"
10
10
  license = "LICENSE"
11
11
  readme = "README.md"
12
12
  description = "AlgoSec AppViz Library"
@@ -82,7 +82,7 @@ class AppViz:
82
82
  """
83
83
  Deletes a network object in AppViz
84
84
  :param obj_id: The object ID
85
- :return: True if successful, false if not
85
+ :return: Change details if successful, empty string otherwise
86
86
  """
87
87
  if not obj_id:
88
88
  raise ValueError("Object ID is mandatory")
@@ -96,6 +96,29 @@ class AppViz:
96
96
 
97
97
  return result
98
98
 
99
+ def update_network_object(self, obj_id=None, **kwargs):
100
+ """
101
+ Updates a network object in AppViz
102
+ :return: The new object details, if successful, empty string otherwise
103
+ """
104
+ if not obj_id:
105
+ raise ValueError("Object ID is mandatory")
106
+
107
+ result = self._make_api_call('POST',
108
+ f'/BusinessFlow/rest/v1/network_objects/{obj_id}',
109
+ body={**kwargs})
110
+
111
+ if isinstance(result, dict) and 'networkObject' in result.keys():
112
+ return result['networkObject']
113
+
114
+ try:
115
+ print(result[1])
116
+ except KeyError:
117
+ if 'success' in result.keys() and not result['success']:
118
+ print(result['message'])
119
+
120
+ return ""
121
+
99
122
  def get_applications(self):
100
123
  response = self._make_api_call('GET',
101
124
  '/BusinessFlow/rest/v1/applications')
File without changes
File without changes