syneto_api 0.2.2__tar.gz → 0.2.4__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.
- {syneto_api-0.2.2 → syneto_api-0.2.4}/PKG-INFO +2 -1
- {syneto_api-0.2.2 → syneto_api-0.2.4}/pyproject.toml +1 -1
- {syneto_api-0.2.2 → syneto_api-0.2.4}/setup.py +1 -1
- {syneto_api-0.2.2 → syneto_api-0.2.4}/src/syneto_api/storage_api.py +42 -0
- {syneto_api-0.2.2 → syneto_api-0.2.4}/src/syneto_api/virt_api.py +16 -0
- {syneto_api-0.2.2 → syneto_api-0.2.4}/README.md +0 -0
- {syneto_api-0.2.2 → syneto_api-0.2.4}/src/syneto_api/__init__.py +0 -0
- {syneto_api-0.2.2 → syneto_api-0.2.4}/src/syneto_api/api_client.py +0 -0
- {syneto_api-0.2.2 → syneto_api-0.2.4}/src/syneto_api/auth_api.py +0 -0
- {syneto_api-0.2.2 → syneto_api-0.2.4}/src/syneto_api/protection_api.py +0 -0
- {syneto_api-0.2.2 → syneto_api-0.2.4}/src/syneto_api/settings.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: syneto-api
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
4
4
|
Summary: Syneto Client API library
|
|
5
5
|
Home-page: https://github.com/SynetoNet/syneto-api
|
|
6
6
|
License: Proprietary
|
|
@@ -12,6 +12,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.6
|
|
13
13
|
Classifier: Programming Language :: Python :: 3.7
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
15
16
|
Requires-Dist: python-dotenv (>=0.16.0,<0.17.0)
|
|
16
17
|
Requires-Dist: requests[secure] (>=2.25.1,<3.0.0)
|
|
17
18
|
Project-URL: Repository, https://github.com/SynetoNet/syneto-api
|
|
@@ -15,7 +15,7 @@ install_requires = \
|
|
|
15
15
|
|
|
16
16
|
setup_kwargs = {
|
|
17
17
|
'name': 'syneto-api',
|
|
18
|
-
'version': '0.2.
|
|
18
|
+
'version': '0.2.4',
|
|
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',
|
|
@@ -128,3 +128,45 @@ class Storage(APIClientBase):
|
|
|
128
128
|
volume_id=volume_id,
|
|
129
129
|
snapshot_name=snapshot_name,
|
|
130
130
|
)
|
|
131
|
+
|
|
132
|
+
def get_volume_files(self, volume_id: str):
|
|
133
|
+
return self.get_request(
|
|
134
|
+
"/volumes/{volume_id}/files",
|
|
135
|
+
volume_id=volume_id
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
def delete_volume_files(self, volume_id: str, file_path: str = None, pattern: str = None):
|
|
139
|
+
return self.delete_request(
|
|
140
|
+
"/volumes/{volume_id}/files",
|
|
141
|
+
volume_id=volume_id,
|
|
142
|
+
query_args={"file_path": file_path, "pattern": pattern}
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
def get_volume_file_content(self, volume_id: str, file_path: str):
|
|
146
|
+
return self.get_request(
|
|
147
|
+
"/volumes/{volume_id}/files/content",
|
|
148
|
+
volume_id=volume_id,
|
|
149
|
+
query_args={"file_path": file_path}
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
def set_volume_file_content(self, volume_id: str, file_path: str, content: str):
|
|
153
|
+
return self.post_request(
|
|
154
|
+
"/volumes/{volume_id}/files/content",
|
|
155
|
+
volume_id=volume_id,
|
|
156
|
+
query_args={"file_path": file_path},
|
|
157
|
+
body={'content': content}
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
def create_directory_in_volume(self, volume_id: str, dir_path: str):
|
|
161
|
+
return self.post_request(
|
|
162
|
+
"/volumes/{volume_id}/folder",
|
|
163
|
+
volume_id=volume_id,
|
|
164
|
+
query_args={"dir_path": dir_path}
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
def delete_directory_in_volume(self, volume_id: str, dir_path: str):
|
|
168
|
+
return self.delete_request(
|
|
169
|
+
"/volumes/{volume_id}/folder",
|
|
170
|
+
volume_id=volume_id,
|
|
171
|
+
query_args={"dir_path": dir_path}
|
|
172
|
+
)
|
|
@@ -22,3 +22,19 @@ class Virtualization(APIClientBase):
|
|
|
22
22
|
|
|
23
23
|
def get_image_repository(self):
|
|
24
24
|
return self.get_request("/image-repository")
|
|
25
|
+
|
|
26
|
+
def create_nas_datastore(self, server: str, mountpoint: str, hosts_syn_ids=None):
|
|
27
|
+
return self.post_request(
|
|
28
|
+
"/vmware/datastores",
|
|
29
|
+
body={
|
|
30
|
+
"server": server,
|
|
31
|
+
"mountpoint": mountpoint,
|
|
32
|
+
"hosts_syn_ids": hosts_syn_ids if hosts_syn_ids else [],
|
|
33
|
+
},
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
def delete_nas_datastore(self, syn_id: str = None, mountpoint: str = None):
|
|
37
|
+
return self.delete_request(
|
|
38
|
+
"/vmware/datastores",
|
|
39
|
+
query_args={"datastore_syn_id": syn_id, "datastore_mountpoint": mountpoint},
|
|
40
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|