files-com 1.5.0__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.
- README.md +682 -0
- _VERSION +1 -0
- files_com-1.5.0.dist-info/METADATA +694 -0
- files_com-1.5.0.dist-info/RECORD +113 -0
- files_com-1.5.0.dist-info/WHEEL +5 -0
- files_com-1.5.0.dist-info/licenses/LICENSE +21 -0
- files_com-1.5.0.dist-info/top_level.txt +1 -0
- files_sdk/__init__.py +270 -0
- files_sdk/api.py +57 -0
- files_sdk/api_client.py +327 -0
- files_sdk/error.py +2891 -0
- files_sdk/list_obj.py +42 -0
- files_sdk/models/__init__.py +104 -0
- files_sdk/models/account_line_item.py +51 -0
- files_sdk/models/action.py +49 -0
- files_sdk/models/action_notification_export.py +147 -0
- files_sdk/models/action_notification_export_result.py +88 -0
- files_sdk/models/api_key.py +322 -0
- files_sdk/models/api_request_log.py +87 -0
- files_sdk/models/app.py +89 -0
- files_sdk/models/as2_incoming_message.py +123 -0
- files_sdk/models/as2_outgoing_message.py +119 -0
- files_sdk/models/as2_partner.py +374 -0
- files_sdk/models/as2_station.py +271 -0
- files_sdk/models/auto.py +36 -0
- files_sdk/models/automation.py +691 -0
- files_sdk/models/automation_log.py +77 -0
- files_sdk/models/automation_run.py +108 -0
- files_sdk/models/bandwidth_snapshot.py +91 -0
- files_sdk/models/behavior.py +334 -0
- files_sdk/models/bundle.py +550 -0
- files_sdk/models/bundle_action.py +86 -0
- files_sdk/models/bundle_download.py +94 -0
- files_sdk/models/bundle_notification.py +217 -0
- files_sdk/models/bundle_path.py +37 -0
- files_sdk/models/bundle_recipient.py +120 -0
- files_sdk/models/bundle_registration.py +79 -0
- files_sdk/models/clickwrap.py +268 -0
- files_sdk/models/dns_record.py +59 -0
- files_sdk/models/email_incoming_message.py +102 -0
- files_sdk/models/email_log.py +74 -0
- files_sdk/models/errors.py +37 -0
- files_sdk/models/exavault_api_request_log.py +85 -0
- files_sdk/models/external_event.py +148 -0
- files_sdk/models/file.py +791 -0
- files_sdk/models/file_action.py +39 -0
- files_sdk/models/file_comment.py +191 -0
- files_sdk/models/file_comment_reaction.py +125 -0
- files_sdk/models/file_migration.py +69 -0
- files_sdk/models/file_migration_log.py +78 -0
- files_sdk/models/file_upload_part.py +54 -0
- files_sdk/models/folder.py +154 -0
- files_sdk/models/form_field.py +43 -0
- files_sdk/models/form_field_set.py +240 -0
- files_sdk/models/ftp_action_log.py +87 -0
- files_sdk/models/gpg_key.py +254 -0
- files_sdk/models/group.py +276 -0
- files_sdk/models/group_user.py +231 -0
- files_sdk/models/history.py +236 -0
- files_sdk/models/history_export.py +238 -0
- files_sdk/models/history_export_result.py +98 -0
- files_sdk/models/image.py +37 -0
- files_sdk/models/inbox_recipient.py +118 -0
- files_sdk/models/inbox_registration.py +79 -0
- files_sdk/models/inbox_upload.py +80 -0
- files_sdk/models/invoice.py +91 -0
- files_sdk/models/invoice_line_item.py +46 -0
- files_sdk/models/ip_address.py +119 -0
- files_sdk/models/lock.py +158 -0
- files_sdk/models/message.py +244 -0
- files_sdk/models/message_comment.py +223 -0
- files_sdk/models/message_comment_reaction.py +181 -0
- files_sdk/models/message_reaction.py +170 -0
- files_sdk/models/notification.py +357 -0
- files_sdk/models/outbound_connection_log.py +88 -0
- files_sdk/models/payment.py +91 -0
- files_sdk/models/payment_line_item.py +42 -0
- files_sdk/models/permission.py +174 -0
- files_sdk/models/preview.py +40 -0
- files_sdk/models/priority.py +63 -0
- files_sdk/models/project.py +205 -0
- files_sdk/models/public_hosting_request_log.py +82 -0
- files_sdk/models/public_ip_address.py +42 -0
- files_sdk/models/public_key.py +212 -0
- files_sdk/models/remote_bandwidth_snapshot.py +91 -0
- files_sdk/models/remote_server.py +1677 -0
- files_sdk/models/remote_server_configuration_file.py +72 -0
- files_sdk/models/request.py +180 -0
- files_sdk/models/restore.py +104 -0
- files_sdk/models/session.py +100 -0
- files_sdk/models/settings_change.py +71 -0
- files_sdk/models/sftp_action_log.py +91 -0
- files_sdk/models/sftp_host_key.py +215 -0
- files_sdk/models/share_group.py +228 -0
- files_sdk/models/share_group_member.py +41 -0
- files_sdk/models/siem_http_destination.py +773 -0
- files_sdk/models/site.py +767 -0
- files_sdk/models/snapshot.py +255 -0
- files_sdk/models/sso_strategy.py +167 -0
- files_sdk/models/status.py +42 -0
- files_sdk/models/style.py +152 -0
- files_sdk/models/sync_log.py +75 -0
- files_sdk/models/usage_by_top_level_dir.py +41 -0
- files_sdk/models/usage_daily_snapshot.py +93 -0
- files_sdk/models/usage_snapshot.py +73 -0
- files_sdk/models/user.py +893 -0
- files_sdk/models/user_cipher_use.py +68 -0
- files_sdk/models/user_request.py +166 -0
- files_sdk/models/user_sftp_client_use.py +68 -0
- files_sdk/models/web_dav_action_log.py +87 -0
- files_sdk/models/webhook_test.py +104 -0
- files_sdk/path_util.py +42 -0
- files_sdk/util.py +34 -0
|
@@ -0,0 +1,1677 @@
|
|
|
1
|
+
import builtins # noqa: F401
|
|
2
|
+
from files_sdk.models.remote_server_configuration_file import (
|
|
3
|
+
RemoteServerConfigurationFile,
|
|
4
|
+
)
|
|
5
|
+
from files_sdk.api import Api # noqa: F401
|
|
6
|
+
from files_sdk.list_obj import ListObj
|
|
7
|
+
from files_sdk.error import ( # noqa: F401
|
|
8
|
+
InvalidParameterError,
|
|
9
|
+
MissingParameterError,
|
|
10
|
+
NotImplementedError,
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class RemoteServer:
|
|
15
|
+
default_attributes = {
|
|
16
|
+
"id": None, # int64 - Remote server ID
|
|
17
|
+
"disabled": None, # boolean - If true, this server has been disabled due to failures. Make any change or set disabled to false to clear this flag.
|
|
18
|
+
"authentication_method": None, # string - Type of authentication method
|
|
19
|
+
"hostname": None, # string - Hostname or IP address
|
|
20
|
+
"remote_home_path": None, # string - Initial home folder on remote server
|
|
21
|
+
"name": None, # string - Internal name for your reference
|
|
22
|
+
"port": None, # int64 - Port for remote server. Not needed for S3.
|
|
23
|
+
"max_connections": None, # int64 - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
|
|
24
|
+
"pin_to_site_region": None, # boolean - If true, we will ensure that all communications with this remote server are made through the primary region of the site. This setting can also be overridden by a site-wide setting which will force it to true.
|
|
25
|
+
"pinned_region": None, # string - If set, all communications with this remote server are made through the provided region.
|
|
26
|
+
"s3_bucket": None, # string - S3 bucket name
|
|
27
|
+
"s3_region": None, # string - S3 region
|
|
28
|
+
"aws_access_key": None, # string - AWS Access Key.
|
|
29
|
+
"server_certificate": None, # string - Remote server certificate
|
|
30
|
+
"server_host_key": None, # string - Remote server SSH Host Key. If provided, we will require that the server host key matches the provided key. Uses OpenSSH format similar to what would go into ~/.ssh/known_hosts
|
|
31
|
+
"server_type": None, # string - Remote server type.
|
|
32
|
+
"ssl": None, # string - Should we require SSL?
|
|
33
|
+
"username": None, # string - Remote server username. Not needed for S3 buckets.
|
|
34
|
+
"google_cloud_storage_bucket": None, # string - Google Cloud Storage bucket name
|
|
35
|
+
"google_cloud_storage_project_id": None, # string - Google Cloud Project ID
|
|
36
|
+
"backblaze_b2_s3_endpoint": None, # string - Backblaze B2 Cloud Storage S3 Endpoint
|
|
37
|
+
"backblaze_b2_bucket": None, # string - Backblaze B2 Cloud Storage Bucket name
|
|
38
|
+
"wasabi_bucket": None, # string - Wasabi Bucket name
|
|
39
|
+
"wasabi_region": None, # string - Wasabi region
|
|
40
|
+
"wasabi_access_key": None, # string - Wasabi access key.
|
|
41
|
+
"rackspace_username": None, # string - Rackspace username used to login to the Rackspace Cloud Control Panel.
|
|
42
|
+
"rackspace_region": None, # string - Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
|
|
43
|
+
"rackspace_container": None, # string - The name of the container (top level directory) where files will sync.
|
|
44
|
+
"auth_status": None, # string - Either `in_setup` or `complete`
|
|
45
|
+
"auth_account_name": None, # string - Describes the authorized account
|
|
46
|
+
"one_drive_account_type": None, # string - Either personal or business_other account types
|
|
47
|
+
"azure_blob_storage_account": None, # string - Azure Blob Storage Account name
|
|
48
|
+
"azure_blob_storage_container": None, # string - Azure Blob Storage Container name
|
|
49
|
+
"azure_blob_storage_hierarchical_namespace": None, # boolean - Enable when storage account has hierarchical namespace feature enabled
|
|
50
|
+
"azure_blob_storage_dns_suffix": None, # string - Custom DNS suffix
|
|
51
|
+
"azure_files_storage_account": None, # string - Azure File Storage Account name
|
|
52
|
+
"azure_files_storage_share_name": None, # string - Azure File Storage Share name
|
|
53
|
+
"azure_files_storage_dns_suffix": None, # string - Custom DNS suffix
|
|
54
|
+
"s3_compatible_bucket": None, # string - S3-compatible Bucket name
|
|
55
|
+
"s3_compatible_endpoint": None, # string - S3-compatible endpoint
|
|
56
|
+
"s3_compatible_region": None, # string - S3-compatible endpoint
|
|
57
|
+
"s3_compatible_access_key": None, # string - S3-compatible Access Key.
|
|
58
|
+
"enable_dedicated_ips": None, # boolean - `true` if remote server only accepts connections from dedicated IPs
|
|
59
|
+
"files_agent_permission_set": None, # string - Local permissions for files agent. read_only, write_only, or read_write
|
|
60
|
+
"files_agent_root": None, # string - Agent local root path
|
|
61
|
+
"files_agent_api_token": None, # string - Files Agent API Token
|
|
62
|
+
"files_agent_version": None, # string - Files Agent version
|
|
63
|
+
"filebase_bucket": None, # string - Filebase Bucket name
|
|
64
|
+
"filebase_access_key": None, # string - Filebase Access Key.
|
|
65
|
+
"cloudflare_bucket": None, # string - Cloudflare Bucket name
|
|
66
|
+
"cloudflare_access_key": None, # string - Cloudflare Access Key.
|
|
67
|
+
"cloudflare_endpoint": None, # string - Cloudflare endpoint
|
|
68
|
+
"dropbox_teams": None, # boolean - List Team folders in root
|
|
69
|
+
"linode_bucket": None, # string - Linode Bucket name
|
|
70
|
+
"linode_access_key": None, # string - Linode Access Key.
|
|
71
|
+
"linode_region": None, # string - Linode region
|
|
72
|
+
"supports_versioning": None, # boolean - If true, this remote server supports file versioning. This value is determined automatically by Files.com.
|
|
73
|
+
"aws_secret_key": None, # string - AWS secret key.
|
|
74
|
+
"password": None, # string - Password if needed.
|
|
75
|
+
"private_key": None, # string - Private key if needed.
|
|
76
|
+
"private_key_passphrase": None, # string - Passphrase for private key if needed.
|
|
77
|
+
"ssl_certificate": None, # string - SSL client certificate.
|
|
78
|
+
"google_cloud_storage_credentials_json": None, # string - A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
|
79
|
+
"wasabi_secret_key": None, # string - Wasabi secret key.
|
|
80
|
+
"backblaze_b2_key_id": None, # string - Backblaze B2 Cloud Storage keyID.
|
|
81
|
+
"backblaze_b2_application_key": None, # string - Backblaze B2 Cloud Storage applicationKey.
|
|
82
|
+
"rackspace_api_key": None, # string - Rackspace API key from the Rackspace Cloud Control Panel.
|
|
83
|
+
"reset_authentication": None, # boolean - Reset authenticated account
|
|
84
|
+
"azure_blob_storage_access_key": None, # string - Azure Blob Storage secret key.
|
|
85
|
+
"azure_files_storage_access_key": None, # string - Azure File Storage access key.
|
|
86
|
+
"azure_blob_storage_sas_token": None, # string - Shared Access Signature (SAS) token
|
|
87
|
+
"azure_files_storage_sas_token": None, # string - Shared Access Signature (SAS) token
|
|
88
|
+
"s3_compatible_secret_key": None, # string - S3-compatible secret key
|
|
89
|
+
"filebase_secret_key": None, # string - Filebase secret key
|
|
90
|
+
"cloudflare_secret_key": None, # string - Cloudflare secret key
|
|
91
|
+
"linode_secret_key": None, # string - Linode secret key
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
def __init__(self, attributes=None, options=None):
|
|
95
|
+
if not isinstance(attributes, dict):
|
|
96
|
+
attributes = {}
|
|
97
|
+
if not isinstance(options, dict):
|
|
98
|
+
options = {}
|
|
99
|
+
self.set_attributes(attributes)
|
|
100
|
+
self.options = options
|
|
101
|
+
|
|
102
|
+
def set_attributes(self, attributes):
|
|
103
|
+
for (
|
|
104
|
+
attribute,
|
|
105
|
+
default_value,
|
|
106
|
+
) in RemoteServer.default_attributes.items():
|
|
107
|
+
setattr(self, attribute, attributes.get(attribute, default_value))
|
|
108
|
+
|
|
109
|
+
def get_attributes(self):
|
|
110
|
+
return {
|
|
111
|
+
k: getattr(self, k, None)
|
|
112
|
+
for k in RemoteServer.default_attributes
|
|
113
|
+
if getattr(self, k, None) is not None
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
# Post local changes, check in, and download configuration file (used by some Remote Server integrations, such as the Files.com Agent)
|
|
117
|
+
#
|
|
118
|
+
# Parameters:
|
|
119
|
+
# api_token - string - Files Agent API Token
|
|
120
|
+
# permission_set - string - The permission set for the agent ['read_write', 'read_only', 'write_only']
|
|
121
|
+
# root - string - The root directory for the agent
|
|
122
|
+
# hostname - string
|
|
123
|
+
# port - int64 - Incoming port for files agent connections
|
|
124
|
+
# status - string - either running or shutdown
|
|
125
|
+
# config_version - string - agent config version
|
|
126
|
+
# private_key - string - The private key for the agent
|
|
127
|
+
# public_key - string - public key
|
|
128
|
+
# server_host_key - string
|
|
129
|
+
# subdomain - string - Files.com subdomain site name
|
|
130
|
+
def configuration_file(self, params=None):
|
|
131
|
+
if not isinstance(params, dict):
|
|
132
|
+
params = {}
|
|
133
|
+
|
|
134
|
+
if hasattr(self, "id") and self.id:
|
|
135
|
+
params["id"] = self.id
|
|
136
|
+
else:
|
|
137
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
138
|
+
if "id" not in params:
|
|
139
|
+
raise MissingParameterError("Parameter missing: id")
|
|
140
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
141
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
142
|
+
if "api_token" in params and not isinstance(params["api_token"], str):
|
|
143
|
+
raise InvalidParameterError(
|
|
144
|
+
"Bad parameter: api_token must be an str"
|
|
145
|
+
)
|
|
146
|
+
if "permission_set" in params and not isinstance(
|
|
147
|
+
params["permission_set"], str
|
|
148
|
+
):
|
|
149
|
+
raise InvalidParameterError(
|
|
150
|
+
"Bad parameter: permission_set must be an str"
|
|
151
|
+
)
|
|
152
|
+
if "root" in params and not isinstance(params["root"], str):
|
|
153
|
+
raise InvalidParameterError("Bad parameter: root must be an str")
|
|
154
|
+
if "hostname" in params and not isinstance(params["hostname"], str):
|
|
155
|
+
raise InvalidParameterError(
|
|
156
|
+
"Bad parameter: hostname must be an str"
|
|
157
|
+
)
|
|
158
|
+
if "port" in params and not isinstance(params["port"], int):
|
|
159
|
+
raise InvalidParameterError("Bad parameter: port must be an int")
|
|
160
|
+
if "status" in params and not isinstance(params["status"], str):
|
|
161
|
+
raise InvalidParameterError("Bad parameter: status must be an str")
|
|
162
|
+
if "config_version" in params and not isinstance(
|
|
163
|
+
params["config_version"], str
|
|
164
|
+
):
|
|
165
|
+
raise InvalidParameterError(
|
|
166
|
+
"Bad parameter: config_version must be an str"
|
|
167
|
+
)
|
|
168
|
+
if "private_key" in params and not isinstance(
|
|
169
|
+
params["private_key"], str
|
|
170
|
+
):
|
|
171
|
+
raise InvalidParameterError(
|
|
172
|
+
"Bad parameter: private_key must be an str"
|
|
173
|
+
)
|
|
174
|
+
if "public_key" in params and not isinstance(
|
|
175
|
+
params["public_key"], str
|
|
176
|
+
):
|
|
177
|
+
raise InvalidParameterError(
|
|
178
|
+
"Bad parameter: public_key must be an str"
|
|
179
|
+
)
|
|
180
|
+
if "server_host_key" in params and not isinstance(
|
|
181
|
+
params["server_host_key"], str
|
|
182
|
+
):
|
|
183
|
+
raise InvalidParameterError(
|
|
184
|
+
"Bad parameter: server_host_key must be an str"
|
|
185
|
+
)
|
|
186
|
+
if "subdomain" in params and not isinstance(params["subdomain"], str):
|
|
187
|
+
raise InvalidParameterError(
|
|
188
|
+
"Bad parameter: subdomain must be an str"
|
|
189
|
+
)
|
|
190
|
+
response, _options = Api.send_request(
|
|
191
|
+
"POST",
|
|
192
|
+
"/remote_servers/{id}/configuration_file".format(id=params["id"]),
|
|
193
|
+
params,
|
|
194
|
+
self.options,
|
|
195
|
+
)
|
|
196
|
+
return response.data
|
|
197
|
+
|
|
198
|
+
# Parameters:
|
|
199
|
+
# aws_access_key - string - AWS Access Key.
|
|
200
|
+
# aws_secret_key - string - AWS secret key.
|
|
201
|
+
# password - string - Password if needed.
|
|
202
|
+
# private_key - string - Private key if needed.
|
|
203
|
+
# private_key_passphrase - string - Passphrase for private key if needed.
|
|
204
|
+
# ssl_certificate - string - SSL client certificate.
|
|
205
|
+
# google_cloud_storage_credentials_json - string - A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
|
206
|
+
# wasabi_access_key - string - Wasabi access key.
|
|
207
|
+
# wasabi_secret_key - string - Wasabi secret key.
|
|
208
|
+
# backblaze_b2_key_id - string - Backblaze B2 Cloud Storage keyID.
|
|
209
|
+
# backblaze_b2_application_key - string - Backblaze B2 Cloud Storage applicationKey.
|
|
210
|
+
# rackspace_api_key - string - Rackspace API key from the Rackspace Cloud Control Panel.
|
|
211
|
+
# reset_authentication - boolean - Reset authenticated account
|
|
212
|
+
# azure_blob_storage_access_key - string - Azure Blob Storage secret key.
|
|
213
|
+
# azure_files_storage_access_key - string - Azure File Storage access key.
|
|
214
|
+
# hostname - string - Hostname or IP address
|
|
215
|
+
# name - string - Internal name for your reference
|
|
216
|
+
# max_connections - int64 - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
|
|
217
|
+
# pin_to_site_region - boolean - If true, we will ensure that all communications with this remote server are made through the primary region of the site. This setting can also be overridden by a site-wide setting which will force it to true.
|
|
218
|
+
# port - int64 - Port for remote server. Not needed for S3.
|
|
219
|
+
# s3_bucket - string - S3 bucket name
|
|
220
|
+
# s3_region - string - S3 region
|
|
221
|
+
# server_certificate - string - Remote server certificate
|
|
222
|
+
# server_host_key - string - Remote server SSH Host Key. If provided, we will require that the server host key matches the provided key. Uses OpenSSH format similar to what would go into ~/.ssh/known_hosts
|
|
223
|
+
# server_type - string - Remote server type.
|
|
224
|
+
# ssl - string - Should we require SSL?
|
|
225
|
+
# username - string - Remote server username. Not needed for S3 buckets.
|
|
226
|
+
# google_cloud_storage_bucket - string - Google Cloud Storage bucket name
|
|
227
|
+
# google_cloud_storage_project_id - string - Google Cloud Project ID
|
|
228
|
+
# backblaze_b2_bucket - string - Backblaze B2 Cloud Storage Bucket name
|
|
229
|
+
# backblaze_b2_s3_endpoint - string - Backblaze B2 Cloud Storage S3 Endpoint
|
|
230
|
+
# wasabi_bucket - string - Wasabi Bucket name
|
|
231
|
+
# wasabi_region - string - Wasabi region
|
|
232
|
+
# rackspace_username - string - Rackspace username used to login to the Rackspace Cloud Control Panel.
|
|
233
|
+
# rackspace_region - string - Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
|
|
234
|
+
# rackspace_container - string - The name of the container (top level directory) where files will sync.
|
|
235
|
+
# one_drive_account_type - string - Either personal or business_other account types
|
|
236
|
+
# azure_blob_storage_account - string - Azure Blob Storage Account name
|
|
237
|
+
# azure_blob_storage_container - string - Azure Blob Storage Container name
|
|
238
|
+
# azure_blob_storage_hierarchical_namespace - boolean - Enable when storage account has hierarchical namespace feature enabled
|
|
239
|
+
# azure_blob_storage_sas_token - string - Shared Access Signature (SAS) token
|
|
240
|
+
# azure_blob_storage_dns_suffix - string - Custom DNS suffix
|
|
241
|
+
# azure_files_storage_account - string - Azure File Storage Account name
|
|
242
|
+
# azure_files_storage_share_name - string - Azure File Storage Share name
|
|
243
|
+
# azure_files_storage_dns_suffix - string - Custom DNS suffix
|
|
244
|
+
# azure_files_storage_sas_token - string - Shared Access Signature (SAS) token
|
|
245
|
+
# s3_compatible_bucket - string - S3-compatible Bucket name
|
|
246
|
+
# s3_compatible_endpoint - string - S3-compatible endpoint
|
|
247
|
+
# s3_compatible_region - string - S3-compatible endpoint
|
|
248
|
+
# enable_dedicated_ips - boolean - `true` if remote server only accepts connections from dedicated IPs
|
|
249
|
+
# s3_compatible_access_key - string - S3-compatible Access Key.
|
|
250
|
+
# s3_compatible_secret_key - string - S3-compatible secret key
|
|
251
|
+
# files_agent_root - string - Agent local root path
|
|
252
|
+
# files_agent_permission_set - string - Local permissions for files agent. read_only, write_only, or read_write
|
|
253
|
+
# files_agent_version - string - Files Agent version
|
|
254
|
+
# filebase_access_key - string - Filebase Access Key.
|
|
255
|
+
# filebase_secret_key - string - Filebase secret key
|
|
256
|
+
# filebase_bucket - string - Filebase Bucket name
|
|
257
|
+
# cloudflare_access_key - string - Cloudflare Access Key.
|
|
258
|
+
# cloudflare_secret_key - string - Cloudflare secret key
|
|
259
|
+
# cloudflare_bucket - string - Cloudflare Bucket name
|
|
260
|
+
# cloudflare_endpoint - string - Cloudflare endpoint
|
|
261
|
+
# dropbox_teams - boolean - List Team folders in root
|
|
262
|
+
# linode_access_key - string - Linode Access Key.
|
|
263
|
+
# linode_secret_key - string - Linode secret key
|
|
264
|
+
# linode_bucket - string - Linode Bucket name
|
|
265
|
+
# linode_region - string - Linode region
|
|
266
|
+
def update(self, params=None):
|
|
267
|
+
if not isinstance(params, dict):
|
|
268
|
+
params = {}
|
|
269
|
+
|
|
270
|
+
if hasattr(self, "id") and self.id:
|
|
271
|
+
params["id"] = self.id
|
|
272
|
+
else:
|
|
273
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
274
|
+
if "id" not in params:
|
|
275
|
+
raise MissingParameterError("Parameter missing: id")
|
|
276
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
277
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
278
|
+
if "aws_access_key" in params and not isinstance(
|
|
279
|
+
params["aws_access_key"], str
|
|
280
|
+
):
|
|
281
|
+
raise InvalidParameterError(
|
|
282
|
+
"Bad parameter: aws_access_key must be an str"
|
|
283
|
+
)
|
|
284
|
+
if "aws_secret_key" in params and not isinstance(
|
|
285
|
+
params["aws_secret_key"], str
|
|
286
|
+
):
|
|
287
|
+
raise InvalidParameterError(
|
|
288
|
+
"Bad parameter: aws_secret_key must be an str"
|
|
289
|
+
)
|
|
290
|
+
if "password" in params and not isinstance(params["password"], str):
|
|
291
|
+
raise InvalidParameterError(
|
|
292
|
+
"Bad parameter: password must be an str"
|
|
293
|
+
)
|
|
294
|
+
if "private_key" in params and not isinstance(
|
|
295
|
+
params["private_key"], str
|
|
296
|
+
):
|
|
297
|
+
raise InvalidParameterError(
|
|
298
|
+
"Bad parameter: private_key must be an str"
|
|
299
|
+
)
|
|
300
|
+
if "private_key_passphrase" in params and not isinstance(
|
|
301
|
+
params["private_key_passphrase"], str
|
|
302
|
+
):
|
|
303
|
+
raise InvalidParameterError(
|
|
304
|
+
"Bad parameter: private_key_passphrase must be an str"
|
|
305
|
+
)
|
|
306
|
+
if "ssl_certificate" in params and not isinstance(
|
|
307
|
+
params["ssl_certificate"], str
|
|
308
|
+
):
|
|
309
|
+
raise InvalidParameterError(
|
|
310
|
+
"Bad parameter: ssl_certificate must be an str"
|
|
311
|
+
)
|
|
312
|
+
if (
|
|
313
|
+
"google_cloud_storage_credentials_json" in params
|
|
314
|
+
and not isinstance(
|
|
315
|
+
params["google_cloud_storage_credentials_json"], str
|
|
316
|
+
)
|
|
317
|
+
):
|
|
318
|
+
raise InvalidParameterError(
|
|
319
|
+
"Bad parameter: google_cloud_storage_credentials_json must be an str"
|
|
320
|
+
)
|
|
321
|
+
if "wasabi_access_key" in params and not isinstance(
|
|
322
|
+
params["wasabi_access_key"], str
|
|
323
|
+
):
|
|
324
|
+
raise InvalidParameterError(
|
|
325
|
+
"Bad parameter: wasabi_access_key must be an str"
|
|
326
|
+
)
|
|
327
|
+
if "wasabi_secret_key" in params and not isinstance(
|
|
328
|
+
params["wasabi_secret_key"], str
|
|
329
|
+
):
|
|
330
|
+
raise InvalidParameterError(
|
|
331
|
+
"Bad parameter: wasabi_secret_key must be an str"
|
|
332
|
+
)
|
|
333
|
+
if "backblaze_b2_key_id" in params and not isinstance(
|
|
334
|
+
params["backblaze_b2_key_id"], str
|
|
335
|
+
):
|
|
336
|
+
raise InvalidParameterError(
|
|
337
|
+
"Bad parameter: backblaze_b2_key_id must be an str"
|
|
338
|
+
)
|
|
339
|
+
if "backblaze_b2_application_key" in params and not isinstance(
|
|
340
|
+
params["backblaze_b2_application_key"], str
|
|
341
|
+
):
|
|
342
|
+
raise InvalidParameterError(
|
|
343
|
+
"Bad parameter: backblaze_b2_application_key must be an str"
|
|
344
|
+
)
|
|
345
|
+
if "rackspace_api_key" in params and not isinstance(
|
|
346
|
+
params["rackspace_api_key"], str
|
|
347
|
+
):
|
|
348
|
+
raise InvalidParameterError(
|
|
349
|
+
"Bad parameter: rackspace_api_key must be an str"
|
|
350
|
+
)
|
|
351
|
+
if "azure_blob_storage_access_key" in params and not isinstance(
|
|
352
|
+
params["azure_blob_storage_access_key"], str
|
|
353
|
+
):
|
|
354
|
+
raise InvalidParameterError(
|
|
355
|
+
"Bad parameter: azure_blob_storage_access_key must be an str"
|
|
356
|
+
)
|
|
357
|
+
if "azure_files_storage_access_key" in params and not isinstance(
|
|
358
|
+
params["azure_files_storage_access_key"], str
|
|
359
|
+
):
|
|
360
|
+
raise InvalidParameterError(
|
|
361
|
+
"Bad parameter: azure_files_storage_access_key must be an str"
|
|
362
|
+
)
|
|
363
|
+
if "hostname" in params and not isinstance(params["hostname"], str):
|
|
364
|
+
raise InvalidParameterError(
|
|
365
|
+
"Bad parameter: hostname must be an str"
|
|
366
|
+
)
|
|
367
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
368
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
369
|
+
if "max_connections" in params and not isinstance(
|
|
370
|
+
params["max_connections"], int
|
|
371
|
+
):
|
|
372
|
+
raise InvalidParameterError(
|
|
373
|
+
"Bad parameter: max_connections must be an int"
|
|
374
|
+
)
|
|
375
|
+
if "port" in params and not isinstance(params["port"], int):
|
|
376
|
+
raise InvalidParameterError("Bad parameter: port must be an int")
|
|
377
|
+
if "s3_bucket" in params and not isinstance(params["s3_bucket"], str):
|
|
378
|
+
raise InvalidParameterError(
|
|
379
|
+
"Bad parameter: s3_bucket must be an str"
|
|
380
|
+
)
|
|
381
|
+
if "s3_region" in params and not isinstance(params["s3_region"], str):
|
|
382
|
+
raise InvalidParameterError(
|
|
383
|
+
"Bad parameter: s3_region must be an str"
|
|
384
|
+
)
|
|
385
|
+
if "server_certificate" in params and not isinstance(
|
|
386
|
+
params["server_certificate"], str
|
|
387
|
+
):
|
|
388
|
+
raise InvalidParameterError(
|
|
389
|
+
"Bad parameter: server_certificate must be an str"
|
|
390
|
+
)
|
|
391
|
+
if "server_host_key" in params and not isinstance(
|
|
392
|
+
params["server_host_key"], str
|
|
393
|
+
):
|
|
394
|
+
raise InvalidParameterError(
|
|
395
|
+
"Bad parameter: server_host_key must be an str"
|
|
396
|
+
)
|
|
397
|
+
if "server_type" in params and not isinstance(
|
|
398
|
+
params["server_type"], str
|
|
399
|
+
):
|
|
400
|
+
raise InvalidParameterError(
|
|
401
|
+
"Bad parameter: server_type must be an str"
|
|
402
|
+
)
|
|
403
|
+
if "ssl" in params and not isinstance(params["ssl"], str):
|
|
404
|
+
raise InvalidParameterError("Bad parameter: ssl must be an str")
|
|
405
|
+
if "username" in params and not isinstance(params["username"], str):
|
|
406
|
+
raise InvalidParameterError(
|
|
407
|
+
"Bad parameter: username must be an str"
|
|
408
|
+
)
|
|
409
|
+
if "google_cloud_storage_bucket" in params and not isinstance(
|
|
410
|
+
params["google_cloud_storage_bucket"], str
|
|
411
|
+
):
|
|
412
|
+
raise InvalidParameterError(
|
|
413
|
+
"Bad parameter: google_cloud_storage_bucket must be an str"
|
|
414
|
+
)
|
|
415
|
+
if "google_cloud_storage_project_id" in params and not isinstance(
|
|
416
|
+
params["google_cloud_storage_project_id"], str
|
|
417
|
+
):
|
|
418
|
+
raise InvalidParameterError(
|
|
419
|
+
"Bad parameter: google_cloud_storage_project_id must be an str"
|
|
420
|
+
)
|
|
421
|
+
if "backblaze_b2_bucket" in params and not isinstance(
|
|
422
|
+
params["backblaze_b2_bucket"], str
|
|
423
|
+
):
|
|
424
|
+
raise InvalidParameterError(
|
|
425
|
+
"Bad parameter: backblaze_b2_bucket must be an str"
|
|
426
|
+
)
|
|
427
|
+
if "backblaze_b2_s3_endpoint" in params and not isinstance(
|
|
428
|
+
params["backblaze_b2_s3_endpoint"], str
|
|
429
|
+
):
|
|
430
|
+
raise InvalidParameterError(
|
|
431
|
+
"Bad parameter: backblaze_b2_s3_endpoint must be an str"
|
|
432
|
+
)
|
|
433
|
+
if "wasabi_bucket" in params and not isinstance(
|
|
434
|
+
params["wasabi_bucket"], str
|
|
435
|
+
):
|
|
436
|
+
raise InvalidParameterError(
|
|
437
|
+
"Bad parameter: wasabi_bucket must be an str"
|
|
438
|
+
)
|
|
439
|
+
if "wasabi_region" in params and not isinstance(
|
|
440
|
+
params["wasabi_region"], str
|
|
441
|
+
):
|
|
442
|
+
raise InvalidParameterError(
|
|
443
|
+
"Bad parameter: wasabi_region must be an str"
|
|
444
|
+
)
|
|
445
|
+
if "rackspace_username" in params and not isinstance(
|
|
446
|
+
params["rackspace_username"], str
|
|
447
|
+
):
|
|
448
|
+
raise InvalidParameterError(
|
|
449
|
+
"Bad parameter: rackspace_username must be an str"
|
|
450
|
+
)
|
|
451
|
+
if "rackspace_region" in params and not isinstance(
|
|
452
|
+
params["rackspace_region"], str
|
|
453
|
+
):
|
|
454
|
+
raise InvalidParameterError(
|
|
455
|
+
"Bad parameter: rackspace_region must be an str"
|
|
456
|
+
)
|
|
457
|
+
if "rackspace_container" in params and not isinstance(
|
|
458
|
+
params["rackspace_container"], str
|
|
459
|
+
):
|
|
460
|
+
raise InvalidParameterError(
|
|
461
|
+
"Bad parameter: rackspace_container must be an str"
|
|
462
|
+
)
|
|
463
|
+
if "one_drive_account_type" in params and not isinstance(
|
|
464
|
+
params["one_drive_account_type"], str
|
|
465
|
+
):
|
|
466
|
+
raise InvalidParameterError(
|
|
467
|
+
"Bad parameter: one_drive_account_type must be an str"
|
|
468
|
+
)
|
|
469
|
+
if "azure_blob_storage_account" in params and not isinstance(
|
|
470
|
+
params["azure_blob_storage_account"], str
|
|
471
|
+
):
|
|
472
|
+
raise InvalidParameterError(
|
|
473
|
+
"Bad parameter: azure_blob_storage_account must be an str"
|
|
474
|
+
)
|
|
475
|
+
if "azure_blob_storage_container" in params and not isinstance(
|
|
476
|
+
params["azure_blob_storage_container"], str
|
|
477
|
+
):
|
|
478
|
+
raise InvalidParameterError(
|
|
479
|
+
"Bad parameter: azure_blob_storage_container must be an str"
|
|
480
|
+
)
|
|
481
|
+
if "azure_blob_storage_sas_token" in params and not isinstance(
|
|
482
|
+
params["azure_blob_storage_sas_token"], str
|
|
483
|
+
):
|
|
484
|
+
raise InvalidParameterError(
|
|
485
|
+
"Bad parameter: azure_blob_storage_sas_token must be an str"
|
|
486
|
+
)
|
|
487
|
+
if "azure_blob_storage_dns_suffix" in params and not isinstance(
|
|
488
|
+
params["azure_blob_storage_dns_suffix"], str
|
|
489
|
+
):
|
|
490
|
+
raise InvalidParameterError(
|
|
491
|
+
"Bad parameter: azure_blob_storage_dns_suffix must be an str"
|
|
492
|
+
)
|
|
493
|
+
if "azure_files_storage_account" in params and not isinstance(
|
|
494
|
+
params["azure_files_storage_account"], str
|
|
495
|
+
):
|
|
496
|
+
raise InvalidParameterError(
|
|
497
|
+
"Bad parameter: azure_files_storage_account must be an str"
|
|
498
|
+
)
|
|
499
|
+
if "azure_files_storage_share_name" in params and not isinstance(
|
|
500
|
+
params["azure_files_storage_share_name"], str
|
|
501
|
+
):
|
|
502
|
+
raise InvalidParameterError(
|
|
503
|
+
"Bad parameter: azure_files_storage_share_name must be an str"
|
|
504
|
+
)
|
|
505
|
+
if "azure_files_storage_dns_suffix" in params and not isinstance(
|
|
506
|
+
params["azure_files_storage_dns_suffix"], str
|
|
507
|
+
):
|
|
508
|
+
raise InvalidParameterError(
|
|
509
|
+
"Bad parameter: azure_files_storage_dns_suffix must be an str"
|
|
510
|
+
)
|
|
511
|
+
if "azure_files_storage_sas_token" in params and not isinstance(
|
|
512
|
+
params["azure_files_storage_sas_token"], str
|
|
513
|
+
):
|
|
514
|
+
raise InvalidParameterError(
|
|
515
|
+
"Bad parameter: azure_files_storage_sas_token must be an str"
|
|
516
|
+
)
|
|
517
|
+
if "s3_compatible_bucket" in params and not isinstance(
|
|
518
|
+
params["s3_compatible_bucket"], str
|
|
519
|
+
):
|
|
520
|
+
raise InvalidParameterError(
|
|
521
|
+
"Bad parameter: s3_compatible_bucket must be an str"
|
|
522
|
+
)
|
|
523
|
+
if "s3_compatible_endpoint" in params and not isinstance(
|
|
524
|
+
params["s3_compatible_endpoint"], str
|
|
525
|
+
):
|
|
526
|
+
raise InvalidParameterError(
|
|
527
|
+
"Bad parameter: s3_compatible_endpoint must be an str"
|
|
528
|
+
)
|
|
529
|
+
if "s3_compatible_region" in params and not isinstance(
|
|
530
|
+
params["s3_compatible_region"], str
|
|
531
|
+
):
|
|
532
|
+
raise InvalidParameterError(
|
|
533
|
+
"Bad parameter: s3_compatible_region must be an str"
|
|
534
|
+
)
|
|
535
|
+
if "s3_compatible_access_key" in params and not isinstance(
|
|
536
|
+
params["s3_compatible_access_key"], str
|
|
537
|
+
):
|
|
538
|
+
raise InvalidParameterError(
|
|
539
|
+
"Bad parameter: s3_compatible_access_key must be an str"
|
|
540
|
+
)
|
|
541
|
+
if "s3_compatible_secret_key" in params and not isinstance(
|
|
542
|
+
params["s3_compatible_secret_key"], str
|
|
543
|
+
):
|
|
544
|
+
raise InvalidParameterError(
|
|
545
|
+
"Bad parameter: s3_compatible_secret_key must be an str"
|
|
546
|
+
)
|
|
547
|
+
if "files_agent_root" in params and not isinstance(
|
|
548
|
+
params["files_agent_root"], str
|
|
549
|
+
):
|
|
550
|
+
raise InvalidParameterError(
|
|
551
|
+
"Bad parameter: files_agent_root must be an str"
|
|
552
|
+
)
|
|
553
|
+
if "files_agent_permission_set" in params and not isinstance(
|
|
554
|
+
params["files_agent_permission_set"], str
|
|
555
|
+
):
|
|
556
|
+
raise InvalidParameterError(
|
|
557
|
+
"Bad parameter: files_agent_permission_set must be an str"
|
|
558
|
+
)
|
|
559
|
+
if "files_agent_version" in params and not isinstance(
|
|
560
|
+
params["files_agent_version"], str
|
|
561
|
+
):
|
|
562
|
+
raise InvalidParameterError(
|
|
563
|
+
"Bad parameter: files_agent_version must be an str"
|
|
564
|
+
)
|
|
565
|
+
if "filebase_access_key" in params and not isinstance(
|
|
566
|
+
params["filebase_access_key"], str
|
|
567
|
+
):
|
|
568
|
+
raise InvalidParameterError(
|
|
569
|
+
"Bad parameter: filebase_access_key must be an str"
|
|
570
|
+
)
|
|
571
|
+
if "filebase_secret_key" in params and not isinstance(
|
|
572
|
+
params["filebase_secret_key"], str
|
|
573
|
+
):
|
|
574
|
+
raise InvalidParameterError(
|
|
575
|
+
"Bad parameter: filebase_secret_key must be an str"
|
|
576
|
+
)
|
|
577
|
+
if "filebase_bucket" in params and not isinstance(
|
|
578
|
+
params["filebase_bucket"], str
|
|
579
|
+
):
|
|
580
|
+
raise InvalidParameterError(
|
|
581
|
+
"Bad parameter: filebase_bucket must be an str"
|
|
582
|
+
)
|
|
583
|
+
if "cloudflare_access_key" in params and not isinstance(
|
|
584
|
+
params["cloudflare_access_key"], str
|
|
585
|
+
):
|
|
586
|
+
raise InvalidParameterError(
|
|
587
|
+
"Bad parameter: cloudflare_access_key must be an str"
|
|
588
|
+
)
|
|
589
|
+
if "cloudflare_secret_key" in params and not isinstance(
|
|
590
|
+
params["cloudflare_secret_key"], str
|
|
591
|
+
):
|
|
592
|
+
raise InvalidParameterError(
|
|
593
|
+
"Bad parameter: cloudflare_secret_key must be an str"
|
|
594
|
+
)
|
|
595
|
+
if "cloudflare_bucket" in params and not isinstance(
|
|
596
|
+
params["cloudflare_bucket"], str
|
|
597
|
+
):
|
|
598
|
+
raise InvalidParameterError(
|
|
599
|
+
"Bad parameter: cloudflare_bucket must be an str"
|
|
600
|
+
)
|
|
601
|
+
if "cloudflare_endpoint" in params and not isinstance(
|
|
602
|
+
params["cloudflare_endpoint"], str
|
|
603
|
+
):
|
|
604
|
+
raise InvalidParameterError(
|
|
605
|
+
"Bad parameter: cloudflare_endpoint must be an str"
|
|
606
|
+
)
|
|
607
|
+
if "linode_access_key" in params and not isinstance(
|
|
608
|
+
params["linode_access_key"], str
|
|
609
|
+
):
|
|
610
|
+
raise InvalidParameterError(
|
|
611
|
+
"Bad parameter: linode_access_key must be an str"
|
|
612
|
+
)
|
|
613
|
+
if "linode_secret_key" in params and not isinstance(
|
|
614
|
+
params["linode_secret_key"], str
|
|
615
|
+
):
|
|
616
|
+
raise InvalidParameterError(
|
|
617
|
+
"Bad parameter: linode_secret_key must be an str"
|
|
618
|
+
)
|
|
619
|
+
if "linode_bucket" in params and not isinstance(
|
|
620
|
+
params["linode_bucket"], str
|
|
621
|
+
):
|
|
622
|
+
raise InvalidParameterError(
|
|
623
|
+
"Bad parameter: linode_bucket must be an str"
|
|
624
|
+
)
|
|
625
|
+
if "linode_region" in params and not isinstance(
|
|
626
|
+
params["linode_region"], str
|
|
627
|
+
):
|
|
628
|
+
raise InvalidParameterError(
|
|
629
|
+
"Bad parameter: linode_region must be an str"
|
|
630
|
+
)
|
|
631
|
+
response, _options = Api.send_request(
|
|
632
|
+
"PATCH",
|
|
633
|
+
"/remote_servers/{id}".format(id=params["id"]),
|
|
634
|
+
params,
|
|
635
|
+
self.options,
|
|
636
|
+
)
|
|
637
|
+
return response.data
|
|
638
|
+
|
|
639
|
+
def delete(self, params=None):
|
|
640
|
+
if not isinstance(params, dict):
|
|
641
|
+
params = {}
|
|
642
|
+
|
|
643
|
+
if hasattr(self, "id") and self.id:
|
|
644
|
+
params["id"] = self.id
|
|
645
|
+
else:
|
|
646
|
+
raise MissingParameterError("Current object doesn't have a id")
|
|
647
|
+
if "id" not in params:
|
|
648
|
+
raise MissingParameterError("Parameter missing: id")
|
|
649
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
650
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
651
|
+
Api.send_request(
|
|
652
|
+
"DELETE",
|
|
653
|
+
"/remote_servers/{id}".format(id=params["id"]),
|
|
654
|
+
params,
|
|
655
|
+
self.options,
|
|
656
|
+
)
|
|
657
|
+
|
|
658
|
+
def destroy(self, params=None):
|
|
659
|
+
self.delete(params)
|
|
660
|
+
|
|
661
|
+
def save(self):
|
|
662
|
+
if hasattr(self, "id") and self.id:
|
|
663
|
+
new_obj = self.update(self.get_attributes())
|
|
664
|
+
self.set_attributes(new_obj.get_attributes())
|
|
665
|
+
return True
|
|
666
|
+
else:
|
|
667
|
+
new_obj = create(self.get_attributes(), self.options)
|
|
668
|
+
self.set_attributes(new_obj.get_attributes())
|
|
669
|
+
return True
|
|
670
|
+
|
|
671
|
+
|
|
672
|
+
# Parameters:
|
|
673
|
+
# 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.
|
|
674
|
+
# per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
675
|
+
# sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `name`, `server_type`, `backblaze_b2_bucket`, `google_cloud_storage_bucket`, `wasabi_bucket`, `s3_bucket`, `rackspace_container`, `azure_blob_storage_container`, `azure_files_storage_share_name`, `s3_compatible_bucket`, `filebase_bucket`, `cloudflare_bucket` or `linode_bucket`.
|
|
676
|
+
# filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `name`, `server_type`, `backblaze_b2_bucket`, `google_cloud_storage_bucket`, `wasabi_bucket`, `s3_bucket`, `rackspace_container`, `azure_blob_storage_container`, `azure_files_storage_share_name`, `s3_compatible_bucket`, `filebase_bucket`, `cloudflare_bucket` or `linode_bucket`. Valid field combinations are `[ server_type, name ]`, `[ backblaze_b2_bucket, name ]`, `[ google_cloud_storage_bucket, name ]`, `[ wasabi_bucket, name ]`, `[ s3_bucket, name ]`, `[ rackspace_container, name ]`, `[ azure_blob_storage_container, name ]`, `[ azure_files_storage_share_name, name ]`, `[ s3_compatible_bucket, name ]`, `[ filebase_bucket, name ]`, `[ cloudflare_bucket, name ]` or `[ linode_bucket, name ]`.
|
|
677
|
+
# filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `name`, `backblaze_b2_bucket`, `google_cloud_storage_bucket`, `wasabi_bucket`, `s3_bucket`, `rackspace_container`, `azure_blob_storage_container`, `azure_files_storage_share_name`, `s3_compatible_bucket`, `filebase_bucket`, `cloudflare_bucket` or `linode_bucket`. Valid field combinations are `[ backblaze_b2_bucket, name ]`, `[ google_cloud_storage_bucket, name ]`, `[ wasabi_bucket, name ]`, `[ s3_bucket, name ]`, `[ rackspace_container, name ]`, `[ azure_blob_storage_container, name ]`, `[ azure_files_storage_share_name, name ]`, `[ s3_compatible_bucket, name ]`, `[ filebase_bucket, name ]`, `[ cloudflare_bucket, name ]` or `[ linode_bucket, name ]`.
|
|
678
|
+
def list(params=None, options=None):
|
|
679
|
+
if not isinstance(params, dict):
|
|
680
|
+
params = {}
|
|
681
|
+
if not isinstance(options, dict):
|
|
682
|
+
options = {}
|
|
683
|
+
if "cursor" in params and not isinstance(params["cursor"], str):
|
|
684
|
+
raise InvalidParameterError("Bad parameter: cursor must be an str")
|
|
685
|
+
if "per_page" in params and not isinstance(params["per_page"], int):
|
|
686
|
+
raise InvalidParameterError("Bad parameter: per_page must be an int")
|
|
687
|
+
if "sort_by" in params and not isinstance(params["sort_by"], dict):
|
|
688
|
+
raise InvalidParameterError("Bad parameter: sort_by must be an dict")
|
|
689
|
+
if "filter" in params and not isinstance(params["filter"], dict):
|
|
690
|
+
raise InvalidParameterError("Bad parameter: filter must be an dict")
|
|
691
|
+
if "filter_prefix" in params and not isinstance(
|
|
692
|
+
params["filter_prefix"], dict
|
|
693
|
+
):
|
|
694
|
+
raise InvalidParameterError(
|
|
695
|
+
"Bad parameter: filter_prefix must be an dict"
|
|
696
|
+
)
|
|
697
|
+
return ListObj(RemoteServer, "GET", "/remote_servers", params, options)
|
|
698
|
+
|
|
699
|
+
|
|
700
|
+
def all(params=None, options=None):
|
|
701
|
+
list(params, options)
|
|
702
|
+
|
|
703
|
+
|
|
704
|
+
# Parameters:
|
|
705
|
+
# id (required) - int64 - Remote Server ID.
|
|
706
|
+
def find(id, params=None, options=None):
|
|
707
|
+
if not isinstance(params, dict):
|
|
708
|
+
params = {}
|
|
709
|
+
if not isinstance(options, dict):
|
|
710
|
+
options = {}
|
|
711
|
+
params["id"] = id
|
|
712
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
713
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
714
|
+
if "id" not in params:
|
|
715
|
+
raise MissingParameterError("Parameter missing: id")
|
|
716
|
+
response, options = Api.send_request(
|
|
717
|
+
"GET", "/remote_servers/{id}".format(id=params["id"]), params, options
|
|
718
|
+
)
|
|
719
|
+
return RemoteServer(response.data, options)
|
|
720
|
+
|
|
721
|
+
|
|
722
|
+
def get(id, params=None, options=None):
|
|
723
|
+
find(id, params, options)
|
|
724
|
+
|
|
725
|
+
|
|
726
|
+
# Parameters:
|
|
727
|
+
# id (required) - int64 - Remote Server ID.
|
|
728
|
+
def find_configuration_file(id, params=None, options=None):
|
|
729
|
+
if not isinstance(params, dict):
|
|
730
|
+
params = {}
|
|
731
|
+
if not isinstance(options, dict):
|
|
732
|
+
options = {}
|
|
733
|
+
params["id"] = id
|
|
734
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
735
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
736
|
+
if "id" not in params:
|
|
737
|
+
raise MissingParameterError("Parameter missing: id")
|
|
738
|
+
response, options = Api.send_request(
|
|
739
|
+
"GET",
|
|
740
|
+
"/remote_servers/{id}/configuration_file".format(id=params["id"]),
|
|
741
|
+
params,
|
|
742
|
+
options,
|
|
743
|
+
)
|
|
744
|
+
return RemoteServerConfigurationFile(response.data, options)
|
|
745
|
+
|
|
746
|
+
|
|
747
|
+
# Parameters:
|
|
748
|
+
# aws_access_key - string - AWS Access Key.
|
|
749
|
+
# aws_secret_key - string - AWS secret key.
|
|
750
|
+
# password - string - Password if needed.
|
|
751
|
+
# private_key - string - Private key if needed.
|
|
752
|
+
# private_key_passphrase - string - Passphrase for private key if needed.
|
|
753
|
+
# ssl_certificate - string - SSL client certificate.
|
|
754
|
+
# google_cloud_storage_credentials_json - string - A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
|
755
|
+
# wasabi_access_key - string - Wasabi access key.
|
|
756
|
+
# wasabi_secret_key - string - Wasabi secret key.
|
|
757
|
+
# backblaze_b2_key_id - string - Backblaze B2 Cloud Storage keyID.
|
|
758
|
+
# backblaze_b2_application_key - string - Backblaze B2 Cloud Storage applicationKey.
|
|
759
|
+
# rackspace_api_key - string - Rackspace API key from the Rackspace Cloud Control Panel.
|
|
760
|
+
# reset_authentication - boolean - Reset authenticated account
|
|
761
|
+
# azure_blob_storage_access_key - string - Azure Blob Storage secret key.
|
|
762
|
+
# azure_files_storage_access_key - string - Azure File Storage access key.
|
|
763
|
+
# hostname - string - Hostname or IP address
|
|
764
|
+
# name - string - Internal name for your reference
|
|
765
|
+
# max_connections - int64 - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
|
|
766
|
+
# pin_to_site_region - boolean - If true, we will ensure that all communications with this remote server are made through the primary region of the site. This setting can also be overridden by a site-wide setting which will force it to true.
|
|
767
|
+
# port - int64 - Port for remote server. Not needed for S3.
|
|
768
|
+
# s3_bucket - string - S3 bucket name
|
|
769
|
+
# s3_region - string - S3 region
|
|
770
|
+
# server_certificate - string - Remote server certificate
|
|
771
|
+
# server_host_key - string - Remote server SSH Host Key. If provided, we will require that the server host key matches the provided key. Uses OpenSSH format similar to what would go into ~/.ssh/known_hosts
|
|
772
|
+
# server_type - string - Remote server type.
|
|
773
|
+
# ssl - string - Should we require SSL?
|
|
774
|
+
# username - string - Remote server username. Not needed for S3 buckets.
|
|
775
|
+
# google_cloud_storage_bucket - string - Google Cloud Storage bucket name
|
|
776
|
+
# google_cloud_storage_project_id - string - Google Cloud Project ID
|
|
777
|
+
# backblaze_b2_bucket - string - Backblaze B2 Cloud Storage Bucket name
|
|
778
|
+
# backblaze_b2_s3_endpoint - string - Backblaze B2 Cloud Storage S3 Endpoint
|
|
779
|
+
# wasabi_bucket - string - Wasabi Bucket name
|
|
780
|
+
# wasabi_region - string - Wasabi region
|
|
781
|
+
# rackspace_username - string - Rackspace username used to login to the Rackspace Cloud Control Panel.
|
|
782
|
+
# rackspace_region - string - Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
|
|
783
|
+
# rackspace_container - string - The name of the container (top level directory) where files will sync.
|
|
784
|
+
# one_drive_account_type - string - Either personal or business_other account types
|
|
785
|
+
# azure_blob_storage_account - string - Azure Blob Storage Account name
|
|
786
|
+
# azure_blob_storage_container - string - Azure Blob Storage Container name
|
|
787
|
+
# azure_blob_storage_hierarchical_namespace - boolean - Enable when storage account has hierarchical namespace feature enabled
|
|
788
|
+
# azure_blob_storage_sas_token - string - Shared Access Signature (SAS) token
|
|
789
|
+
# azure_blob_storage_dns_suffix - string - Custom DNS suffix
|
|
790
|
+
# azure_files_storage_account - string - Azure File Storage Account name
|
|
791
|
+
# azure_files_storage_share_name - string - Azure File Storage Share name
|
|
792
|
+
# azure_files_storage_dns_suffix - string - Custom DNS suffix
|
|
793
|
+
# azure_files_storage_sas_token - string - Shared Access Signature (SAS) token
|
|
794
|
+
# s3_compatible_bucket - string - S3-compatible Bucket name
|
|
795
|
+
# s3_compatible_endpoint - string - S3-compatible endpoint
|
|
796
|
+
# s3_compatible_region - string - S3-compatible endpoint
|
|
797
|
+
# enable_dedicated_ips - boolean - `true` if remote server only accepts connections from dedicated IPs
|
|
798
|
+
# s3_compatible_access_key - string - S3-compatible Access Key.
|
|
799
|
+
# s3_compatible_secret_key - string - S3-compatible secret key
|
|
800
|
+
# files_agent_root - string - Agent local root path
|
|
801
|
+
# files_agent_permission_set - string - Local permissions for files agent. read_only, write_only, or read_write
|
|
802
|
+
# files_agent_version - string - Files Agent version
|
|
803
|
+
# filebase_access_key - string - Filebase Access Key.
|
|
804
|
+
# filebase_secret_key - string - Filebase secret key
|
|
805
|
+
# filebase_bucket - string - Filebase Bucket name
|
|
806
|
+
# cloudflare_access_key - string - Cloudflare Access Key.
|
|
807
|
+
# cloudflare_secret_key - string - Cloudflare secret key
|
|
808
|
+
# cloudflare_bucket - string - Cloudflare Bucket name
|
|
809
|
+
# cloudflare_endpoint - string - Cloudflare endpoint
|
|
810
|
+
# dropbox_teams - boolean - List Team folders in root
|
|
811
|
+
# linode_access_key - string - Linode Access Key.
|
|
812
|
+
# linode_secret_key - string - Linode secret key
|
|
813
|
+
# linode_bucket - string - Linode Bucket name
|
|
814
|
+
# linode_region - string - Linode region
|
|
815
|
+
def create(params=None, options=None):
|
|
816
|
+
if not isinstance(params, dict):
|
|
817
|
+
params = {}
|
|
818
|
+
if not isinstance(options, dict):
|
|
819
|
+
options = {}
|
|
820
|
+
if "aws_access_key" in params and not isinstance(
|
|
821
|
+
params["aws_access_key"], str
|
|
822
|
+
):
|
|
823
|
+
raise InvalidParameterError(
|
|
824
|
+
"Bad parameter: aws_access_key must be an str"
|
|
825
|
+
)
|
|
826
|
+
if "aws_secret_key" in params and not isinstance(
|
|
827
|
+
params["aws_secret_key"], str
|
|
828
|
+
):
|
|
829
|
+
raise InvalidParameterError(
|
|
830
|
+
"Bad parameter: aws_secret_key must be an str"
|
|
831
|
+
)
|
|
832
|
+
if "password" in params and not isinstance(params["password"], str):
|
|
833
|
+
raise InvalidParameterError("Bad parameter: password must be an str")
|
|
834
|
+
if "private_key" in params and not isinstance(params["private_key"], str):
|
|
835
|
+
raise InvalidParameterError(
|
|
836
|
+
"Bad parameter: private_key must be an str"
|
|
837
|
+
)
|
|
838
|
+
if "private_key_passphrase" in params and not isinstance(
|
|
839
|
+
params["private_key_passphrase"], str
|
|
840
|
+
):
|
|
841
|
+
raise InvalidParameterError(
|
|
842
|
+
"Bad parameter: private_key_passphrase must be an str"
|
|
843
|
+
)
|
|
844
|
+
if "ssl_certificate" in params and not isinstance(
|
|
845
|
+
params["ssl_certificate"], str
|
|
846
|
+
):
|
|
847
|
+
raise InvalidParameterError(
|
|
848
|
+
"Bad parameter: ssl_certificate must be an str"
|
|
849
|
+
)
|
|
850
|
+
if "google_cloud_storage_credentials_json" in params and not isinstance(
|
|
851
|
+
params["google_cloud_storage_credentials_json"], str
|
|
852
|
+
):
|
|
853
|
+
raise InvalidParameterError(
|
|
854
|
+
"Bad parameter: google_cloud_storage_credentials_json must be an str"
|
|
855
|
+
)
|
|
856
|
+
if "wasabi_access_key" in params and not isinstance(
|
|
857
|
+
params["wasabi_access_key"], str
|
|
858
|
+
):
|
|
859
|
+
raise InvalidParameterError(
|
|
860
|
+
"Bad parameter: wasabi_access_key must be an str"
|
|
861
|
+
)
|
|
862
|
+
if "wasabi_secret_key" in params and not isinstance(
|
|
863
|
+
params["wasabi_secret_key"], str
|
|
864
|
+
):
|
|
865
|
+
raise InvalidParameterError(
|
|
866
|
+
"Bad parameter: wasabi_secret_key must be an str"
|
|
867
|
+
)
|
|
868
|
+
if "backblaze_b2_key_id" in params and not isinstance(
|
|
869
|
+
params["backblaze_b2_key_id"], str
|
|
870
|
+
):
|
|
871
|
+
raise InvalidParameterError(
|
|
872
|
+
"Bad parameter: backblaze_b2_key_id must be an str"
|
|
873
|
+
)
|
|
874
|
+
if "backblaze_b2_application_key" in params and not isinstance(
|
|
875
|
+
params["backblaze_b2_application_key"], str
|
|
876
|
+
):
|
|
877
|
+
raise InvalidParameterError(
|
|
878
|
+
"Bad parameter: backblaze_b2_application_key must be an str"
|
|
879
|
+
)
|
|
880
|
+
if "rackspace_api_key" in params and not isinstance(
|
|
881
|
+
params["rackspace_api_key"], str
|
|
882
|
+
):
|
|
883
|
+
raise InvalidParameterError(
|
|
884
|
+
"Bad parameter: rackspace_api_key must be an str"
|
|
885
|
+
)
|
|
886
|
+
if "azure_blob_storage_access_key" in params and not isinstance(
|
|
887
|
+
params["azure_blob_storage_access_key"], str
|
|
888
|
+
):
|
|
889
|
+
raise InvalidParameterError(
|
|
890
|
+
"Bad parameter: azure_blob_storage_access_key must be an str"
|
|
891
|
+
)
|
|
892
|
+
if "azure_files_storage_access_key" in params and not isinstance(
|
|
893
|
+
params["azure_files_storage_access_key"], str
|
|
894
|
+
):
|
|
895
|
+
raise InvalidParameterError(
|
|
896
|
+
"Bad parameter: azure_files_storage_access_key must be an str"
|
|
897
|
+
)
|
|
898
|
+
if "hostname" in params and not isinstance(params["hostname"], str):
|
|
899
|
+
raise InvalidParameterError("Bad parameter: hostname must be an str")
|
|
900
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
901
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
902
|
+
if "max_connections" in params and not isinstance(
|
|
903
|
+
params["max_connections"], int
|
|
904
|
+
):
|
|
905
|
+
raise InvalidParameterError(
|
|
906
|
+
"Bad parameter: max_connections must be an int"
|
|
907
|
+
)
|
|
908
|
+
if "port" in params and not isinstance(params["port"], int):
|
|
909
|
+
raise InvalidParameterError("Bad parameter: port must be an int")
|
|
910
|
+
if "s3_bucket" in params and not isinstance(params["s3_bucket"], str):
|
|
911
|
+
raise InvalidParameterError("Bad parameter: s3_bucket must be an str")
|
|
912
|
+
if "s3_region" in params and not isinstance(params["s3_region"], str):
|
|
913
|
+
raise InvalidParameterError("Bad parameter: s3_region must be an str")
|
|
914
|
+
if "server_certificate" in params and not isinstance(
|
|
915
|
+
params["server_certificate"], str
|
|
916
|
+
):
|
|
917
|
+
raise InvalidParameterError(
|
|
918
|
+
"Bad parameter: server_certificate must be an str"
|
|
919
|
+
)
|
|
920
|
+
if "server_host_key" in params and not isinstance(
|
|
921
|
+
params["server_host_key"], str
|
|
922
|
+
):
|
|
923
|
+
raise InvalidParameterError(
|
|
924
|
+
"Bad parameter: server_host_key must be an str"
|
|
925
|
+
)
|
|
926
|
+
if "server_type" in params and not isinstance(params["server_type"], str):
|
|
927
|
+
raise InvalidParameterError(
|
|
928
|
+
"Bad parameter: server_type must be an str"
|
|
929
|
+
)
|
|
930
|
+
if "ssl" in params and not isinstance(params["ssl"], str):
|
|
931
|
+
raise InvalidParameterError("Bad parameter: ssl must be an str")
|
|
932
|
+
if "username" in params and not isinstance(params["username"], str):
|
|
933
|
+
raise InvalidParameterError("Bad parameter: username must be an str")
|
|
934
|
+
if "google_cloud_storage_bucket" in params and not isinstance(
|
|
935
|
+
params["google_cloud_storage_bucket"], str
|
|
936
|
+
):
|
|
937
|
+
raise InvalidParameterError(
|
|
938
|
+
"Bad parameter: google_cloud_storage_bucket must be an str"
|
|
939
|
+
)
|
|
940
|
+
if "google_cloud_storage_project_id" in params and not isinstance(
|
|
941
|
+
params["google_cloud_storage_project_id"], str
|
|
942
|
+
):
|
|
943
|
+
raise InvalidParameterError(
|
|
944
|
+
"Bad parameter: google_cloud_storage_project_id must be an str"
|
|
945
|
+
)
|
|
946
|
+
if "backblaze_b2_bucket" in params and not isinstance(
|
|
947
|
+
params["backblaze_b2_bucket"], str
|
|
948
|
+
):
|
|
949
|
+
raise InvalidParameterError(
|
|
950
|
+
"Bad parameter: backblaze_b2_bucket must be an str"
|
|
951
|
+
)
|
|
952
|
+
if "backblaze_b2_s3_endpoint" in params and not isinstance(
|
|
953
|
+
params["backblaze_b2_s3_endpoint"], str
|
|
954
|
+
):
|
|
955
|
+
raise InvalidParameterError(
|
|
956
|
+
"Bad parameter: backblaze_b2_s3_endpoint must be an str"
|
|
957
|
+
)
|
|
958
|
+
if "wasabi_bucket" in params and not isinstance(
|
|
959
|
+
params["wasabi_bucket"], str
|
|
960
|
+
):
|
|
961
|
+
raise InvalidParameterError(
|
|
962
|
+
"Bad parameter: wasabi_bucket must be an str"
|
|
963
|
+
)
|
|
964
|
+
if "wasabi_region" in params and not isinstance(
|
|
965
|
+
params["wasabi_region"], str
|
|
966
|
+
):
|
|
967
|
+
raise InvalidParameterError(
|
|
968
|
+
"Bad parameter: wasabi_region must be an str"
|
|
969
|
+
)
|
|
970
|
+
if "rackspace_username" in params and not isinstance(
|
|
971
|
+
params["rackspace_username"], str
|
|
972
|
+
):
|
|
973
|
+
raise InvalidParameterError(
|
|
974
|
+
"Bad parameter: rackspace_username must be an str"
|
|
975
|
+
)
|
|
976
|
+
if "rackspace_region" in params and not isinstance(
|
|
977
|
+
params["rackspace_region"], str
|
|
978
|
+
):
|
|
979
|
+
raise InvalidParameterError(
|
|
980
|
+
"Bad parameter: rackspace_region must be an str"
|
|
981
|
+
)
|
|
982
|
+
if "rackspace_container" in params and not isinstance(
|
|
983
|
+
params["rackspace_container"], str
|
|
984
|
+
):
|
|
985
|
+
raise InvalidParameterError(
|
|
986
|
+
"Bad parameter: rackspace_container must be an str"
|
|
987
|
+
)
|
|
988
|
+
if "one_drive_account_type" in params and not isinstance(
|
|
989
|
+
params["one_drive_account_type"], str
|
|
990
|
+
):
|
|
991
|
+
raise InvalidParameterError(
|
|
992
|
+
"Bad parameter: one_drive_account_type must be an str"
|
|
993
|
+
)
|
|
994
|
+
if "azure_blob_storage_account" in params and not isinstance(
|
|
995
|
+
params["azure_blob_storage_account"], str
|
|
996
|
+
):
|
|
997
|
+
raise InvalidParameterError(
|
|
998
|
+
"Bad parameter: azure_blob_storage_account must be an str"
|
|
999
|
+
)
|
|
1000
|
+
if "azure_blob_storage_container" in params and not isinstance(
|
|
1001
|
+
params["azure_blob_storage_container"], str
|
|
1002
|
+
):
|
|
1003
|
+
raise InvalidParameterError(
|
|
1004
|
+
"Bad parameter: azure_blob_storage_container must be an str"
|
|
1005
|
+
)
|
|
1006
|
+
if "azure_blob_storage_sas_token" in params and not isinstance(
|
|
1007
|
+
params["azure_blob_storage_sas_token"], str
|
|
1008
|
+
):
|
|
1009
|
+
raise InvalidParameterError(
|
|
1010
|
+
"Bad parameter: azure_blob_storage_sas_token must be an str"
|
|
1011
|
+
)
|
|
1012
|
+
if "azure_blob_storage_dns_suffix" in params and not isinstance(
|
|
1013
|
+
params["azure_blob_storage_dns_suffix"], str
|
|
1014
|
+
):
|
|
1015
|
+
raise InvalidParameterError(
|
|
1016
|
+
"Bad parameter: azure_blob_storage_dns_suffix must be an str"
|
|
1017
|
+
)
|
|
1018
|
+
if "azure_files_storage_account" in params and not isinstance(
|
|
1019
|
+
params["azure_files_storage_account"], str
|
|
1020
|
+
):
|
|
1021
|
+
raise InvalidParameterError(
|
|
1022
|
+
"Bad parameter: azure_files_storage_account must be an str"
|
|
1023
|
+
)
|
|
1024
|
+
if "azure_files_storage_share_name" in params and not isinstance(
|
|
1025
|
+
params["azure_files_storage_share_name"], str
|
|
1026
|
+
):
|
|
1027
|
+
raise InvalidParameterError(
|
|
1028
|
+
"Bad parameter: azure_files_storage_share_name must be an str"
|
|
1029
|
+
)
|
|
1030
|
+
if "azure_files_storage_dns_suffix" in params and not isinstance(
|
|
1031
|
+
params["azure_files_storage_dns_suffix"], str
|
|
1032
|
+
):
|
|
1033
|
+
raise InvalidParameterError(
|
|
1034
|
+
"Bad parameter: azure_files_storage_dns_suffix must be an str"
|
|
1035
|
+
)
|
|
1036
|
+
if "azure_files_storage_sas_token" in params and not isinstance(
|
|
1037
|
+
params["azure_files_storage_sas_token"], str
|
|
1038
|
+
):
|
|
1039
|
+
raise InvalidParameterError(
|
|
1040
|
+
"Bad parameter: azure_files_storage_sas_token must be an str"
|
|
1041
|
+
)
|
|
1042
|
+
if "s3_compatible_bucket" in params and not isinstance(
|
|
1043
|
+
params["s3_compatible_bucket"], str
|
|
1044
|
+
):
|
|
1045
|
+
raise InvalidParameterError(
|
|
1046
|
+
"Bad parameter: s3_compatible_bucket must be an str"
|
|
1047
|
+
)
|
|
1048
|
+
if "s3_compatible_endpoint" in params and not isinstance(
|
|
1049
|
+
params["s3_compatible_endpoint"], str
|
|
1050
|
+
):
|
|
1051
|
+
raise InvalidParameterError(
|
|
1052
|
+
"Bad parameter: s3_compatible_endpoint must be an str"
|
|
1053
|
+
)
|
|
1054
|
+
if "s3_compatible_region" in params and not isinstance(
|
|
1055
|
+
params["s3_compatible_region"], str
|
|
1056
|
+
):
|
|
1057
|
+
raise InvalidParameterError(
|
|
1058
|
+
"Bad parameter: s3_compatible_region must be an str"
|
|
1059
|
+
)
|
|
1060
|
+
if "s3_compatible_access_key" in params and not isinstance(
|
|
1061
|
+
params["s3_compatible_access_key"], str
|
|
1062
|
+
):
|
|
1063
|
+
raise InvalidParameterError(
|
|
1064
|
+
"Bad parameter: s3_compatible_access_key must be an str"
|
|
1065
|
+
)
|
|
1066
|
+
if "s3_compatible_secret_key" in params and not isinstance(
|
|
1067
|
+
params["s3_compatible_secret_key"], str
|
|
1068
|
+
):
|
|
1069
|
+
raise InvalidParameterError(
|
|
1070
|
+
"Bad parameter: s3_compatible_secret_key must be an str"
|
|
1071
|
+
)
|
|
1072
|
+
if "files_agent_root" in params and not isinstance(
|
|
1073
|
+
params["files_agent_root"], str
|
|
1074
|
+
):
|
|
1075
|
+
raise InvalidParameterError(
|
|
1076
|
+
"Bad parameter: files_agent_root must be an str"
|
|
1077
|
+
)
|
|
1078
|
+
if "files_agent_permission_set" in params and not isinstance(
|
|
1079
|
+
params["files_agent_permission_set"], str
|
|
1080
|
+
):
|
|
1081
|
+
raise InvalidParameterError(
|
|
1082
|
+
"Bad parameter: files_agent_permission_set must be an str"
|
|
1083
|
+
)
|
|
1084
|
+
if "files_agent_version" in params and not isinstance(
|
|
1085
|
+
params["files_agent_version"], str
|
|
1086
|
+
):
|
|
1087
|
+
raise InvalidParameterError(
|
|
1088
|
+
"Bad parameter: files_agent_version must be an str"
|
|
1089
|
+
)
|
|
1090
|
+
if "filebase_access_key" in params and not isinstance(
|
|
1091
|
+
params["filebase_access_key"], str
|
|
1092
|
+
):
|
|
1093
|
+
raise InvalidParameterError(
|
|
1094
|
+
"Bad parameter: filebase_access_key must be an str"
|
|
1095
|
+
)
|
|
1096
|
+
if "filebase_secret_key" in params and not isinstance(
|
|
1097
|
+
params["filebase_secret_key"], str
|
|
1098
|
+
):
|
|
1099
|
+
raise InvalidParameterError(
|
|
1100
|
+
"Bad parameter: filebase_secret_key must be an str"
|
|
1101
|
+
)
|
|
1102
|
+
if "filebase_bucket" in params and not isinstance(
|
|
1103
|
+
params["filebase_bucket"], str
|
|
1104
|
+
):
|
|
1105
|
+
raise InvalidParameterError(
|
|
1106
|
+
"Bad parameter: filebase_bucket must be an str"
|
|
1107
|
+
)
|
|
1108
|
+
if "cloudflare_access_key" in params and not isinstance(
|
|
1109
|
+
params["cloudflare_access_key"], str
|
|
1110
|
+
):
|
|
1111
|
+
raise InvalidParameterError(
|
|
1112
|
+
"Bad parameter: cloudflare_access_key must be an str"
|
|
1113
|
+
)
|
|
1114
|
+
if "cloudflare_secret_key" in params and not isinstance(
|
|
1115
|
+
params["cloudflare_secret_key"], str
|
|
1116
|
+
):
|
|
1117
|
+
raise InvalidParameterError(
|
|
1118
|
+
"Bad parameter: cloudflare_secret_key must be an str"
|
|
1119
|
+
)
|
|
1120
|
+
if "cloudflare_bucket" in params and not isinstance(
|
|
1121
|
+
params["cloudflare_bucket"], str
|
|
1122
|
+
):
|
|
1123
|
+
raise InvalidParameterError(
|
|
1124
|
+
"Bad parameter: cloudflare_bucket must be an str"
|
|
1125
|
+
)
|
|
1126
|
+
if "cloudflare_endpoint" in params and not isinstance(
|
|
1127
|
+
params["cloudflare_endpoint"], str
|
|
1128
|
+
):
|
|
1129
|
+
raise InvalidParameterError(
|
|
1130
|
+
"Bad parameter: cloudflare_endpoint must be an str"
|
|
1131
|
+
)
|
|
1132
|
+
if "linode_access_key" in params and not isinstance(
|
|
1133
|
+
params["linode_access_key"], str
|
|
1134
|
+
):
|
|
1135
|
+
raise InvalidParameterError(
|
|
1136
|
+
"Bad parameter: linode_access_key must be an str"
|
|
1137
|
+
)
|
|
1138
|
+
if "linode_secret_key" in params and not isinstance(
|
|
1139
|
+
params["linode_secret_key"], str
|
|
1140
|
+
):
|
|
1141
|
+
raise InvalidParameterError(
|
|
1142
|
+
"Bad parameter: linode_secret_key must be an str"
|
|
1143
|
+
)
|
|
1144
|
+
if "linode_bucket" in params and not isinstance(
|
|
1145
|
+
params["linode_bucket"], str
|
|
1146
|
+
):
|
|
1147
|
+
raise InvalidParameterError(
|
|
1148
|
+
"Bad parameter: linode_bucket must be an str"
|
|
1149
|
+
)
|
|
1150
|
+
if "linode_region" in params and not isinstance(
|
|
1151
|
+
params["linode_region"], str
|
|
1152
|
+
):
|
|
1153
|
+
raise InvalidParameterError(
|
|
1154
|
+
"Bad parameter: linode_region must be an str"
|
|
1155
|
+
)
|
|
1156
|
+
response, options = Api.send_request(
|
|
1157
|
+
"POST", "/remote_servers", params, options
|
|
1158
|
+
)
|
|
1159
|
+
return RemoteServer(response.data, options)
|
|
1160
|
+
|
|
1161
|
+
|
|
1162
|
+
# Post local changes, check in, and download configuration file (used by some Remote Server integrations, such as the Files.com Agent)
|
|
1163
|
+
#
|
|
1164
|
+
# Parameters:
|
|
1165
|
+
# api_token - string - Files Agent API Token
|
|
1166
|
+
# permission_set - string - The permission set for the agent ['read_write', 'read_only', 'write_only']
|
|
1167
|
+
# root - string - The root directory for the agent
|
|
1168
|
+
# hostname - string
|
|
1169
|
+
# port - int64 - Incoming port for files agent connections
|
|
1170
|
+
# status - string - either running or shutdown
|
|
1171
|
+
# config_version - string - agent config version
|
|
1172
|
+
# private_key - string - The private key for the agent
|
|
1173
|
+
# public_key - string - public key
|
|
1174
|
+
# server_host_key - string
|
|
1175
|
+
# subdomain - string - Files.com subdomain site name
|
|
1176
|
+
def configuration_file(id, params=None, options=None):
|
|
1177
|
+
if not isinstance(params, dict):
|
|
1178
|
+
params = {}
|
|
1179
|
+
if not isinstance(options, dict):
|
|
1180
|
+
options = {}
|
|
1181
|
+
params["id"] = id
|
|
1182
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
1183
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
1184
|
+
if "api_token" in params and not isinstance(params["api_token"], str):
|
|
1185
|
+
raise InvalidParameterError("Bad parameter: api_token must be an str")
|
|
1186
|
+
if "permission_set" in params and not isinstance(
|
|
1187
|
+
params["permission_set"], str
|
|
1188
|
+
):
|
|
1189
|
+
raise InvalidParameterError(
|
|
1190
|
+
"Bad parameter: permission_set must be an str"
|
|
1191
|
+
)
|
|
1192
|
+
if "root" in params and not isinstance(params["root"], str):
|
|
1193
|
+
raise InvalidParameterError("Bad parameter: root must be an str")
|
|
1194
|
+
if "hostname" in params and not isinstance(params["hostname"], str):
|
|
1195
|
+
raise InvalidParameterError("Bad parameter: hostname must be an str")
|
|
1196
|
+
if "port" in params and not isinstance(params["port"], int):
|
|
1197
|
+
raise InvalidParameterError("Bad parameter: port must be an int")
|
|
1198
|
+
if "status" in params and not isinstance(params["status"], str):
|
|
1199
|
+
raise InvalidParameterError("Bad parameter: status must be an str")
|
|
1200
|
+
if "config_version" in params and not isinstance(
|
|
1201
|
+
params["config_version"], str
|
|
1202
|
+
):
|
|
1203
|
+
raise InvalidParameterError(
|
|
1204
|
+
"Bad parameter: config_version must be an str"
|
|
1205
|
+
)
|
|
1206
|
+
if "private_key" in params and not isinstance(params["private_key"], str):
|
|
1207
|
+
raise InvalidParameterError(
|
|
1208
|
+
"Bad parameter: private_key must be an str"
|
|
1209
|
+
)
|
|
1210
|
+
if "public_key" in params and not isinstance(params["public_key"], str):
|
|
1211
|
+
raise InvalidParameterError("Bad parameter: public_key must be an str")
|
|
1212
|
+
if "server_host_key" in params and not isinstance(
|
|
1213
|
+
params["server_host_key"], str
|
|
1214
|
+
):
|
|
1215
|
+
raise InvalidParameterError(
|
|
1216
|
+
"Bad parameter: server_host_key must be an str"
|
|
1217
|
+
)
|
|
1218
|
+
if "subdomain" in params and not isinstance(params["subdomain"], str):
|
|
1219
|
+
raise InvalidParameterError("Bad parameter: subdomain must be an str")
|
|
1220
|
+
if "id" not in params:
|
|
1221
|
+
raise MissingParameterError("Parameter missing: id")
|
|
1222
|
+
response, options = Api.send_request(
|
|
1223
|
+
"POST",
|
|
1224
|
+
"/remote_servers/{id}/configuration_file".format(id=params["id"]),
|
|
1225
|
+
params,
|
|
1226
|
+
options,
|
|
1227
|
+
)
|
|
1228
|
+
return RemoteServerConfigurationFile(response.data, options)
|
|
1229
|
+
|
|
1230
|
+
|
|
1231
|
+
# Parameters:
|
|
1232
|
+
# aws_access_key - string - AWS Access Key.
|
|
1233
|
+
# aws_secret_key - string - AWS secret key.
|
|
1234
|
+
# password - string - Password if needed.
|
|
1235
|
+
# private_key - string - Private key if needed.
|
|
1236
|
+
# private_key_passphrase - string - Passphrase for private key if needed.
|
|
1237
|
+
# ssl_certificate - string - SSL client certificate.
|
|
1238
|
+
# google_cloud_storage_credentials_json - string - A JSON file that contains the private key. To generate see https://cloud.google.com/storage/docs/json_api/v1/how-tos/authorizing#APIKey
|
|
1239
|
+
# wasabi_access_key - string - Wasabi access key.
|
|
1240
|
+
# wasabi_secret_key - string - Wasabi secret key.
|
|
1241
|
+
# backblaze_b2_key_id - string - Backblaze B2 Cloud Storage keyID.
|
|
1242
|
+
# backblaze_b2_application_key - string - Backblaze B2 Cloud Storage applicationKey.
|
|
1243
|
+
# rackspace_api_key - string - Rackspace API key from the Rackspace Cloud Control Panel.
|
|
1244
|
+
# reset_authentication - boolean - Reset authenticated account
|
|
1245
|
+
# azure_blob_storage_access_key - string - Azure Blob Storage secret key.
|
|
1246
|
+
# azure_files_storage_access_key - string - Azure File Storage access key.
|
|
1247
|
+
# hostname - string - Hostname or IP address
|
|
1248
|
+
# name - string - Internal name for your reference
|
|
1249
|
+
# max_connections - int64 - Max number of parallel connections. Ignored for S3 connections (we will parallelize these as much as possible).
|
|
1250
|
+
# pin_to_site_region - boolean - If true, we will ensure that all communications with this remote server are made through the primary region of the site. This setting can also be overridden by a site-wide setting which will force it to true.
|
|
1251
|
+
# port - int64 - Port for remote server. Not needed for S3.
|
|
1252
|
+
# s3_bucket - string - S3 bucket name
|
|
1253
|
+
# s3_region - string - S3 region
|
|
1254
|
+
# server_certificate - string - Remote server certificate
|
|
1255
|
+
# server_host_key - string - Remote server SSH Host Key. If provided, we will require that the server host key matches the provided key. Uses OpenSSH format similar to what would go into ~/.ssh/known_hosts
|
|
1256
|
+
# server_type - string - Remote server type.
|
|
1257
|
+
# ssl - string - Should we require SSL?
|
|
1258
|
+
# username - string - Remote server username. Not needed for S3 buckets.
|
|
1259
|
+
# google_cloud_storage_bucket - string - Google Cloud Storage bucket name
|
|
1260
|
+
# google_cloud_storage_project_id - string - Google Cloud Project ID
|
|
1261
|
+
# backblaze_b2_bucket - string - Backblaze B2 Cloud Storage Bucket name
|
|
1262
|
+
# backblaze_b2_s3_endpoint - string - Backblaze B2 Cloud Storage S3 Endpoint
|
|
1263
|
+
# wasabi_bucket - string - Wasabi Bucket name
|
|
1264
|
+
# wasabi_region - string - Wasabi region
|
|
1265
|
+
# rackspace_username - string - Rackspace username used to login to the Rackspace Cloud Control Panel.
|
|
1266
|
+
# rackspace_region - string - Three letter airport code for Rackspace region. See https://support.rackspace.com/how-to/about-regions/
|
|
1267
|
+
# rackspace_container - string - The name of the container (top level directory) where files will sync.
|
|
1268
|
+
# one_drive_account_type - string - Either personal or business_other account types
|
|
1269
|
+
# azure_blob_storage_account - string - Azure Blob Storage Account name
|
|
1270
|
+
# azure_blob_storage_container - string - Azure Blob Storage Container name
|
|
1271
|
+
# azure_blob_storage_hierarchical_namespace - boolean - Enable when storage account has hierarchical namespace feature enabled
|
|
1272
|
+
# azure_blob_storage_sas_token - string - Shared Access Signature (SAS) token
|
|
1273
|
+
# azure_blob_storage_dns_suffix - string - Custom DNS suffix
|
|
1274
|
+
# azure_files_storage_account - string - Azure File Storage Account name
|
|
1275
|
+
# azure_files_storage_share_name - string - Azure File Storage Share name
|
|
1276
|
+
# azure_files_storage_dns_suffix - string - Custom DNS suffix
|
|
1277
|
+
# azure_files_storage_sas_token - string - Shared Access Signature (SAS) token
|
|
1278
|
+
# s3_compatible_bucket - string - S3-compatible Bucket name
|
|
1279
|
+
# s3_compatible_endpoint - string - S3-compatible endpoint
|
|
1280
|
+
# s3_compatible_region - string - S3-compatible endpoint
|
|
1281
|
+
# enable_dedicated_ips - boolean - `true` if remote server only accepts connections from dedicated IPs
|
|
1282
|
+
# s3_compatible_access_key - string - S3-compatible Access Key.
|
|
1283
|
+
# s3_compatible_secret_key - string - S3-compatible secret key
|
|
1284
|
+
# files_agent_root - string - Agent local root path
|
|
1285
|
+
# files_agent_permission_set - string - Local permissions for files agent. read_only, write_only, or read_write
|
|
1286
|
+
# files_agent_version - string - Files Agent version
|
|
1287
|
+
# filebase_access_key - string - Filebase Access Key.
|
|
1288
|
+
# filebase_secret_key - string - Filebase secret key
|
|
1289
|
+
# filebase_bucket - string - Filebase Bucket name
|
|
1290
|
+
# cloudflare_access_key - string - Cloudflare Access Key.
|
|
1291
|
+
# cloudflare_secret_key - string - Cloudflare secret key
|
|
1292
|
+
# cloudflare_bucket - string - Cloudflare Bucket name
|
|
1293
|
+
# cloudflare_endpoint - string - Cloudflare endpoint
|
|
1294
|
+
# dropbox_teams - boolean - List Team folders in root
|
|
1295
|
+
# linode_access_key - string - Linode Access Key.
|
|
1296
|
+
# linode_secret_key - string - Linode secret key
|
|
1297
|
+
# linode_bucket - string - Linode Bucket name
|
|
1298
|
+
# linode_region - string - Linode region
|
|
1299
|
+
def update(id, params=None, options=None):
|
|
1300
|
+
if not isinstance(params, dict):
|
|
1301
|
+
params = {}
|
|
1302
|
+
if not isinstance(options, dict):
|
|
1303
|
+
options = {}
|
|
1304
|
+
params["id"] = id
|
|
1305
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
1306
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
1307
|
+
if "aws_access_key" in params and not isinstance(
|
|
1308
|
+
params["aws_access_key"], str
|
|
1309
|
+
):
|
|
1310
|
+
raise InvalidParameterError(
|
|
1311
|
+
"Bad parameter: aws_access_key must be an str"
|
|
1312
|
+
)
|
|
1313
|
+
if "aws_secret_key" in params and not isinstance(
|
|
1314
|
+
params["aws_secret_key"], str
|
|
1315
|
+
):
|
|
1316
|
+
raise InvalidParameterError(
|
|
1317
|
+
"Bad parameter: aws_secret_key must be an str"
|
|
1318
|
+
)
|
|
1319
|
+
if "password" in params and not isinstance(params["password"], str):
|
|
1320
|
+
raise InvalidParameterError("Bad parameter: password must be an str")
|
|
1321
|
+
if "private_key" in params and not isinstance(params["private_key"], str):
|
|
1322
|
+
raise InvalidParameterError(
|
|
1323
|
+
"Bad parameter: private_key must be an str"
|
|
1324
|
+
)
|
|
1325
|
+
if "private_key_passphrase" in params and not isinstance(
|
|
1326
|
+
params["private_key_passphrase"], str
|
|
1327
|
+
):
|
|
1328
|
+
raise InvalidParameterError(
|
|
1329
|
+
"Bad parameter: private_key_passphrase must be an str"
|
|
1330
|
+
)
|
|
1331
|
+
if "ssl_certificate" in params and not isinstance(
|
|
1332
|
+
params["ssl_certificate"], str
|
|
1333
|
+
):
|
|
1334
|
+
raise InvalidParameterError(
|
|
1335
|
+
"Bad parameter: ssl_certificate must be an str"
|
|
1336
|
+
)
|
|
1337
|
+
if "google_cloud_storage_credentials_json" in params and not isinstance(
|
|
1338
|
+
params["google_cloud_storage_credentials_json"], str
|
|
1339
|
+
):
|
|
1340
|
+
raise InvalidParameterError(
|
|
1341
|
+
"Bad parameter: google_cloud_storage_credentials_json must be an str"
|
|
1342
|
+
)
|
|
1343
|
+
if "wasabi_access_key" in params and not isinstance(
|
|
1344
|
+
params["wasabi_access_key"], str
|
|
1345
|
+
):
|
|
1346
|
+
raise InvalidParameterError(
|
|
1347
|
+
"Bad parameter: wasabi_access_key must be an str"
|
|
1348
|
+
)
|
|
1349
|
+
if "wasabi_secret_key" in params and not isinstance(
|
|
1350
|
+
params["wasabi_secret_key"], str
|
|
1351
|
+
):
|
|
1352
|
+
raise InvalidParameterError(
|
|
1353
|
+
"Bad parameter: wasabi_secret_key must be an str"
|
|
1354
|
+
)
|
|
1355
|
+
if "backblaze_b2_key_id" in params and not isinstance(
|
|
1356
|
+
params["backblaze_b2_key_id"], str
|
|
1357
|
+
):
|
|
1358
|
+
raise InvalidParameterError(
|
|
1359
|
+
"Bad parameter: backblaze_b2_key_id must be an str"
|
|
1360
|
+
)
|
|
1361
|
+
if "backblaze_b2_application_key" in params and not isinstance(
|
|
1362
|
+
params["backblaze_b2_application_key"], str
|
|
1363
|
+
):
|
|
1364
|
+
raise InvalidParameterError(
|
|
1365
|
+
"Bad parameter: backblaze_b2_application_key must be an str"
|
|
1366
|
+
)
|
|
1367
|
+
if "rackspace_api_key" in params and not isinstance(
|
|
1368
|
+
params["rackspace_api_key"], str
|
|
1369
|
+
):
|
|
1370
|
+
raise InvalidParameterError(
|
|
1371
|
+
"Bad parameter: rackspace_api_key must be an str"
|
|
1372
|
+
)
|
|
1373
|
+
if "azure_blob_storage_access_key" in params and not isinstance(
|
|
1374
|
+
params["azure_blob_storage_access_key"], str
|
|
1375
|
+
):
|
|
1376
|
+
raise InvalidParameterError(
|
|
1377
|
+
"Bad parameter: azure_blob_storage_access_key must be an str"
|
|
1378
|
+
)
|
|
1379
|
+
if "azure_files_storage_access_key" in params and not isinstance(
|
|
1380
|
+
params["azure_files_storage_access_key"], str
|
|
1381
|
+
):
|
|
1382
|
+
raise InvalidParameterError(
|
|
1383
|
+
"Bad parameter: azure_files_storage_access_key must be an str"
|
|
1384
|
+
)
|
|
1385
|
+
if "hostname" in params and not isinstance(params["hostname"], str):
|
|
1386
|
+
raise InvalidParameterError("Bad parameter: hostname must be an str")
|
|
1387
|
+
if "name" in params and not isinstance(params["name"], str):
|
|
1388
|
+
raise InvalidParameterError("Bad parameter: name must be an str")
|
|
1389
|
+
if "max_connections" in params and not isinstance(
|
|
1390
|
+
params["max_connections"], int
|
|
1391
|
+
):
|
|
1392
|
+
raise InvalidParameterError(
|
|
1393
|
+
"Bad parameter: max_connections must be an int"
|
|
1394
|
+
)
|
|
1395
|
+
if "port" in params and not isinstance(params["port"], int):
|
|
1396
|
+
raise InvalidParameterError("Bad parameter: port must be an int")
|
|
1397
|
+
if "s3_bucket" in params and not isinstance(params["s3_bucket"], str):
|
|
1398
|
+
raise InvalidParameterError("Bad parameter: s3_bucket must be an str")
|
|
1399
|
+
if "s3_region" in params and not isinstance(params["s3_region"], str):
|
|
1400
|
+
raise InvalidParameterError("Bad parameter: s3_region must be an str")
|
|
1401
|
+
if "server_certificate" in params and not isinstance(
|
|
1402
|
+
params["server_certificate"], str
|
|
1403
|
+
):
|
|
1404
|
+
raise InvalidParameterError(
|
|
1405
|
+
"Bad parameter: server_certificate must be an str"
|
|
1406
|
+
)
|
|
1407
|
+
if "server_host_key" in params and not isinstance(
|
|
1408
|
+
params["server_host_key"], str
|
|
1409
|
+
):
|
|
1410
|
+
raise InvalidParameterError(
|
|
1411
|
+
"Bad parameter: server_host_key must be an str"
|
|
1412
|
+
)
|
|
1413
|
+
if "server_type" in params and not isinstance(params["server_type"], str):
|
|
1414
|
+
raise InvalidParameterError(
|
|
1415
|
+
"Bad parameter: server_type must be an str"
|
|
1416
|
+
)
|
|
1417
|
+
if "ssl" in params and not isinstance(params["ssl"], str):
|
|
1418
|
+
raise InvalidParameterError("Bad parameter: ssl must be an str")
|
|
1419
|
+
if "username" in params and not isinstance(params["username"], str):
|
|
1420
|
+
raise InvalidParameterError("Bad parameter: username must be an str")
|
|
1421
|
+
if "google_cloud_storage_bucket" in params and not isinstance(
|
|
1422
|
+
params["google_cloud_storage_bucket"], str
|
|
1423
|
+
):
|
|
1424
|
+
raise InvalidParameterError(
|
|
1425
|
+
"Bad parameter: google_cloud_storage_bucket must be an str"
|
|
1426
|
+
)
|
|
1427
|
+
if "google_cloud_storage_project_id" in params and not isinstance(
|
|
1428
|
+
params["google_cloud_storage_project_id"], str
|
|
1429
|
+
):
|
|
1430
|
+
raise InvalidParameterError(
|
|
1431
|
+
"Bad parameter: google_cloud_storage_project_id must be an str"
|
|
1432
|
+
)
|
|
1433
|
+
if "backblaze_b2_bucket" in params and not isinstance(
|
|
1434
|
+
params["backblaze_b2_bucket"], str
|
|
1435
|
+
):
|
|
1436
|
+
raise InvalidParameterError(
|
|
1437
|
+
"Bad parameter: backblaze_b2_bucket must be an str"
|
|
1438
|
+
)
|
|
1439
|
+
if "backblaze_b2_s3_endpoint" in params and not isinstance(
|
|
1440
|
+
params["backblaze_b2_s3_endpoint"], str
|
|
1441
|
+
):
|
|
1442
|
+
raise InvalidParameterError(
|
|
1443
|
+
"Bad parameter: backblaze_b2_s3_endpoint must be an str"
|
|
1444
|
+
)
|
|
1445
|
+
if "wasabi_bucket" in params and not isinstance(
|
|
1446
|
+
params["wasabi_bucket"], str
|
|
1447
|
+
):
|
|
1448
|
+
raise InvalidParameterError(
|
|
1449
|
+
"Bad parameter: wasabi_bucket must be an str"
|
|
1450
|
+
)
|
|
1451
|
+
if "wasabi_region" in params and not isinstance(
|
|
1452
|
+
params["wasabi_region"], str
|
|
1453
|
+
):
|
|
1454
|
+
raise InvalidParameterError(
|
|
1455
|
+
"Bad parameter: wasabi_region must be an str"
|
|
1456
|
+
)
|
|
1457
|
+
if "rackspace_username" in params and not isinstance(
|
|
1458
|
+
params["rackspace_username"], str
|
|
1459
|
+
):
|
|
1460
|
+
raise InvalidParameterError(
|
|
1461
|
+
"Bad parameter: rackspace_username must be an str"
|
|
1462
|
+
)
|
|
1463
|
+
if "rackspace_region" in params and not isinstance(
|
|
1464
|
+
params["rackspace_region"], str
|
|
1465
|
+
):
|
|
1466
|
+
raise InvalidParameterError(
|
|
1467
|
+
"Bad parameter: rackspace_region must be an str"
|
|
1468
|
+
)
|
|
1469
|
+
if "rackspace_container" in params and not isinstance(
|
|
1470
|
+
params["rackspace_container"], str
|
|
1471
|
+
):
|
|
1472
|
+
raise InvalidParameterError(
|
|
1473
|
+
"Bad parameter: rackspace_container must be an str"
|
|
1474
|
+
)
|
|
1475
|
+
if "one_drive_account_type" in params and not isinstance(
|
|
1476
|
+
params["one_drive_account_type"], str
|
|
1477
|
+
):
|
|
1478
|
+
raise InvalidParameterError(
|
|
1479
|
+
"Bad parameter: one_drive_account_type must be an str"
|
|
1480
|
+
)
|
|
1481
|
+
if "azure_blob_storage_account" in params and not isinstance(
|
|
1482
|
+
params["azure_blob_storage_account"], str
|
|
1483
|
+
):
|
|
1484
|
+
raise InvalidParameterError(
|
|
1485
|
+
"Bad parameter: azure_blob_storage_account must be an str"
|
|
1486
|
+
)
|
|
1487
|
+
if "azure_blob_storage_container" in params and not isinstance(
|
|
1488
|
+
params["azure_blob_storage_container"], str
|
|
1489
|
+
):
|
|
1490
|
+
raise InvalidParameterError(
|
|
1491
|
+
"Bad parameter: azure_blob_storage_container must be an str"
|
|
1492
|
+
)
|
|
1493
|
+
if "azure_blob_storage_sas_token" in params and not isinstance(
|
|
1494
|
+
params["azure_blob_storage_sas_token"], str
|
|
1495
|
+
):
|
|
1496
|
+
raise InvalidParameterError(
|
|
1497
|
+
"Bad parameter: azure_blob_storage_sas_token must be an str"
|
|
1498
|
+
)
|
|
1499
|
+
if "azure_blob_storage_dns_suffix" in params and not isinstance(
|
|
1500
|
+
params["azure_blob_storage_dns_suffix"], str
|
|
1501
|
+
):
|
|
1502
|
+
raise InvalidParameterError(
|
|
1503
|
+
"Bad parameter: azure_blob_storage_dns_suffix must be an str"
|
|
1504
|
+
)
|
|
1505
|
+
if "azure_files_storage_account" in params and not isinstance(
|
|
1506
|
+
params["azure_files_storage_account"], str
|
|
1507
|
+
):
|
|
1508
|
+
raise InvalidParameterError(
|
|
1509
|
+
"Bad parameter: azure_files_storage_account must be an str"
|
|
1510
|
+
)
|
|
1511
|
+
if "azure_files_storage_share_name" in params and not isinstance(
|
|
1512
|
+
params["azure_files_storage_share_name"], str
|
|
1513
|
+
):
|
|
1514
|
+
raise InvalidParameterError(
|
|
1515
|
+
"Bad parameter: azure_files_storage_share_name must be an str"
|
|
1516
|
+
)
|
|
1517
|
+
if "azure_files_storage_dns_suffix" in params and not isinstance(
|
|
1518
|
+
params["azure_files_storage_dns_suffix"], str
|
|
1519
|
+
):
|
|
1520
|
+
raise InvalidParameterError(
|
|
1521
|
+
"Bad parameter: azure_files_storage_dns_suffix must be an str"
|
|
1522
|
+
)
|
|
1523
|
+
if "azure_files_storage_sas_token" in params and not isinstance(
|
|
1524
|
+
params["azure_files_storage_sas_token"], str
|
|
1525
|
+
):
|
|
1526
|
+
raise InvalidParameterError(
|
|
1527
|
+
"Bad parameter: azure_files_storage_sas_token must be an str"
|
|
1528
|
+
)
|
|
1529
|
+
if "s3_compatible_bucket" in params and not isinstance(
|
|
1530
|
+
params["s3_compatible_bucket"], str
|
|
1531
|
+
):
|
|
1532
|
+
raise InvalidParameterError(
|
|
1533
|
+
"Bad parameter: s3_compatible_bucket must be an str"
|
|
1534
|
+
)
|
|
1535
|
+
if "s3_compatible_endpoint" in params and not isinstance(
|
|
1536
|
+
params["s3_compatible_endpoint"], str
|
|
1537
|
+
):
|
|
1538
|
+
raise InvalidParameterError(
|
|
1539
|
+
"Bad parameter: s3_compatible_endpoint must be an str"
|
|
1540
|
+
)
|
|
1541
|
+
if "s3_compatible_region" in params and not isinstance(
|
|
1542
|
+
params["s3_compatible_region"], str
|
|
1543
|
+
):
|
|
1544
|
+
raise InvalidParameterError(
|
|
1545
|
+
"Bad parameter: s3_compatible_region must be an str"
|
|
1546
|
+
)
|
|
1547
|
+
if "s3_compatible_access_key" in params and not isinstance(
|
|
1548
|
+
params["s3_compatible_access_key"], str
|
|
1549
|
+
):
|
|
1550
|
+
raise InvalidParameterError(
|
|
1551
|
+
"Bad parameter: s3_compatible_access_key must be an str"
|
|
1552
|
+
)
|
|
1553
|
+
if "s3_compatible_secret_key" in params and not isinstance(
|
|
1554
|
+
params["s3_compatible_secret_key"], str
|
|
1555
|
+
):
|
|
1556
|
+
raise InvalidParameterError(
|
|
1557
|
+
"Bad parameter: s3_compatible_secret_key must be an str"
|
|
1558
|
+
)
|
|
1559
|
+
if "files_agent_root" in params and not isinstance(
|
|
1560
|
+
params["files_agent_root"], str
|
|
1561
|
+
):
|
|
1562
|
+
raise InvalidParameterError(
|
|
1563
|
+
"Bad parameter: files_agent_root must be an str"
|
|
1564
|
+
)
|
|
1565
|
+
if "files_agent_permission_set" in params and not isinstance(
|
|
1566
|
+
params["files_agent_permission_set"], str
|
|
1567
|
+
):
|
|
1568
|
+
raise InvalidParameterError(
|
|
1569
|
+
"Bad parameter: files_agent_permission_set must be an str"
|
|
1570
|
+
)
|
|
1571
|
+
if "files_agent_version" in params and not isinstance(
|
|
1572
|
+
params["files_agent_version"], str
|
|
1573
|
+
):
|
|
1574
|
+
raise InvalidParameterError(
|
|
1575
|
+
"Bad parameter: files_agent_version must be an str"
|
|
1576
|
+
)
|
|
1577
|
+
if "filebase_access_key" in params and not isinstance(
|
|
1578
|
+
params["filebase_access_key"], str
|
|
1579
|
+
):
|
|
1580
|
+
raise InvalidParameterError(
|
|
1581
|
+
"Bad parameter: filebase_access_key must be an str"
|
|
1582
|
+
)
|
|
1583
|
+
if "filebase_secret_key" in params and not isinstance(
|
|
1584
|
+
params["filebase_secret_key"], str
|
|
1585
|
+
):
|
|
1586
|
+
raise InvalidParameterError(
|
|
1587
|
+
"Bad parameter: filebase_secret_key must be an str"
|
|
1588
|
+
)
|
|
1589
|
+
if "filebase_bucket" in params and not isinstance(
|
|
1590
|
+
params["filebase_bucket"], str
|
|
1591
|
+
):
|
|
1592
|
+
raise InvalidParameterError(
|
|
1593
|
+
"Bad parameter: filebase_bucket must be an str"
|
|
1594
|
+
)
|
|
1595
|
+
if "cloudflare_access_key" in params and not isinstance(
|
|
1596
|
+
params["cloudflare_access_key"], str
|
|
1597
|
+
):
|
|
1598
|
+
raise InvalidParameterError(
|
|
1599
|
+
"Bad parameter: cloudflare_access_key must be an str"
|
|
1600
|
+
)
|
|
1601
|
+
if "cloudflare_secret_key" in params and not isinstance(
|
|
1602
|
+
params["cloudflare_secret_key"], str
|
|
1603
|
+
):
|
|
1604
|
+
raise InvalidParameterError(
|
|
1605
|
+
"Bad parameter: cloudflare_secret_key must be an str"
|
|
1606
|
+
)
|
|
1607
|
+
if "cloudflare_bucket" in params and not isinstance(
|
|
1608
|
+
params["cloudflare_bucket"], str
|
|
1609
|
+
):
|
|
1610
|
+
raise InvalidParameterError(
|
|
1611
|
+
"Bad parameter: cloudflare_bucket must be an str"
|
|
1612
|
+
)
|
|
1613
|
+
if "cloudflare_endpoint" in params and not isinstance(
|
|
1614
|
+
params["cloudflare_endpoint"], str
|
|
1615
|
+
):
|
|
1616
|
+
raise InvalidParameterError(
|
|
1617
|
+
"Bad parameter: cloudflare_endpoint must be an str"
|
|
1618
|
+
)
|
|
1619
|
+
if "linode_access_key" in params and not isinstance(
|
|
1620
|
+
params["linode_access_key"], str
|
|
1621
|
+
):
|
|
1622
|
+
raise InvalidParameterError(
|
|
1623
|
+
"Bad parameter: linode_access_key must be an str"
|
|
1624
|
+
)
|
|
1625
|
+
if "linode_secret_key" in params and not isinstance(
|
|
1626
|
+
params["linode_secret_key"], str
|
|
1627
|
+
):
|
|
1628
|
+
raise InvalidParameterError(
|
|
1629
|
+
"Bad parameter: linode_secret_key must be an str"
|
|
1630
|
+
)
|
|
1631
|
+
if "linode_bucket" in params and not isinstance(
|
|
1632
|
+
params["linode_bucket"], str
|
|
1633
|
+
):
|
|
1634
|
+
raise InvalidParameterError(
|
|
1635
|
+
"Bad parameter: linode_bucket must be an str"
|
|
1636
|
+
)
|
|
1637
|
+
if "linode_region" in params and not isinstance(
|
|
1638
|
+
params["linode_region"], str
|
|
1639
|
+
):
|
|
1640
|
+
raise InvalidParameterError(
|
|
1641
|
+
"Bad parameter: linode_region must be an str"
|
|
1642
|
+
)
|
|
1643
|
+
if "id" not in params:
|
|
1644
|
+
raise MissingParameterError("Parameter missing: id")
|
|
1645
|
+
response, options = Api.send_request(
|
|
1646
|
+
"PATCH",
|
|
1647
|
+
"/remote_servers/{id}".format(id=params["id"]),
|
|
1648
|
+
params,
|
|
1649
|
+
options,
|
|
1650
|
+
)
|
|
1651
|
+
return RemoteServer(response.data, options)
|
|
1652
|
+
|
|
1653
|
+
|
|
1654
|
+
def delete(id, params=None, options=None):
|
|
1655
|
+
if not isinstance(params, dict):
|
|
1656
|
+
params = {}
|
|
1657
|
+
if not isinstance(options, dict):
|
|
1658
|
+
options = {}
|
|
1659
|
+
params["id"] = id
|
|
1660
|
+
if "id" in params and not isinstance(params["id"], int):
|
|
1661
|
+
raise InvalidParameterError("Bad parameter: id must be an int")
|
|
1662
|
+
if "id" not in params:
|
|
1663
|
+
raise MissingParameterError("Parameter missing: id")
|
|
1664
|
+
Api.send_request(
|
|
1665
|
+
"DELETE",
|
|
1666
|
+
"/remote_servers/{id}".format(id=params["id"]),
|
|
1667
|
+
params,
|
|
1668
|
+
options,
|
|
1669
|
+
)
|
|
1670
|
+
|
|
1671
|
+
|
|
1672
|
+
def destroy(id, params=None, options=None):
|
|
1673
|
+
delete(id, params, options)
|
|
1674
|
+
|
|
1675
|
+
|
|
1676
|
+
def new(*args, **kwargs):
|
|
1677
|
+
return RemoteServer(*args, **kwargs)
|