syneto_api 0.2.1__tar.gz → 0.2.2__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: syneto-api
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: Syneto Client API library
5
5
  Home-page: https://github.com/SynetoNet/syneto-api
6
6
  License: Proprietary
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "syneto_api"
3
- version = "0.2.1"
3
+ version = "0.2.2"
4
4
  description = "Syneto Client API library"
5
5
  authors = ["Your Name <you@example.com>"]
6
6
  license = "Proprietary"
@@ -15,7 +15,7 @@ install_requires = \
15
15
 
16
16
  setup_kwargs = {
17
17
  'name': 'syneto-api',
18
- 'version': '0.2.1',
18
+ 'version': '0.2.2',
19
19
  'description': 'Syneto Client API library',
20
20
  'long_description': '# Syneto API\n\nSyneto Client API library: authentication, storage, virtualization and protection\n\n# Installation\n\n```\n$ pip install syneto-api\n```\n\n# Basic Usage\n\n```\nfrom syneto_api import Authentication, Virtualization, Storage, Protection\n\nauth_api = Authentication(base_url="https://syneto-instance-ip-address/api/auth", insecure_ssl=True)\nresponse = auth_api.login(username="admin", password="admin")\njwt = response[\'jwt\']\n\nvirt_api = Virtualization(base_url="https://syneto-instance-ip-address/api/virtualization", insecure_ssl=True)\nvirt_api.set_auth_jwt(jwt)\nprint(virt_api.get_vms())\n\nstorage_api = Storage(base_url="https://syneto-instance-ip-address/api/storage", insecure_ssl=True)\nstorage_api.set_auth_jwt(jwt)\nprint(storage_api.get_pools())\n```\n\n# Environment Variables\n\nFor conveninence, the base urls for the api endpoints are also accepted as environment variables, please see below.\n\n```\nAUTH_SERVICE=https://syneto-instance-ip-address/api/auth\nVIRTUALIZATION_SERVICE=https://syneto-instance-ip-address/api/virtualization\nSTORAGE_SERVICE=https://syneto-instance-ip-address/api/storage\nPROTECTION_SERVICE=https://syneto-instance-ip-address/api/protection\n```\n\nIf you are using self-signed SSL certificates, set the following env. so that the http request library does not perform ssl verification. \n\n```\nALLOW_INSECURE_SSL=True\n```\n',
21
21
  'author': 'Your Name',
@@ -7,22 +7,22 @@ class Protection(APIClientBase):
7
7
  super().__init__(url_base or os.environ.get("PROTECTION_SERVICE", ""), **kwargs)
8
8
 
9
9
  def get_policies(self):
10
- return self.get_request("/policies/")
10
+ return self.get_request("/policies")
11
11
 
12
12
  def get_protected_vms(self):
13
- return self.get_request("/vms/")
13
+ return self.get_request("/vms")
14
14
 
15
15
  def get_jobs(self):
16
- return self.get_request("/jobs/")
16
+ return self.get_request("/jobs")
17
17
 
18
18
  def get_job(self, id):
19
19
  return self.get_request("/jobs/{}", id)
20
20
 
21
21
  def patch_job(self, id, payload):
22
- return self.patch_request("/jobs/", query_args={"id": id}, body=payload)
22
+ return self.patch_request("/jobs", query_args={"id": id}, body=payload)
23
23
 
24
24
  def remove_job(self, id):
25
- return self.delete_request("/jobs/", query_args={"id": id})
25
+ return self.delete_request("/jobs", query_args={"id": id})
26
26
 
27
27
  def create_external_vm_protection_job(self, config):
28
28
  body = {"config": config}
@@ -35,3 +35,18 @@ class Protection(APIClientBase):
35
35
  def create_local_vm_replication_job(self, config):
36
36
  body = {"config": config}
37
37
  return self.post_request("/jobs/replicate-local-vm", body=body)
38
+
39
+ def get_replication_hosts(self):
40
+ return self.get_request("/hosts")
41
+
42
+ def get_replication_host(self, id):
43
+ return self.get_request("/hosts/{}", id)
44
+
45
+ def create_replication_host(self, payload):
46
+ return self.post_request("/hosts", body=payload)
47
+
48
+ def remove_replication_host(self, id):
49
+ return self.delete_request("/hosts", query_args={"id": id})
50
+
51
+ def patch_replication_host(self, id, payload):
52
+ return self.patch_request("/hosts", query_args={"id": id}, body=payload)
File without changes