latitudesh-python-sdk 0.0.6__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 latitudesh-python-sdk might be problematic. Click here for more details.

Files changed (206) hide show
  1. latitudesh_python_sdk/__init__.py +18 -0
  2. latitudesh_python_sdk/_hooks/__init__.py +5 -0
  3. latitudesh_python_sdk/_hooks/registration.py +13 -0
  4. latitudesh_python_sdk/_hooks/sdkhooks.py +76 -0
  5. latitudesh_python_sdk/_hooks/types.py +106 -0
  6. latitudesh_python_sdk/_version.py +15 -0
  7. latitudesh_python_sdk/apikeys.py +802 -0
  8. latitudesh_python_sdk/basesdk.py +366 -0
  9. latitudesh_python_sdk/billing.py +210 -0
  10. latitudesh_python_sdk/events_sdk.py +240 -0
  11. latitudesh_python_sdk/firewalls_sdk.py +1640 -0
  12. latitudesh_python_sdk/httpclient.py +136 -0
  13. latitudesh_python_sdk/ipaddresses_sdk.py +448 -0
  14. latitudesh_python_sdk/models/__init__.py +1927 -0
  15. latitudesh_python_sdk/models/api_key.py +81 -0
  16. latitudesh_python_sdk/models/apierror.py +22 -0
  17. latitudesh_python_sdk/models/assign_server_virtual_networkop.py +43 -0
  18. latitudesh_python_sdk/models/bandwidth_packages.py +67 -0
  19. latitudesh_python_sdk/models/bandwidth_plan.py +72 -0
  20. latitudesh_python_sdk/models/bandwidth_plans.py +15 -0
  21. latitudesh_python_sdk/models/billing_usage.py +158 -0
  22. latitudesh_python_sdk/models/create_api_key.py +40 -0
  23. latitudesh_python_sdk/models/create_firewall_assignmentop.py +61 -0
  24. latitudesh_python_sdk/models/create_firewallop.py +69 -0
  25. latitudesh_python_sdk/models/create_ipmi_sessionop.py +16 -0
  26. latitudesh_python_sdk/models/create_projectop.py +79 -0
  27. latitudesh_python_sdk/models/create_server_actionop.py +69 -0
  28. latitudesh_python_sdk/models/create_server_out_of_bandop.py +61 -0
  29. latitudesh_python_sdk/models/create_server_reinstallop.py +140 -0
  30. latitudesh_python_sdk/models/create_serverop.py +173 -0
  31. latitudesh_python_sdk/models/create_tagop.py +50 -0
  32. latitudesh_python_sdk/models/create_virtual_networkop.py +72 -0
  33. latitudesh_python_sdk/models/custom_tag.py +54 -0
  34. latitudesh_python_sdk/models/delete_api_keyop.py +16 -0
  35. latitudesh_python_sdk/models/delete_firewall_assignmentop.py +25 -0
  36. latitudesh_python_sdk/models/delete_firewallop.py +18 -0
  37. latitudesh_python_sdk/models/delete_project_ssh_keyop.py +23 -0
  38. latitudesh_python_sdk/models/delete_project_user_dataop.py +23 -0
  39. latitudesh_python_sdk/models/delete_projectop.py +18 -0
  40. latitudesh_python_sdk/models/delete_storage_filesystemsop.py +16 -0
  41. latitudesh_python_sdk/models/delete_virtual_networks_assignmentsop.py +16 -0
  42. latitudesh_python_sdk/models/delete_vpn_sessionop.py +16 -0
  43. latitudesh_python_sdk/models/deploy_config.py +74 -0
  44. latitudesh_python_sdk/models/destroy_serverop.py +31 -0
  45. latitudesh_python_sdk/models/destroy_tagop.py +16 -0
  46. latitudesh_python_sdk/models/destroy_team_memberop.py +18 -0
  47. latitudesh_python_sdk/models/destroy_virtual_machineop.py +16 -0
  48. latitudesh_python_sdk/models/destroy_virtual_networkop.py +18 -0
  49. latitudesh_python_sdk/models/error_object.py +49 -0
  50. latitudesh_python_sdk/models/events.py +90 -0
  51. latitudesh_python_sdk/models/filesystem_data.py +53 -0
  52. latitudesh_python_sdk/models/firewall.py +71 -0
  53. latitudesh_python_sdk/models/firewall_server.py +50 -0
  54. latitudesh_python_sdk/models/firewalls.py +26 -0
  55. latitudesh_python_sdk/models/get_bandwidth_plansop.py +33 -0
  56. latitudesh_python_sdk/models/get_billing_usageop.py +46 -0
  57. latitudesh_python_sdk/models/get_eventsop.py +98 -0
  58. latitudesh_python_sdk/models/get_firewall_assignmentsop.py +18 -0
  59. latitudesh_python_sdk/models/get_firewallop.py +18 -0
  60. latitudesh_python_sdk/models/get_ipop.py +33 -0
  61. latitudesh_python_sdk/models/get_ipsop.py +91 -0
  62. latitudesh_python_sdk/models/get_planop.py +16 -0
  63. latitudesh_python_sdk/models/get_plans_operating_systemop.py +19 -0
  64. latitudesh_python_sdk/models/get_plansop.py +125 -0
  65. latitudesh_python_sdk/models/get_project_ssh_keyop.py +37 -0
  66. latitudesh_python_sdk/models/get_project_ssh_keysop.py +33 -0
  67. latitudesh_python_sdk/models/get_project_user_dataop.py +38 -0
  68. latitudesh_python_sdk/models/get_project_users_dataop.py +46 -0
  69. latitudesh_python_sdk/models/get_projectsop.py +76 -0
  70. latitudesh_python_sdk/models/get_regionop.py +18 -0
  71. latitudesh_python_sdk/models/get_role_idop.py +16 -0
  72. latitudesh_python_sdk/models/get_rolesop.py +19 -0
  73. latitudesh_python_sdk/models/get_server_deploy_configop.py +18 -0
  74. latitudesh_python_sdk/models/get_server_out_of_bandop.py +18 -0
  75. latitudesh_python_sdk/models/get_serverop.py +33 -0
  76. latitudesh_python_sdk/models/get_serversop.py +156 -0
  77. latitudesh_python_sdk/models/get_storage_filesystemsop.py +22 -0
  78. latitudesh_python_sdk/models/get_traffic_consumptionop.py +45 -0
  79. latitudesh_python_sdk/models/get_traffic_quotaop.py +20 -0
  80. latitudesh_python_sdk/models/get_user_profileop.py +19 -0
  81. latitudesh_python_sdk/models/get_virtual_networkop.py +32 -0
  82. latitudesh_python_sdk/models/get_virtual_networks_assignmentsop.py +40 -0
  83. latitudesh_python_sdk/models/get_virtual_networksop.py +40 -0
  84. latitudesh_python_sdk/models/get_vpn_sessionsop.py +70 -0
  85. latitudesh_python_sdk/models/index_virtual_machineop.py +22 -0
  86. latitudesh_python_sdk/models/ip_address.py +122 -0
  87. latitudesh_python_sdk/models/ip_addresses.py +15 -0
  88. latitudesh_python_sdk/models/ipmi_session.py +53 -0
  89. latitudesh_python_sdk/models/list_firewallsop.py +20 -0
  90. latitudesh_python_sdk/models/membership.py +63 -0
  91. latitudesh_python_sdk/models/operating_systems.py +57 -0
  92. latitudesh_python_sdk/models/out_of_band_connection.py +88 -0
  93. latitudesh_python_sdk/models/patch_current_teamop.py +91 -0
  94. latitudesh_python_sdk/models/patch_storage_filesystemsop.py +79 -0
  95. latitudesh_python_sdk/models/patch_user_profileop.py +88 -0
  96. latitudesh_python_sdk/models/plan.py +15 -0
  97. latitudesh_python_sdk/models/plan_data.py +206 -0
  98. latitudesh_python_sdk/models/post_api_keyop.py +19 -0
  99. latitudesh_python_sdk/models/post_project_ssh_keyop.py +81 -0
  100. latitudesh_python_sdk/models/post_project_user_dataop.py +68 -0
  101. latitudesh_python_sdk/models/post_storage_filesystemsop.py +63 -0
  102. latitudesh_python_sdk/models/post_team_membersop.py +54 -0
  103. latitudesh_python_sdk/models/post_teamop.py +67 -0
  104. latitudesh_python_sdk/models/post_vpn_sessionop.py +63 -0
  105. latitudesh_python_sdk/models/project.py +130 -0
  106. latitudesh_python_sdk/models/project_include.py +72 -0
  107. latitudesh_python_sdk/models/projects.py +15 -0
  108. latitudesh_python_sdk/models/put_project_ssh_keyop.py +87 -0
  109. latitudesh_python_sdk/models/put_project_user_dataop.py +76 -0
  110. latitudesh_python_sdk/models/put_vpn_sessionop.py +16 -0
  111. latitudesh_python_sdk/models/region.py +50 -0
  112. latitudesh_python_sdk/models/region_resource_data.py +37 -0
  113. latitudesh_python_sdk/models/regions.py +50 -0
  114. latitudesh_python_sdk/models/role.py +15 -0
  115. latitudesh_python_sdk/models/role_data.py +35 -0
  116. latitudesh_python_sdk/models/security.py +25 -0
  117. latitudesh_python_sdk/models/server.py +54 -0
  118. latitudesh_python_sdk/models/server_action.py +52 -0
  119. latitudesh_python_sdk/models/server_data.py +219 -0
  120. latitudesh_python_sdk/models/server_exit_rescue_modeop.py +16 -0
  121. latitudesh_python_sdk/models/server_lockop.py +16 -0
  122. latitudesh_python_sdk/models/server_rescue.py +22 -0
  123. latitudesh_python_sdk/models/server_schedule_deletion.py +44 -0
  124. latitudesh_python_sdk/models/server_schedule_deletionop.py +16 -0
  125. latitudesh_python_sdk/models/server_start_rescue_modeop.py +16 -0
  126. latitudesh_python_sdk/models/server_unlockop.py +16 -0
  127. latitudesh_python_sdk/models/server_unschedule_deletionop.py +16 -0
  128. latitudesh_python_sdk/models/servers.py +26 -0
  129. latitudesh_python_sdk/models/show_virtual_machineop.py +16 -0
  130. latitudesh_python_sdk/models/ssh_key.py +15 -0
  131. latitudesh_python_sdk/models/ssh_key_data.py +55 -0
  132. latitudesh_python_sdk/models/storage_plan.py +36 -0
  133. latitudesh_python_sdk/models/storage_plans.py +15 -0
  134. latitudesh_python_sdk/models/team.py +74 -0
  135. latitudesh_python_sdk/models/team_include.py +43 -0
  136. latitudesh_python_sdk/models/team_members.py +51 -0
  137. latitudesh_python_sdk/models/teams.py +26 -0
  138. latitudesh_python_sdk/models/traffic.py +133 -0
  139. latitudesh_python_sdk/models/traffic_quota.py +106 -0
  140. latitudesh_python_sdk/models/update_api_key.py +48 -0
  141. latitudesh_python_sdk/models/update_api_keyop.py +41 -0
  142. latitudesh_python_sdk/models/update_firewallop.py +89 -0
  143. latitudesh_python_sdk/models/update_plans_bandwidthop.py +50 -0
  144. latitudesh_python_sdk/models/update_projectop.py +95 -0
  145. latitudesh_python_sdk/models/update_server_deploy_configop.py +122 -0
  146. latitudesh_python_sdk/models/update_serverop.py +69 -0
  147. latitudesh_python_sdk/models/update_tagop.py +74 -0
  148. latitudesh_python_sdk/models/update_virtual_networkop.py +67 -0
  149. latitudesh_python_sdk/models/user.py +59 -0
  150. latitudesh_python_sdk/models/user_data.py +15 -0
  151. latitudesh_python_sdk/models/user_data_properties.py +46 -0
  152. latitudesh_python_sdk/models/user_include.py +52 -0
  153. latitudesh_python_sdk/models/user_team.py +61 -0
  154. latitudesh_python_sdk/models/user_teams.py +26 -0
  155. latitudesh_python_sdk/models/user_update.py +37 -0
  156. latitudesh_python_sdk/models/virtual_machine.py +25 -0
  157. latitudesh_python_sdk/models/virtual_machine_payload.py +41 -0
  158. latitudesh_python_sdk/models/virtual_machine_plans.py +180 -0
  159. latitudesh_python_sdk/models/virtual_network.py +103 -0
  160. latitudesh_python_sdk/models/virtual_network1.py +84 -0
  161. latitudesh_python_sdk/models/virtual_network_assignment.py +37 -0
  162. latitudesh_python_sdk/models/virtual_network_assignments.py +29 -0
  163. latitudesh_python_sdk/models/virtual_networks.py +26 -0
  164. latitudesh_python_sdk/models/vpn_session_data_with_password.py +77 -0
  165. latitudesh_python_sdk/models/vpn_session_with_password.py +18 -0
  166. latitudesh_python_sdk/operatingsystems_sdk.py +188 -0
  167. latitudesh_python_sdk/plans.py +1178 -0
  168. latitudesh_python_sdk/privatenetworks.py +1672 -0
  169. latitudesh_python_sdk/projects_sdk.py +864 -0
  170. latitudesh_python_sdk/py.typed +1 -0
  171. latitudesh_python_sdk/regions_sdk.py +376 -0
  172. latitudesh_python_sdk/roles.py +374 -0
  173. latitudesh_python_sdk/sdk.py +214 -0
  174. latitudesh_python_sdk/sdkconfiguration.py +57 -0
  175. latitudesh_python_sdk/servers_sdk.py +3810 -0
  176. latitudesh_python_sdk/sshkeys.py +1050 -0
  177. latitudesh_python_sdk/storage.py +820 -0
  178. latitudesh_python_sdk/tags.py +786 -0
  179. latitudesh_python_sdk/teams_sdk.py +596 -0
  180. latitudesh_python_sdk/teamsmembers.py +578 -0
  181. latitudesh_python_sdk/traffic_sdk.py +400 -0
  182. latitudesh_python_sdk/types/__init__.py +21 -0
  183. latitudesh_python_sdk/types/basemodel.py +39 -0
  184. latitudesh_python_sdk/userdata_sdk.py +1052 -0
  185. latitudesh_python_sdk/userprofile.py +596 -0
  186. latitudesh_python_sdk/utils/__init__.py +101 -0
  187. latitudesh_python_sdk/utils/annotations.py +55 -0
  188. latitudesh_python_sdk/utils/enums.py +34 -0
  189. latitudesh_python_sdk/utils/eventstreaming.py +238 -0
  190. latitudesh_python_sdk/utils/forms.py +202 -0
  191. latitudesh_python_sdk/utils/headers.py +136 -0
  192. latitudesh_python_sdk/utils/logger.py +27 -0
  193. latitudesh_python_sdk/utils/metadata.py +118 -0
  194. latitudesh_python_sdk/utils/queryparams.py +205 -0
  195. latitudesh_python_sdk/utils/requestbodies.py +66 -0
  196. latitudesh_python_sdk/utils/retries.py +217 -0
  197. latitudesh_python_sdk/utils/security.py +192 -0
  198. latitudesh_python_sdk/utils/serializers.py +219 -0
  199. latitudesh_python_sdk/utils/url.py +155 -0
  200. latitudesh_python_sdk/utils/values.py +137 -0
  201. latitudesh_python_sdk/virtualmachines.py +772 -0
  202. latitudesh_python_sdk/vpnsessions.py +818 -0
  203. latitudesh_python_sdk-0.0.6.dist-info/LICENSE +21 -0
  204. latitudesh_python_sdk-0.0.6.dist-info/METADATA +730 -0
  205. latitudesh_python_sdk-0.0.6.dist-info/RECORD +206 -0
  206. latitudesh_python_sdk-0.0.6.dist-info/WHEEL +4 -0
@@ -0,0 +1,820 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from .basesdk import BaseSDK
4
+ from latitudesh_python_sdk import models, utils
5
+ from latitudesh_python_sdk._hooks import HookContext
6
+ from latitudesh_python_sdk.types import OptionalNullable, UNSET
7
+ from latitudesh_python_sdk.utils import get_security_from_env
8
+ from typing import Mapping, Optional, Union
9
+
10
+
11
+ class Storage(BaseSDK):
12
+ def create_filesystem(
13
+ self,
14
+ *,
15
+ data: Union[
16
+ models.PostStorageFilesystemsStorageData,
17
+ models.PostStorageFilesystemsStorageDataTypedDict,
18
+ ],
19
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
20
+ server_url: Optional[str] = None,
21
+ timeout_ms: Optional[int] = None,
22
+ http_headers: Optional[Mapping[str, str]] = None,
23
+ ) -> models.PostStorageFilesystemsResponseBody:
24
+ r"""Create a filesystem for a project
25
+
26
+ Allows you to add persistent storage to a project. These filesystems can be used to store data across your servers.
27
+
28
+ :param data:
29
+ :param retries: Override the default retry configuration for this method
30
+ :param server_url: Override the default server URL for this method
31
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
32
+ :param http_headers: Additional headers to set or replace on requests.
33
+ """
34
+ base_url = None
35
+ url_variables = None
36
+ if timeout_ms is None:
37
+ timeout_ms = self.sdk_configuration.timeout_ms
38
+
39
+ if server_url is not None:
40
+ base_url = server_url
41
+ else:
42
+ base_url = self._get_url(base_url, url_variables)
43
+
44
+ request = models.PostStorageFilesystemsStorageRequestBody(
45
+ data=utils.get_pydantic_model(
46
+ data, models.PostStorageFilesystemsStorageData
47
+ ),
48
+ )
49
+
50
+ req = self._build_request(
51
+ method="POST",
52
+ path="/storage/filesystems",
53
+ base_url=base_url,
54
+ url_variables=url_variables,
55
+ request=request,
56
+ request_body_required=True,
57
+ request_has_path_params=False,
58
+ request_has_query_params=True,
59
+ user_agent_header="user-agent",
60
+ accept_header_value="application/vnd.api+json",
61
+ http_headers=http_headers,
62
+ security=self.sdk_configuration.security,
63
+ get_serialized_body=lambda: utils.serialize_request_body(
64
+ request,
65
+ False,
66
+ False,
67
+ "json",
68
+ models.PostStorageFilesystemsStorageRequestBody,
69
+ ),
70
+ timeout_ms=timeout_ms,
71
+ )
72
+
73
+ if retries == UNSET:
74
+ if self.sdk_configuration.retry_config is not UNSET:
75
+ retries = self.sdk_configuration.retry_config
76
+
77
+ retry_config = None
78
+ if isinstance(retries, utils.RetryConfig):
79
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
80
+
81
+ http_res = self.do_request(
82
+ hook_ctx=HookContext(
83
+ base_url=base_url or "",
84
+ operation_id="post-storage-filesystems",
85
+ oauth2_scopes=[],
86
+ security_source=get_security_from_env(
87
+ self.sdk_configuration.security, models.Security
88
+ ),
89
+ ),
90
+ request=req,
91
+ error_status_codes=["403", "409", "422", "4XX", "5XX"],
92
+ retry_config=retry_config,
93
+ )
94
+
95
+ if utils.match_response(http_res, "201", "application/vnd.api+json"):
96
+ return utils.unmarshal_json(
97
+ http_res.text, models.PostStorageFilesystemsResponseBody
98
+ )
99
+ if utils.match_response(http_res, ["403", "409", "422", "4XX"], "*"):
100
+ http_res_text = utils.stream_to_text(http_res)
101
+ raise models.APIError(
102
+ "API error occurred", http_res.status_code, http_res_text, http_res
103
+ )
104
+ if utils.match_response(http_res, "5XX", "*"):
105
+ http_res_text = utils.stream_to_text(http_res)
106
+ raise models.APIError(
107
+ "API error occurred", http_res.status_code, http_res_text, http_res
108
+ )
109
+
110
+ content_type = http_res.headers.get("Content-Type")
111
+ http_res_text = utils.stream_to_text(http_res)
112
+ raise models.APIError(
113
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
114
+ http_res.status_code,
115
+ http_res_text,
116
+ http_res,
117
+ )
118
+
119
+ async def create_filesystem_async(
120
+ self,
121
+ *,
122
+ data: Union[
123
+ models.PostStorageFilesystemsStorageData,
124
+ models.PostStorageFilesystemsStorageDataTypedDict,
125
+ ],
126
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
127
+ server_url: Optional[str] = None,
128
+ timeout_ms: Optional[int] = None,
129
+ http_headers: Optional[Mapping[str, str]] = None,
130
+ ) -> models.PostStorageFilesystemsResponseBody:
131
+ r"""Create a filesystem for a project
132
+
133
+ Allows you to add persistent storage to a project. These filesystems can be used to store data across your servers.
134
+
135
+ :param data:
136
+ :param retries: Override the default retry configuration for this method
137
+ :param server_url: Override the default server URL for this method
138
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
139
+ :param http_headers: Additional headers to set or replace on requests.
140
+ """
141
+ base_url = None
142
+ url_variables = None
143
+ if timeout_ms is None:
144
+ timeout_ms = self.sdk_configuration.timeout_ms
145
+
146
+ if server_url is not None:
147
+ base_url = server_url
148
+ else:
149
+ base_url = self._get_url(base_url, url_variables)
150
+
151
+ request = models.PostStorageFilesystemsStorageRequestBody(
152
+ data=utils.get_pydantic_model(
153
+ data, models.PostStorageFilesystemsStorageData
154
+ ),
155
+ )
156
+
157
+ req = self._build_request_async(
158
+ method="POST",
159
+ path="/storage/filesystems",
160
+ base_url=base_url,
161
+ url_variables=url_variables,
162
+ request=request,
163
+ request_body_required=True,
164
+ request_has_path_params=False,
165
+ request_has_query_params=True,
166
+ user_agent_header="user-agent",
167
+ accept_header_value="application/vnd.api+json",
168
+ http_headers=http_headers,
169
+ security=self.sdk_configuration.security,
170
+ get_serialized_body=lambda: utils.serialize_request_body(
171
+ request,
172
+ False,
173
+ False,
174
+ "json",
175
+ models.PostStorageFilesystemsStorageRequestBody,
176
+ ),
177
+ timeout_ms=timeout_ms,
178
+ )
179
+
180
+ if retries == UNSET:
181
+ if self.sdk_configuration.retry_config is not UNSET:
182
+ retries = self.sdk_configuration.retry_config
183
+
184
+ retry_config = None
185
+ if isinstance(retries, utils.RetryConfig):
186
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
187
+
188
+ http_res = await self.do_request_async(
189
+ hook_ctx=HookContext(
190
+ base_url=base_url or "",
191
+ operation_id="post-storage-filesystems",
192
+ oauth2_scopes=[],
193
+ security_source=get_security_from_env(
194
+ self.sdk_configuration.security, models.Security
195
+ ),
196
+ ),
197
+ request=req,
198
+ error_status_codes=["403", "409", "422", "4XX", "5XX"],
199
+ retry_config=retry_config,
200
+ )
201
+
202
+ if utils.match_response(http_res, "201", "application/vnd.api+json"):
203
+ return utils.unmarshal_json(
204
+ http_res.text, models.PostStorageFilesystemsResponseBody
205
+ )
206
+ if utils.match_response(http_res, ["403", "409", "422", "4XX"], "*"):
207
+ http_res_text = await utils.stream_to_text_async(http_res)
208
+ raise models.APIError(
209
+ "API error occurred", http_res.status_code, http_res_text, http_res
210
+ )
211
+ if utils.match_response(http_res, "5XX", "*"):
212
+ http_res_text = await utils.stream_to_text_async(http_res)
213
+ raise models.APIError(
214
+ "API error occurred", http_res.status_code, http_res_text, http_res
215
+ )
216
+
217
+ content_type = http_res.headers.get("Content-Type")
218
+ http_res_text = await utils.stream_to_text_async(http_res)
219
+ raise models.APIError(
220
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
221
+ http_res.status_code,
222
+ http_res_text,
223
+ http_res,
224
+ )
225
+
226
+ def list_filesystems(
227
+ self,
228
+ *,
229
+ filter_project: Optional[str] = None,
230
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
231
+ server_url: Optional[str] = None,
232
+ timeout_ms: Optional[int] = None,
233
+ http_headers: Optional[Mapping[str, str]] = None,
234
+ ):
235
+ r"""List filesystems
236
+
237
+ Lists all the filesystems from a team.
238
+
239
+ :param filter_project: The project ID or Slug to filter by
240
+ :param retries: Override the default retry configuration for this method
241
+ :param server_url: Override the default server URL for this method
242
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
243
+ :param http_headers: Additional headers to set or replace on requests.
244
+ """
245
+ base_url = None
246
+ url_variables = None
247
+ if timeout_ms is None:
248
+ timeout_ms = self.sdk_configuration.timeout_ms
249
+
250
+ if server_url is not None:
251
+ base_url = server_url
252
+ else:
253
+ base_url = self._get_url(base_url, url_variables)
254
+
255
+ request = models.GetStorageFilesystemsRequest(
256
+ filter_project=filter_project,
257
+ )
258
+
259
+ req = self._build_request(
260
+ method="GET",
261
+ path="/storage/filesystems",
262
+ base_url=base_url,
263
+ url_variables=url_variables,
264
+ request=request,
265
+ request_body_required=False,
266
+ request_has_path_params=False,
267
+ request_has_query_params=True,
268
+ user_agent_header="user-agent",
269
+ accept_header_value="*/*",
270
+ http_headers=http_headers,
271
+ security=self.sdk_configuration.security,
272
+ timeout_ms=timeout_ms,
273
+ )
274
+
275
+ if retries == UNSET:
276
+ if self.sdk_configuration.retry_config is not UNSET:
277
+ retries = self.sdk_configuration.retry_config
278
+
279
+ retry_config = None
280
+ if isinstance(retries, utils.RetryConfig):
281
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
282
+
283
+ http_res = self.do_request(
284
+ hook_ctx=HookContext(
285
+ base_url=base_url or "",
286
+ operation_id="get-storage-filesystems",
287
+ oauth2_scopes=[],
288
+ security_source=get_security_from_env(
289
+ self.sdk_configuration.security, models.Security
290
+ ),
291
+ ),
292
+ request=req,
293
+ error_status_codes=["4XX", "5XX"],
294
+ retry_config=retry_config,
295
+ )
296
+
297
+ if utils.match_response(http_res, "200", "*"):
298
+ return
299
+ if utils.match_response(http_res, "4XX", "*"):
300
+ http_res_text = utils.stream_to_text(http_res)
301
+ raise models.APIError(
302
+ "API error occurred", http_res.status_code, http_res_text, http_res
303
+ )
304
+ if utils.match_response(http_res, "5XX", "*"):
305
+ http_res_text = utils.stream_to_text(http_res)
306
+ raise models.APIError(
307
+ "API error occurred", http_res.status_code, http_res_text, http_res
308
+ )
309
+
310
+ content_type = http_res.headers.get("Content-Type")
311
+ http_res_text = utils.stream_to_text(http_res)
312
+ raise models.APIError(
313
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
314
+ http_res.status_code,
315
+ http_res_text,
316
+ http_res,
317
+ )
318
+
319
+ async def list_filesystems_async(
320
+ self,
321
+ *,
322
+ filter_project: Optional[str] = None,
323
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
324
+ server_url: Optional[str] = None,
325
+ timeout_ms: Optional[int] = None,
326
+ http_headers: Optional[Mapping[str, str]] = None,
327
+ ):
328
+ r"""List filesystems
329
+
330
+ Lists all the filesystems from a team.
331
+
332
+ :param filter_project: The project ID or Slug to filter by
333
+ :param retries: Override the default retry configuration for this method
334
+ :param server_url: Override the default server URL for this method
335
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
336
+ :param http_headers: Additional headers to set or replace on requests.
337
+ """
338
+ base_url = None
339
+ url_variables = None
340
+ if timeout_ms is None:
341
+ timeout_ms = self.sdk_configuration.timeout_ms
342
+
343
+ if server_url is not None:
344
+ base_url = server_url
345
+ else:
346
+ base_url = self._get_url(base_url, url_variables)
347
+
348
+ request = models.GetStorageFilesystemsRequest(
349
+ filter_project=filter_project,
350
+ )
351
+
352
+ req = self._build_request_async(
353
+ method="GET",
354
+ path="/storage/filesystems",
355
+ base_url=base_url,
356
+ url_variables=url_variables,
357
+ request=request,
358
+ request_body_required=False,
359
+ request_has_path_params=False,
360
+ request_has_query_params=True,
361
+ user_agent_header="user-agent",
362
+ accept_header_value="*/*",
363
+ http_headers=http_headers,
364
+ security=self.sdk_configuration.security,
365
+ timeout_ms=timeout_ms,
366
+ )
367
+
368
+ if retries == UNSET:
369
+ if self.sdk_configuration.retry_config is not UNSET:
370
+ retries = self.sdk_configuration.retry_config
371
+
372
+ retry_config = None
373
+ if isinstance(retries, utils.RetryConfig):
374
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
375
+
376
+ http_res = await self.do_request_async(
377
+ hook_ctx=HookContext(
378
+ base_url=base_url or "",
379
+ operation_id="get-storage-filesystems",
380
+ oauth2_scopes=[],
381
+ security_source=get_security_from_env(
382
+ self.sdk_configuration.security, models.Security
383
+ ),
384
+ ),
385
+ request=req,
386
+ error_status_codes=["4XX", "5XX"],
387
+ retry_config=retry_config,
388
+ )
389
+
390
+ if utils.match_response(http_res, "200", "*"):
391
+ return
392
+ if utils.match_response(http_res, "4XX", "*"):
393
+ http_res_text = await utils.stream_to_text_async(http_res)
394
+ raise models.APIError(
395
+ "API error occurred", http_res.status_code, http_res_text, http_res
396
+ )
397
+ if utils.match_response(http_res, "5XX", "*"):
398
+ http_res_text = await utils.stream_to_text_async(http_res)
399
+ raise models.APIError(
400
+ "API error occurred", http_res.status_code, http_res_text, http_res
401
+ )
402
+
403
+ content_type = http_res.headers.get("Content-Type")
404
+ http_res_text = await utils.stream_to_text_async(http_res)
405
+ raise models.APIError(
406
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
407
+ http_res.status_code,
408
+ http_res_text,
409
+ http_res,
410
+ )
411
+
412
+ def delete_filesystem(
413
+ self,
414
+ *,
415
+ filesystem_id: str,
416
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
417
+ server_url: Optional[str] = None,
418
+ timeout_ms: Optional[int] = None,
419
+ http_headers: Optional[Mapping[str, str]] = None,
420
+ ):
421
+ r"""Delete a filesystem for a project
422
+
423
+ Allows you to remove persistent storage from a project.
424
+
425
+ :param filesystem_id:
426
+ :param retries: Override the default retry configuration for this method
427
+ :param server_url: Override the default server URL for this method
428
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
429
+ :param http_headers: Additional headers to set or replace on requests.
430
+ """
431
+ base_url = None
432
+ url_variables = None
433
+ if timeout_ms is None:
434
+ timeout_ms = self.sdk_configuration.timeout_ms
435
+
436
+ if server_url is not None:
437
+ base_url = server_url
438
+ else:
439
+ base_url = self._get_url(base_url, url_variables)
440
+
441
+ request = models.DeleteStorageFilesystemsRequest(
442
+ filesystem_id=filesystem_id,
443
+ )
444
+
445
+ req = self._build_request(
446
+ method="DELETE",
447
+ path="/storage/filesystems/{filesystem_id}",
448
+ base_url=base_url,
449
+ url_variables=url_variables,
450
+ request=request,
451
+ request_body_required=False,
452
+ request_has_path_params=True,
453
+ request_has_query_params=True,
454
+ user_agent_header="user-agent",
455
+ accept_header_value="*/*",
456
+ http_headers=http_headers,
457
+ security=self.sdk_configuration.security,
458
+ timeout_ms=timeout_ms,
459
+ )
460
+
461
+ if retries == UNSET:
462
+ if self.sdk_configuration.retry_config is not UNSET:
463
+ retries = self.sdk_configuration.retry_config
464
+
465
+ retry_config = None
466
+ if isinstance(retries, utils.RetryConfig):
467
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
468
+
469
+ http_res = self.do_request(
470
+ hook_ctx=HookContext(
471
+ base_url=base_url or "",
472
+ operation_id="delete-storage-filesystems",
473
+ oauth2_scopes=[],
474
+ security_source=get_security_from_env(
475
+ self.sdk_configuration.security, models.Security
476
+ ),
477
+ ),
478
+ request=req,
479
+ error_status_codes=["403", "404", "4XX", "5XX"],
480
+ retry_config=retry_config,
481
+ )
482
+
483
+ if utils.match_response(http_res, "204", "*"):
484
+ return
485
+ if utils.match_response(http_res, ["403", "404", "4XX"], "*"):
486
+ http_res_text = utils.stream_to_text(http_res)
487
+ raise models.APIError(
488
+ "API error occurred", http_res.status_code, http_res_text, http_res
489
+ )
490
+ if utils.match_response(http_res, "5XX", "*"):
491
+ http_res_text = utils.stream_to_text(http_res)
492
+ raise models.APIError(
493
+ "API error occurred", http_res.status_code, http_res_text, http_res
494
+ )
495
+
496
+ content_type = http_res.headers.get("Content-Type")
497
+ http_res_text = utils.stream_to_text(http_res)
498
+ raise models.APIError(
499
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
500
+ http_res.status_code,
501
+ http_res_text,
502
+ http_res,
503
+ )
504
+
505
+ async def delete_filesystem_async(
506
+ self,
507
+ *,
508
+ filesystem_id: str,
509
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
510
+ server_url: Optional[str] = None,
511
+ timeout_ms: Optional[int] = None,
512
+ http_headers: Optional[Mapping[str, str]] = None,
513
+ ):
514
+ r"""Delete a filesystem for a project
515
+
516
+ Allows you to remove persistent storage from a project.
517
+
518
+ :param filesystem_id:
519
+ :param retries: Override the default retry configuration for this method
520
+ :param server_url: Override the default server URL for this method
521
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
522
+ :param http_headers: Additional headers to set or replace on requests.
523
+ """
524
+ base_url = None
525
+ url_variables = None
526
+ if timeout_ms is None:
527
+ timeout_ms = self.sdk_configuration.timeout_ms
528
+
529
+ if server_url is not None:
530
+ base_url = server_url
531
+ else:
532
+ base_url = self._get_url(base_url, url_variables)
533
+
534
+ request = models.DeleteStorageFilesystemsRequest(
535
+ filesystem_id=filesystem_id,
536
+ )
537
+
538
+ req = self._build_request_async(
539
+ method="DELETE",
540
+ path="/storage/filesystems/{filesystem_id}",
541
+ base_url=base_url,
542
+ url_variables=url_variables,
543
+ request=request,
544
+ request_body_required=False,
545
+ request_has_path_params=True,
546
+ request_has_query_params=True,
547
+ user_agent_header="user-agent",
548
+ accept_header_value="*/*",
549
+ http_headers=http_headers,
550
+ security=self.sdk_configuration.security,
551
+ timeout_ms=timeout_ms,
552
+ )
553
+
554
+ if retries == UNSET:
555
+ if self.sdk_configuration.retry_config is not UNSET:
556
+ retries = self.sdk_configuration.retry_config
557
+
558
+ retry_config = None
559
+ if isinstance(retries, utils.RetryConfig):
560
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
561
+
562
+ http_res = await self.do_request_async(
563
+ hook_ctx=HookContext(
564
+ base_url=base_url or "",
565
+ operation_id="delete-storage-filesystems",
566
+ oauth2_scopes=[],
567
+ security_source=get_security_from_env(
568
+ self.sdk_configuration.security, models.Security
569
+ ),
570
+ ),
571
+ request=req,
572
+ error_status_codes=["403", "404", "4XX", "5XX"],
573
+ retry_config=retry_config,
574
+ )
575
+
576
+ if utils.match_response(http_res, "204", "*"):
577
+ return
578
+ if utils.match_response(http_res, ["403", "404", "4XX"], "*"):
579
+ http_res_text = await utils.stream_to_text_async(http_res)
580
+ raise models.APIError(
581
+ "API error occurred", http_res.status_code, http_res_text, http_res
582
+ )
583
+ if utils.match_response(http_res, "5XX", "*"):
584
+ http_res_text = await utils.stream_to_text_async(http_res)
585
+ raise models.APIError(
586
+ "API error occurred", http_res.status_code, http_res_text, http_res
587
+ )
588
+
589
+ content_type = http_res.headers.get("Content-Type")
590
+ http_res_text = await utils.stream_to_text_async(http_res)
591
+ raise models.APIError(
592
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
593
+ http_res.status_code,
594
+ http_res_text,
595
+ http_res,
596
+ )
597
+
598
+ def update_filesystem(
599
+ self,
600
+ *,
601
+ filesystem_id: str,
602
+ data: Union[
603
+ models.PatchStorageFilesystemsStorageData,
604
+ models.PatchStorageFilesystemsStorageDataTypedDict,
605
+ ],
606
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
607
+ server_url: Optional[str] = None,
608
+ timeout_ms: Optional[int] = None,
609
+ http_headers: Optional[Mapping[str, str]] = None,
610
+ ) -> models.PatchStorageFilesystemsResponseBody:
611
+ r"""Update a filesystem for a project
612
+
613
+ Allow you to upgrade the size of a filesystem.
614
+
615
+ :param filesystem_id:
616
+ :param data:
617
+ :param retries: Override the default retry configuration for this method
618
+ :param server_url: Override the default server URL for this method
619
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
620
+ :param http_headers: Additional headers to set or replace on requests.
621
+ """
622
+ base_url = None
623
+ url_variables = None
624
+ if timeout_ms is None:
625
+ timeout_ms = self.sdk_configuration.timeout_ms
626
+
627
+ if server_url is not None:
628
+ base_url = server_url
629
+ else:
630
+ base_url = self._get_url(base_url, url_variables)
631
+
632
+ request = models.PatchStorageFilesystemsRequest(
633
+ filesystem_id=filesystem_id,
634
+ request_body=models.PatchStorageFilesystemsStorageRequestBody(
635
+ data=utils.get_pydantic_model(
636
+ data, models.PatchStorageFilesystemsStorageData
637
+ ),
638
+ ),
639
+ )
640
+
641
+ req = self._build_request(
642
+ method="PATCH",
643
+ path="/storage/filesystems/{filesystem_id}",
644
+ base_url=base_url,
645
+ url_variables=url_variables,
646
+ request=request,
647
+ request_body_required=True,
648
+ request_has_path_params=True,
649
+ request_has_query_params=True,
650
+ user_agent_header="user-agent",
651
+ accept_header_value="application/vnd.api+json",
652
+ http_headers=http_headers,
653
+ security=self.sdk_configuration.security,
654
+ get_serialized_body=lambda: utils.serialize_request_body(
655
+ request.request_body,
656
+ False,
657
+ False,
658
+ "json",
659
+ models.PatchStorageFilesystemsStorageRequestBody,
660
+ ),
661
+ timeout_ms=timeout_ms,
662
+ )
663
+
664
+ if retries == UNSET:
665
+ if self.sdk_configuration.retry_config is not UNSET:
666
+ retries = self.sdk_configuration.retry_config
667
+
668
+ retry_config = None
669
+ if isinstance(retries, utils.RetryConfig):
670
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
671
+
672
+ http_res = self.do_request(
673
+ hook_ctx=HookContext(
674
+ base_url=base_url or "",
675
+ operation_id="patch-storage-filesystems",
676
+ oauth2_scopes=[],
677
+ security_source=get_security_from_env(
678
+ self.sdk_configuration.security, models.Security
679
+ ),
680
+ ),
681
+ request=req,
682
+ error_status_codes=["403", "422", "4XX", "5XX"],
683
+ retry_config=retry_config,
684
+ )
685
+
686
+ if utils.match_response(http_res, "200", "application/vnd.api+json"):
687
+ return utils.unmarshal_json(
688
+ http_res.text, models.PatchStorageFilesystemsResponseBody
689
+ )
690
+ if utils.match_response(http_res, ["403", "422", "4XX"], "*"):
691
+ http_res_text = utils.stream_to_text(http_res)
692
+ raise models.APIError(
693
+ "API error occurred", http_res.status_code, http_res_text, http_res
694
+ )
695
+ if utils.match_response(http_res, "5XX", "*"):
696
+ http_res_text = utils.stream_to_text(http_res)
697
+ raise models.APIError(
698
+ "API error occurred", http_res.status_code, http_res_text, http_res
699
+ )
700
+
701
+ content_type = http_res.headers.get("Content-Type")
702
+ http_res_text = utils.stream_to_text(http_res)
703
+ raise models.APIError(
704
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
705
+ http_res.status_code,
706
+ http_res_text,
707
+ http_res,
708
+ )
709
+
710
+ async def update_filesystem_async(
711
+ self,
712
+ *,
713
+ filesystem_id: str,
714
+ data: Union[
715
+ models.PatchStorageFilesystemsStorageData,
716
+ models.PatchStorageFilesystemsStorageDataTypedDict,
717
+ ],
718
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
719
+ server_url: Optional[str] = None,
720
+ timeout_ms: Optional[int] = None,
721
+ http_headers: Optional[Mapping[str, str]] = None,
722
+ ) -> models.PatchStorageFilesystemsResponseBody:
723
+ r"""Update a filesystem for a project
724
+
725
+ Allow you to upgrade the size of a filesystem.
726
+
727
+ :param filesystem_id:
728
+ :param data:
729
+ :param retries: Override the default retry configuration for this method
730
+ :param server_url: Override the default server URL for this method
731
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
732
+ :param http_headers: Additional headers to set or replace on requests.
733
+ """
734
+ base_url = None
735
+ url_variables = None
736
+ if timeout_ms is None:
737
+ timeout_ms = self.sdk_configuration.timeout_ms
738
+
739
+ if server_url is not None:
740
+ base_url = server_url
741
+ else:
742
+ base_url = self._get_url(base_url, url_variables)
743
+
744
+ request = models.PatchStorageFilesystemsRequest(
745
+ filesystem_id=filesystem_id,
746
+ request_body=models.PatchStorageFilesystemsStorageRequestBody(
747
+ data=utils.get_pydantic_model(
748
+ data, models.PatchStorageFilesystemsStorageData
749
+ ),
750
+ ),
751
+ )
752
+
753
+ req = self._build_request_async(
754
+ method="PATCH",
755
+ path="/storage/filesystems/{filesystem_id}",
756
+ base_url=base_url,
757
+ url_variables=url_variables,
758
+ request=request,
759
+ request_body_required=True,
760
+ request_has_path_params=True,
761
+ request_has_query_params=True,
762
+ user_agent_header="user-agent",
763
+ accept_header_value="application/vnd.api+json",
764
+ http_headers=http_headers,
765
+ security=self.sdk_configuration.security,
766
+ get_serialized_body=lambda: utils.serialize_request_body(
767
+ request.request_body,
768
+ False,
769
+ False,
770
+ "json",
771
+ models.PatchStorageFilesystemsStorageRequestBody,
772
+ ),
773
+ timeout_ms=timeout_ms,
774
+ )
775
+
776
+ if retries == UNSET:
777
+ if self.sdk_configuration.retry_config is not UNSET:
778
+ retries = self.sdk_configuration.retry_config
779
+
780
+ retry_config = None
781
+ if isinstance(retries, utils.RetryConfig):
782
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
783
+
784
+ http_res = await self.do_request_async(
785
+ hook_ctx=HookContext(
786
+ base_url=base_url or "",
787
+ operation_id="patch-storage-filesystems",
788
+ oauth2_scopes=[],
789
+ security_source=get_security_from_env(
790
+ self.sdk_configuration.security, models.Security
791
+ ),
792
+ ),
793
+ request=req,
794
+ error_status_codes=["403", "422", "4XX", "5XX"],
795
+ retry_config=retry_config,
796
+ )
797
+
798
+ if utils.match_response(http_res, "200", "application/vnd.api+json"):
799
+ return utils.unmarshal_json(
800
+ http_res.text, models.PatchStorageFilesystemsResponseBody
801
+ )
802
+ if utils.match_response(http_res, ["403", "422", "4XX"], "*"):
803
+ http_res_text = await utils.stream_to_text_async(http_res)
804
+ raise models.APIError(
805
+ "API error occurred", http_res.status_code, http_res_text, http_res
806
+ )
807
+ if utils.match_response(http_res, "5XX", "*"):
808
+ http_res_text = await utils.stream_to_text_async(http_res)
809
+ raise models.APIError(
810
+ "API error occurred", http_res.status_code, http_res_text, http_res
811
+ )
812
+
813
+ content_type = http_res.headers.get("Content-Type")
814
+ http_res_text = await utils.stream_to_text_async(http_res)
815
+ raise models.APIError(
816
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
817
+ http_res.status_code,
818
+ http_res_text,
819
+ http_res,
820
+ )