files-com 1.6.21__py3-none-any.whl → 1.6.22__py3-none-any.whl

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.

Potentially problematic release.


This version of files-com might be problematic. Click here for more details.

_VERSION CHANGED
@@ -1 +1 @@
1
- 1.6.21
1
+ 1.6.22
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: files_com
3
- Version: 1.6.21
3
+ Version: 1.6.22
4
4
  Summary: Python bindings for the Files.com API
5
5
  License: MIT
6
6
  Requires-Python: >=3.5
@@ -1,14 +1,14 @@
1
1
  README.md,sha256=dJpTjuJA-JJIQ4CKgQhlbqyxanVatHk0RXgCD6KFl3A,28758
2
- _VERSION,sha256=YLmP7xdvh3MBv9DqDXx8Hi6eHuq3Rs1t5WxTuh4tGes,7
3
- files_com-1.6.21.dist-info/licenses/LICENSE,sha256=ziANl9OTD-5-iE8XYIZNm6IYBDxOCHwQ-mdhci7lNew,1102
4
- files_sdk/__init__.py,sha256=aAa61dEqjb5C6tGDX9RkP8WgqpmEWX4Mxg6G1-vlV1E,12631
2
+ _VERSION,sha256=BGiMiEju5eIpaZsVdJiA_zfTiz6mZ2efkNUntrI2cTs,7
3
+ files_com-1.6.22.dist-info/licenses/LICENSE,sha256=ziANl9OTD-5-iE8XYIZNm6IYBDxOCHwQ-mdhci7lNew,1102
4
+ files_sdk/__init__.py,sha256=FzNk1zvZjPXbQe-P9GoLBmAqTUoQ9cnGImUySJwTANM,12769
5
5
  files_sdk/api.py,sha256=HOLk50HLQCbnHwnAr9OElQEWvdA_BABBSEvvFSt1S4A,1846
6
6
  files_sdk/api_client.py,sha256=cfFvm-o4Ao8SWADiJv7t7qnJfG_LJmWV3l6ALTC-Opo,11264
7
7
  files_sdk/error.py,sha256=lZKht6lYj9i99CzRbHschmdSs6T2Y51-YrZX_5Y_o7A,64945
8
8
  files_sdk/list_obj.py,sha256=MWgmESLAmfh1uaSw76PWxmnf9f6_08TLUHe8_mCYKL4,1157
9
9
  files_sdk/path_util.py,sha256=7x8X3JLoMkcqNefCaBeHYXD8MGvPby4AOy-xnBX_LNk,1694
10
10
  files_sdk/util.py,sha256=6aA4N0Wq_ykINW7eMrs2ntFAL2hRLM6IvJf6n_yP34c,962
11
- files_sdk/models/__init__.py,sha256=LvKT5Ya05LG2dz0X1-9lO6UGtL0Us8AeZub0Bwxs1cU,5694
11
+ files_sdk/models/__init__.py,sha256=AmxdZaVf9i7sKE_sv7JJD8hpi271Yp2DFead0Apq6fQ,5763
12
12
  files_sdk/models/account_line_item.py,sha256=8FLg83Aqpz4y_QYy3fZ_KZsZFWv1f1KGD9T5CH1WSGs,1929
13
13
  files_sdk/models/action.py,sha256=M1lyMybE7SKht2nGXtYWp2l8b4oVkeImo6KF8DLiCos,2034
14
14
  files_sdk/models/action_notification_export.py,sha256=4cdEo2ZCDV3RH3GLSqHV7RWyJ2ONRSUq0glCEi94zd0,6636
@@ -81,6 +81,7 @@ files_sdk/models/public_hosting_request_log.py,sha256=wEoNH5wiUtsE50q3SEWBJxhevJ
81
81
  files_sdk/models/public_ip_address.py,sha256=5VSlJ4PZQilV6tpGRCnyvGJzqRzdSRpwVDZxKwsplcU,1259
82
82
  files_sdk/models/public_key.py,sha256=c-OySt4m2ghmPZ6jutTZTmB8IVYp5jN-OE8_K9k2U9Y,10039
83
83
  files_sdk/models/remote_bandwidth_snapshot.py,sha256=kryNewGqe_ZN4D3JBL26DoVYKDowubUNLXn7NQtEJb8,4476
84
+ files_sdk/models/remote_mount_backend.py,sha256=4twrZnD0IMylK5XwTssELl4mCk9EkzDyPXPtv3J4D1o,20539
84
85
  files_sdk/models/remote_server.py,sha256=crDqrWv56GEYW49Y0vUiZhXCvjymMyn-ByWmqfEof3k,86036
85
86
  files_sdk/models/remote_server_configuration_file.py,sha256=m6kfh5yUAYTP42nHuYJ-GFu73981kjjqPuZX3SeHbiA,3330
86
87
  files_sdk/models/request.py,sha256=mWOS36b5pRiAZqDuf1tGidw-FAikYPDqfv5LXdDJA9Q,8867
@@ -110,7 +111,7 @@ files_sdk/models/user_request.py,sha256=ykA5Lq0MYB7qTDOMMFBuyKa_R_LgQwGVorC-q-6q
110
111
  files_sdk/models/user_sftp_client_use.py,sha256=VnOo3ll6fwSc8grG5ZqGK8o3grYKg5P9b5B_hGS4vCs,2827
111
112
  files_sdk/models/web_dav_action_log.py,sha256=7__LZvb_fInvXwy90ur7IrcRSxKOwF8L6OwpjJbS73Y,355354
112
113
  files_sdk/models/webhook_test.py,sha256=AWGH8ULsgltBJL2YtTYGnAJ80cCVekrjZ2sUP0UlWgc,5018
113
- files_com-1.6.21.dist-info/METADATA,sha256=HKj3lG9blYFCmVgdhamlozZv7sfRvqE_M_HbUDVSSJU,29050
114
- files_com-1.6.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
115
- files_com-1.6.21.dist-info/top_level.txt,sha256=p_2P-gluT_8boeXQNixTP3x-tFd1-la2NedKOiln21I,10
116
- files_com-1.6.21.dist-info/RECORD,,
114
+ files_com-1.6.22.dist-info/METADATA,sha256=l1rFIfjCLrprM0QrH4kKO3Npt0EjSx4Lj4CToUJCoz8,29050
115
+ files_com-1.6.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
116
+ files_com-1.6.22.dist-info/top_level.txt,sha256=p_2P-gluT_8boeXQNixTP3x-tFd1-la2NedKOiln21I,10
117
+ files_com-1.6.22.dist-info/RECORD,,
files_sdk/__init__.py CHANGED
@@ -71,6 +71,7 @@ import files_sdk.models.public_hosting_request_log as public_hosting_request_log
71
71
  import files_sdk.models.public_ip_address as public_ip_address
72
72
  import files_sdk.models.public_key as public_key
73
73
  import files_sdk.models.remote_bandwidth_snapshot as remote_bandwidth_snapshot
74
+ import files_sdk.models.remote_mount_backend as remote_mount_backend
74
75
  import files_sdk.models.remote_server as remote_server
75
76
  import files_sdk.models.remote_server_configuration_file as remote_server_configuration_file
76
77
  import files_sdk.models.request as request
@@ -177,6 +178,7 @@ from files_sdk.models.public_hosting_request_log import PublicHostingRequestLog
177
178
  from files_sdk.models.public_ip_address import PublicIpAddress
178
179
  from files_sdk.models.public_key import PublicKey
179
180
  from files_sdk.models.remote_bandwidth_snapshot import RemoteBandwidthSnapshot
181
+ from files_sdk.models.remote_mount_backend import RemoteMountBackend
180
182
  from files_sdk.models.remote_server import RemoteServer
181
183
  from files_sdk.models.remote_server_configuration_file import (
182
184
  RemoteServerConfigurationFile,
@@ -219,7 +221,7 @@ session_id = None
219
221
  source_ip = None
220
222
  base_url = "https://app.files.com"
221
223
  base_path = "api/rest/v1"
222
- version = "1.6.21"
224
+ version = "1.6.22"
223
225
 
224
226
  __version__ = version
225
227
 
@@ -74,6 +74,7 @@ from files_sdk.models.public_hosting_request_log import PublicHostingRequestLog
74
74
  from files_sdk.models.public_ip_address import PublicIpAddress
75
75
  from files_sdk.models.public_key import PublicKey
76
76
  from files_sdk.models.remote_bandwidth_snapshot import RemoteBandwidthSnapshot
77
+ from files_sdk.models.remote_mount_backend import RemoteMountBackend
77
78
  from files_sdk.models.remote_server import RemoteServer
78
79
  from files_sdk.models.remote_server_configuration_file import (
79
80
  RemoteServerConfigurationFile,
@@ -0,0 +1,464 @@
1
+ import builtins # noqa: F401
2
+ from files_sdk.api import Api # noqa: F401
3
+ from files_sdk.list_obj import ListObj
4
+ from files_sdk.error import ( # noqa: F401
5
+ InvalidParameterError,
6
+ MissingParameterError,
7
+ NotImplementedError,
8
+ )
9
+
10
+
11
+ class RemoteMountBackend:
12
+ default_attributes = {
13
+ "canary_file_path": None, # string - Path to the canary file used for health checks.
14
+ "enabled": None, # boolean - True if this backend is enabled.
15
+ "fall": None, # int64 - Number of consecutive failures before considering the backend unhealthy.
16
+ "health_check_enabled": None, # boolean - True if health checks are enabled for this backend.
17
+ "health_check_type": None, # string - Type of health check to perform.
18
+ "interval": None, # int64 - Interval in seconds between health checks.
19
+ "min_free_cpu": None, # double - Minimum free CPU percentage required for this backend to be considered healthy.
20
+ "min_free_mem": None, # double - Minimum free memory percentage required for this backend to be considered healthy.
21
+ "priority": None, # int64 - Priority of this backend.
22
+ "remote_path": None, # string - Path on the remote server to treat as the root of this mount.
23
+ "remote_server_id": None, # int64 - The remote server that this backend is associated with.
24
+ "remote_server_mount_id": None, # int64 - The mount ID of the Remote Server Mount that this backend is associated with.
25
+ "rise": None, # int64 - Number of consecutive successes before considering the backend healthy.
26
+ "status": None, # string - Status of this backend.
27
+ "undergoing_maintenance": None, # boolean - True if this backend is undergoing maintenance.
28
+ "id": None, # int64 - Remote Mount Backend ID.
29
+ }
30
+
31
+ def __init__(self, attributes=None, options=None):
32
+ if not isinstance(attributes, dict):
33
+ attributes = {}
34
+ if not isinstance(options, dict):
35
+ options = {}
36
+ self.set_attributes(attributes)
37
+ self.options = options
38
+
39
+ def set_attributes(self, attributes):
40
+ for (
41
+ attribute,
42
+ default_value,
43
+ ) in RemoteMountBackend.default_attributes.items():
44
+ setattr(self, attribute, attributes.get(attribute, default_value))
45
+
46
+ def get_attributes(self):
47
+ return {
48
+ k: getattr(self, k, None)
49
+ for k in RemoteMountBackend.default_attributes
50
+ if getattr(self, k, None) is not None
51
+ }
52
+
53
+ # Reset backend status to healthy
54
+ def reset_status(self, params=None):
55
+ if not isinstance(params, dict):
56
+ params = {}
57
+
58
+ if hasattr(self, "id") and self.id:
59
+ params["id"] = self.id
60
+ else:
61
+ raise MissingParameterError("Current object doesn't have a id")
62
+ if "id" not in params:
63
+ raise MissingParameterError("Parameter missing: id")
64
+ if "id" in params and not isinstance(params["id"], int):
65
+ raise InvalidParameterError("Bad parameter: id must be an int")
66
+ Api.send_request(
67
+ "POST",
68
+ "/remote_mount_backends/{id}/reset_status".format(id=params["id"]),
69
+ params,
70
+ self.options,
71
+ )
72
+
73
+ # Parameters:
74
+ # canary_file_path (required) - string - Path to the canary file used for health checks.
75
+ # remote_server_mount_id (required) - int64 - The mount ID of the Remote Server Mount that this backend is associated with.
76
+ # remote_server_id (required) - int64 - The remote server that this backend is associated with.
77
+ # enabled - boolean - True if this backend is enabled.
78
+ # fall - int64 - Number of consecutive failures before considering the backend unhealthy.
79
+ # health_check_enabled - boolean - True if health checks are enabled for this backend.
80
+ # health_check_type - string - Type of health check to perform.
81
+ # interval - int64 - Interval in seconds between health checks.
82
+ # min_free_cpu - double - Minimum free CPU percentage required for this backend to be considered healthy.
83
+ # min_free_mem - double - Minimum free memory percentage required for this backend to be considered healthy.
84
+ # priority - int64 - Priority of this backend.
85
+ # remote_path - string - Path on the remote server to treat as the root of this mount.
86
+ # rise - int64 - Number of consecutive successes before considering the backend healthy.
87
+ def update(self, params=None):
88
+ if not isinstance(params, dict):
89
+ params = {}
90
+
91
+ if hasattr(self, "id") and self.id:
92
+ params["id"] = self.id
93
+ else:
94
+ raise MissingParameterError("Current object doesn't have a id")
95
+ if "id" not in params:
96
+ raise MissingParameterError("Parameter missing: id")
97
+ if "canary_file_path" not in params:
98
+ raise MissingParameterError("Parameter missing: canary_file_path")
99
+ if "remote_server_mount_id" not in params:
100
+ raise MissingParameterError(
101
+ "Parameter missing: remote_server_mount_id"
102
+ )
103
+ if "remote_server_id" not in params:
104
+ raise MissingParameterError("Parameter missing: remote_server_id")
105
+ if "id" in params and not isinstance(params["id"], int):
106
+ raise InvalidParameterError("Bad parameter: id must be an int")
107
+ if "canary_file_path" in params and not isinstance(
108
+ params["canary_file_path"], str
109
+ ):
110
+ raise InvalidParameterError(
111
+ "Bad parameter: canary_file_path must be an str"
112
+ )
113
+ if "remote_server_mount_id" in params and not isinstance(
114
+ params["remote_server_mount_id"], int
115
+ ):
116
+ raise InvalidParameterError(
117
+ "Bad parameter: remote_server_mount_id must be an int"
118
+ )
119
+ if "remote_server_id" in params and not isinstance(
120
+ params["remote_server_id"], int
121
+ ):
122
+ raise InvalidParameterError(
123
+ "Bad parameter: remote_server_id must be an int"
124
+ )
125
+ if "fall" in params and not isinstance(params["fall"], int):
126
+ raise InvalidParameterError("Bad parameter: fall must be an int")
127
+ if "health_check_type" in params and not isinstance(
128
+ params["health_check_type"], str
129
+ ):
130
+ raise InvalidParameterError(
131
+ "Bad parameter: health_check_type must be an str"
132
+ )
133
+ if "interval" in params and not isinstance(params["interval"], int):
134
+ raise InvalidParameterError(
135
+ "Bad parameter: interval must be an int"
136
+ )
137
+ if "priority" in params and not isinstance(params["priority"], int):
138
+ raise InvalidParameterError(
139
+ "Bad parameter: priority must be an int"
140
+ )
141
+ if "remote_path" in params and not isinstance(
142
+ params["remote_path"], str
143
+ ):
144
+ raise InvalidParameterError(
145
+ "Bad parameter: remote_path must be an str"
146
+ )
147
+ if "rise" in params and not isinstance(params["rise"], int):
148
+ raise InvalidParameterError("Bad parameter: rise must be an int")
149
+ response, _options = Api.send_request(
150
+ "PATCH",
151
+ "/remote_mount_backends/{id}".format(id=params["id"]),
152
+ params,
153
+ self.options,
154
+ )
155
+ return response.data
156
+
157
+ def delete(self, params=None):
158
+ if not isinstance(params, dict):
159
+ params = {}
160
+
161
+ if hasattr(self, "id") and self.id:
162
+ params["id"] = self.id
163
+ else:
164
+ raise MissingParameterError("Current object doesn't have a id")
165
+ if "id" not in params:
166
+ raise MissingParameterError("Parameter missing: id")
167
+ if "id" in params and not isinstance(params["id"], int):
168
+ raise InvalidParameterError("Bad parameter: id must be an int")
169
+ Api.send_request(
170
+ "DELETE",
171
+ "/remote_mount_backends/{id}".format(id=params["id"]),
172
+ params,
173
+ self.options,
174
+ )
175
+
176
+ def destroy(self, params=None):
177
+ self.delete(params)
178
+
179
+ def save(self):
180
+ if hasattr(self, "id") and self.id:
181
+ new_obj = self.update(self.get_attributes())
182
+ self.set_attributes(new_obj.get_attributes())
183
+ return True
184
+ else:
185
+ new_obj = create(self.get_attributes(), self.options)
186
+ self.set_attributes(new_obj.get_attributes())
187
+ return True
188
+
189
+
190
+ # Parameters:
191
+ # cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.
192
+ # per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
193
+ def list(params=None, options=None):
194
+ if not isinstance(params, dict):
195
+ params = {}
196
+ if not isinstance(options, dict):
197
+ options = {}
198
+ if "cursor" in params and not isinstance(params["cursor"], str):
199
+ raise InvalidParameterError("Bad parameter: cursor must be an str")
200
+ if "per_page" in params and not isinstance(params["per_page"], int):
201
+ raise InvalidParameterError("Bad parameter: per_page must be an int")
202
+ return ListObj(
203
+ RemoteMountBackend, "GET", "/remote_mount_backends", params, options
204
+ )
205
+
206
+
207
+ def all(params=None, options=None):
208
+ list(params, options)
209
+
210
+
211
+ # Parameters:
212
+ # id (required) - int64 - Remote Mount Backend ID.
213
+ def find(id, params=None, options=None):
214
+ if not isinstance(params, dict):
215
+ params = {}
216
+ if not isinstance(options, dict):
217
+ options = {}
218
+ params["id"] = id
219
+ if "id" in params and not isinstance(params["id"], int):
220
+ raise InvalidParameterError("Bad parameter: id must be an int")
221
+ if "id" not in params:
222
+ raise MissingParameterError("Parameter missing: id")
223
+ response, options = Api.send_request(
224
+ "GET",
225
+ "/remote_mount_backends/{id}".format(id=params["id"]),
226
+ params,
227
+ options,
228
+ )
229
+ return RemoteMountBackend(response.data, options)
230
+
231
+
232
+ def get(id, params=None, options=None):
233
+ find(id, params, options)
234
+
235
+
236
+ # Parameters:
237
+ # canary_file_path (required) - string - Path to the canary file used for health checks.
238
+ # remote_server_mount_id (required) - int64 - The mount ID of the Remote Server Mount that this backend is associated with.
239
+ # remote_server_id (required) - int64 - The remote server that this backend is associated with.
240
+ # enabled - boolean - True if this backend is enabled.
241
+ # fall - int64 - Number of consecutive failures before considering the backend unhealthy.
242
+ # health_check_enabled - boolean - True if health checks are enabled for this backend.
243
+ # health_check_type - string - Type of health check to perform.
244
+ # interval - int64 - Interval in seconds between health checks.
245
+ # min_free_cpu - double - Minimum free CPU percentage required for this backend to be considered healthy.
246
+ # min_free_mem - double - Minimum free memory percentage required for this backend to be considered healthy.
247
+ # priority - int64 - Priority of this backend.
248
+ # remote_path - string - Path on the remote server to treat as the root of this mount.
249
+ # rise - int64 - Number of consecutive successes before considering the backend healthy.
250
+ def create(params=None, options=None):
251
+ if not isinstance(params, dict):
252
+ params = {}
253
+ if not isinstance(options, dict):
254
+ options = {}
255
+ if "canary_file_path" in params and not isinstance(
256
+ params["canary_file_path"], str
257
+ ):
258
+ raise InvalidParameterError(
259
+ "Bad parameter: canary_file_path must be an str"
260
+ )
261
+ if "remote_server_mount_id" in params and not isinstance(
262
+ params["remote_server_mount_id"], int
263
+ ):
264
+ raise InvalidParameterError(
265
+ "Bad parameter: remote_server_mount_id must be an int"
266
+ )
267
+ if "remote_server_id" in params and not isinstance(
268
+ params["remote_server_id"], int
269
+ ):
270
+ raise InvalidParameterError(
271
+ "Bad parameter: remote_server_id must be an int"
272
+ )
273
+ if "enabled" in params and not isinstance(params["enabled"], bool):
274
+ raise InvalidParameterError("Bad parameter: enabled must be an bool")
275
+ if "fall" in params and not isinstance(params["fall"], int):
276
+ raise InvalidParameterError("Bad parameter: fall must be an int")
277
+ if "health_check_enabled" in params and not isinstance(
278
+ params["health_check_enabled"], bool
279
+ ):
280
+ raise InvalidParameterError(
281
+ "Bad parameter: health_check_enabled must be an bool"
282
+ )
283
+ if "health_check_type" in params and not isinstance(
284
+ params["health_check_type"], str
285
+ ):
286
+ raise InvalidParameterError(
287
+ "Bad parameter: health_check_type must be an str"
288
+ )
289
+ if "interval" in params and not isinstance(params["interval"], int):
290
+ raise InvalidParameterError("Bad parameter: interval must be an int")
291
+ if "min_free_cpu" in params and not isinstance(
292
+ params["min_free_cpu"], float
293
+ ):
294
+ raise InvalidParameterError(
295
+ "Bad parameter: min_free_cpu must be an float"
296
+ )
297
+ if "min_free_mem" in params and not isinstance(
298
+ params["min_free_mem"], float
299
+ ):
300
+ raise InvalidParameterError(
301
+ "Bad parameter: min_free_mem must be an float"
302
+ )
303
+ if "priority" in params and not isinstance(params["priority"], int):
304
+ raise InvalidParameterError("Bad parameter: priority must be an int")
305
+ if "remote_path" in params and not isinstance(params["remote_path"], str):
306
+ raise InvalidParameterError(
307
+ "Bad parameter: remote_path must be an str"
308
+ )
309
+ if "rise" in params and not isinstance(params["rise"], int):
310
+ raise InvalidParameterError("Bad parameter: rise must be an int")
311
+ if "canary_file_path" not in params:
312
+ raise MissingParameterError("Parameter missing: canary_file_path")
313
+ if "remote_server_mount_id" not in params:
314
+ raise MissingParameterError(
315
+ "Parameter missing: remote_server_mount_id"
316
+ )
317
+ if "remote_server_id" not in params:
318
+ raise MissingParameterError("Parameter missing: remote_server_id")
319
+ response, options = Api.send_request(
320
+ "POST", "/remote_mount_backends", params, options
321
+ )
322
+ return RemoteMountBackend(response.data, options)
323
+
324
+
325
+ # Reset backend status to healthy
326
+ def reset_status(id, params=None, options=None):
327
+ if not isinstance(params, dict):
328
+ params = {}
329
+ if not isinstance(options, dict):
330
+ options = {}
331
+ params["id"] = id
332
+ if "id" in params and not isinstance(params["id"], int):
333
+ raise InvalidParameterError("Bad parameter: id must be an int")
334
+ if "id" not in params:
335
+ raise MissingParameterError("Parameter missing: id")
336
+ Api.send_request(
337
+ "POST",
338
+ "/remote_mount_backends/{id}/reset_status".format(id=params["id"]),
339
+ params,
340
+ options,
341
+ )
342
+
343
+
344
+ # Parameters:
345
+ # canary_file_path (required) - string - Path to the canary file used for health checks.
346
+ # remote_server_mount_id (required) - int64 - The mount ID of the Remote Server Mount that this backend is associated with.
347
+ # remote_server_id (required) - int64 - The remote server that this backend is associated with.
348
+ # enabled - boolean - True if this backend is enabled.
349
+ # fall - int64 - Number of consecutive failures before considering the backend unhealthy.
350
+ # health_check_enabled - boolean - True if health checks are enabled for this backend.
351
+ # health_check_type - string - Type of health check to perform.
352
+ # interval - int64 - Interval in seconds between health checks.
353
+ # min_free_cpu - double - Minimum free CPU percentage required for this backend to be considered healthy.
354
+ # min_free_mem - double - Minimum free memory percentage required for this backend to be considered healthy.
355
+ # priority - int64 - Priority of this backend.
356
+ # remote_path - string - Path on the remote server to treat as the root of this mount.
357
+ # rise - int64 - Number of consecutive successes before considering the backend healthy.
358
+ def update(id, params=None, options=None):
359
+ if not isinstance(params, dict):
360
+ params = {}
361
+ if not isinstance(options, dict):
362
+ options = {}
363
+ params["id"] = id
364
+ if "id" in params and not isinstance(params["id"], int):
365
+ raise InvalidParameterError("Bad parameter: id must be an int")
366
+ if "canary_file_path" in params and not isinstance(
367
+ params["canary_file_path"], str
368
+ ):
369
+ raise InvalidParameterError(
370
+ "Bad parameter: canary_file_path must be an str"
371
+ )
372
+ if "remote_server_mount_id" in params and not isinstance(
373
+ params["remote_server_mount_id"], int
374
+ ):
375
+ raise InvalidParameterError(
376
+ "Bad parameter: remote_server_mount_id must be an int"
377
+ )
378
+ if "remote_server_id" in params and not isinstance(
379
+ params["remote_server_id"], int
380
+ ):
381
+ raise InvalidParameterError(
382
+ "Bad parameter: remote_server_id must be an int"
383
+ )
384
+ if "enabled" in params and not isinstance(params["enabled"], bool):
385
+ raise InvalidParameterError("Bad parameter: enabled must be an bool")
386
+ if "fall" in params and not isinstance(params["fall"], int):
387
+ raise InvalidParameterError("Bad parameter: fall must be an int")
388
+ if "health_check_enabled" in params and not isinstance(
389
+ params["health_check_enabled"], bool
390
+ ):
391
+ raise InvalidParameterError(
392
+ "Bad parameter: health_check_enabled must be an bool"
393
+ )
394
+ if "health_check_type" in params and not isinstance(
395
+ params["health_check_type"], str
396
+ ):
397
+ raise InvalidParameterError(
398
+ "Bad parameter: health_check_type must be an str"
399
+ )
400
+ if "interval" in params and not isinstance(params["interval"], int):
401
+ raise InvalidParameterError("Bad parameter: interval must be an int")
402
+ if "min_free_cpu" in params and not isinstance(
403
+ params["min_free_cpu"], float
404
+ ):
405
+ raise InvalidParameterError(
406
+ "Bad parameter: min_free_cpu must be an float"
407
+ )
408
+ if "min_free_mem" in params and not isinstance(
409
+ params["min_free_mem"], float
410
+ ):
411
+ raise InvalidParameterError(
412
+ "Bad parameter: min_free_mem must be an float"
413
+ )
414
+ if "priority" in params and not isinstance(params["priority"], int):
415
+ raise InvalidParameterError("Bad parameter: priority must be an int")
416
+ if "remote_path" in params and not isinstance(params["remote_path"], str):
417
+ raise InvalidParameterError(
418
+ "Bad parameter: remote_path must be an str"
419
+ )
420
+ if "rise" in params and not isinstance(params["rise"], int):
421
+ raise InvalidParameterError("Bad parameter: rise must be an int")
422
+ if "id" not in params:
423
+ raise MissingParameterError("Parameter missing: id")
424
+ if "canary_file_path" not in params:
425
+ raise MissingParameterError("Parameter missing: canary_file_path")
426
+ if "remote_server_mount_id" not in params:
427
+ raise MissingParameterError(
428
+ "Parameter missing: remote_server_mount_id"
429
+ )
430
+ if "remote_server_id" not in params:
431
+ raise MissingParameterError("Parameter missing: remote_server_id")
432
+ response, options = Api.send_request(
433
+ "PATCH",
434
+ "/remote_mount_backends/{id}".format(id=params["id"]),
435
+ params,
436
+ options,
437
+ )
438
+ return RemoteMountBackend(response.data, options)
439
+
440
+
441
+ def delete(id, params=None, options=None):
442
+ if not isinstance(params, dict):
443
+ params = {}
444
+ if not isinstance(options, dict):
445
+ options = {}
446
+ params["id"] = id
447
+ if "id" in params and not isinstance(params["id"], int):
448
+ raise InvalidParameterError("Bad parameter: id must be an int")
449
+ if "id" not in params:
450
+ raise MissingParameterError("Parameter missing: id")
451
+ Api.send_request(
452
+ "DELETE",
453
+ "/remote_mount_backends/{id}".format(id=params["id"]),
454
+ params,
455
+ options,
456
+ )
457
+
458
+
459
+ def destroy(id, params=None, options=None):
460
+ delete(id, params, options)
461
+
462
+
463
+ def new(*args, **kwargs):
464
+ return RemoteMountBackend(*args, **kwargs)