mirror of
https://github.com/recklessop/Zerto_Exporter.git
synced 2026-07-03 07:53:15 -04:00
zvma10 wrapper module
Created a python module that has everything needed for comms with ZVMA version 10 in a seperate class. It does not have full api coverage, but is enough to start refactoring the exporter to use the class for ZVMa10
This commit is contained in:
@@ -16,8 +16,11 @@ from tinydb import TinyDB, Query
|
||||
from tinydbstorage.storage import MemoryStorage
|
||||
from version import VERSION
|
||||
from zvma10.vcenter import vcsite
|
||||
from zvma10.zvma import zvmsite
|
||||
from posthog import Posthog
|
||||
|
||||
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
|
||||
callhomestats = os.getenv("CALL_HOME_STATS", 'True').lower() in ('false', '0', 'f')
|
||||
verifySSL = os.getenv("VERIFY_SSL", 'False').lower() in ('true', '1', 't')
|
||||
zvm_url = os.environ.get('ZVM_HOST', '192.168.50.60')
|
||||
zvm_port = os.environ.get('ZVM_PORT', '443')
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
c50dfc5a-bbd3-49e4-b8f8-688b19e89960
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# version.py
|
||||
VERSION = "1.3.0"
|
||||
VERSION = "2.0.0"
|
||||
|
||||
def main():
|
||||
# Put your main program code here
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
print("Initializing zvma10 package...")
|
||||
|
||||
#from .zvma import zvm
|
||||
from .vcenter import vcsite
|
||||
from .zvma import zvmsite
|
||||
@@ -0,0 +1,10 @@
|
||||
# version.py
|
||||
VERSION = "0.1.0"
|
||||
|
||||
def main():
|
||||
# Put your main program code here
|
||||
print(VERSION)
|
||||
|
||||
if __name__ == '__main__':
|
||||
# This code will be executed only when the file is run as the main program
|
||||
main()
|
||||
@@ -1,5 +1,4 @@
|
||||
print("Initializing zvma10 package...")
|
||||
|
||||
#from .zvma import zvm
|
||||
from .vcenter import vcsite
|
||||
from .zvma import zvmsite
|
||||
@@ -0,0 +1,26 @@
|
||||
import requests
|
||||
from requests import Request, Session
|
||||
|
||||
# Create a Request object
|
||||
url = 'http://httpbin.org/post'
|
||||
headers = {'Content-Type': 'application/json'}
|
||||
data = {'key': 'value'}
|
||||
req = Request('POST', url, data=data, headers=headers)
|
||||
|
||||
# Prepare the request
|
||||
prepared_req = req.prepare()
|
||||
|
||||
# Print the prepared request details
|
||||
print("Prepared Request:")
|
||||
print(f"URL: {prepared_req.url}")
|
||||
print(f"Method: {prepared_req.method}")
|
||||
print(f"Headers: {prepared_req.headers}")
|
||||
print(f"Body: {prepared_req.body}")
|
||||
|
||||
# Send the request using a Session
|
||||
with Session() as s:
|
||||
response = s.send(prepared_req)
|
||||
|
||||
# Print the response
|
||||
print(f"\nResponse Status Code: {response.status_code}")
|
||||
print(response.text)
|
||||
@@ -0,0 +1,10 @@
|
||||
# version.py
|
||||
VERSION = "0.1.0"
|
||||
|
||||
def main():
|
||||
# Put your main program code here
|
||||
print(VERSION)
|
||||
|
||||
if __name__ == '__main__':
|
||||
# This code will be executed only when the file is run as the main program
|
||||
main()
|
||||
+748
-345
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user