gcore 0.10.0__py3-none-any.whl → 0.12.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 gcore might be problematic. Click here for more details.

Files changed (320) hide show
  1. gcore/_base_client.py +3 -3
  2. gcore/_client.py +18 -0
  3. gcore/_compat.py +48 -48
  4. gcore/_models.py +41 -41
  5. gcore/_types.py +35 -1
  6. gcore/_utils/__init__.py +9 -2
  7. gcore/_utils/_compat.py +45 -0
  8. gcore/_utils/_datetime_parse.py +136 -0
  9. gcore/_utils/_transform.py +11 -1
  10. gcore/_utils/_typing.py +6 -1
  11. gcore/_utils/_utils.py +0 -1
  12. gcore/_version.py +1 -1
  13. gcore/resources/__init__.py +28 -0
  14. gcore/resources/cloud/__init__.py +14 -0
  15. gcore/resources/cloud/audit_logs.py +3 -3
  16. gcore/resources/cloud/baremetal/images.py +3 -4
  17. gcore/resources/cloud/baremetal/servers.py +16 -4
  18. gcore/resources/cloud/cloud.py +32 -0
  19. gcore/resources/cloud/cost_reports.py +24 -16
  20. gcore/resources/cloud/file_shares/access_rules.py +2 -2
  21. gcore/resources/cloud/file_shares/file_shares.py +30 -14
  22. gcore/resources/cloud/floating_ips.py +196 -4
  23. gcore/resources/cloud/gpu_baremetal_clusters/flavors.py +1 -1
  24. gcore/resources/cloud/gpu_baremetal_clusters/gpu_baremetal_clusters.py +166 -190
  25. gcore/resources/cloud/gpu_baremetal_clusters/servers.py +268 -12
  26. gcore/resources/cloud/inference/__init__.py +14 -14
  27. gcore/resources/cloud/inference/applications/__init__.py +47 -0
  28. gcore/resources/cloud/inference/applications/applications.py +134 -0
  29. gcore/resources/cloud/inference/applications/deployments.py +649 -0
  30. gcore/resources/cloud/inference/applications/templates.py +238 -0
  31. gcore/resources/cloud/inference/deployments/deployments.py +41 -22
  32. gcore/resources/cloud/inference/inference.py +32 -32
  33. gcore/resources/cloud/inference/registry_credentials.py +8 -9
  34. gcore/resources/cloud/instances/images.py +4 -4
  35. gcore/resources/cloud/instances/instances.py +254 -4
  36. gcore/resources/cloud/instances/interfaces.py +544 -0
  37. gcore/resources/cloud/k8s/__init__.py +47 -0
  38. gcore/resources/cloud/k8s/clusters/__init__.py +47 -0
  39. gcore/resources/cloud/k8s/clusters/clusters.py +1391 -0
  40. gcore/resources/cloud/k8s/clusters/nodes.py +291 -0
  41. gcore/resources/cloud/k8s/clusters/pools/__init__.py +33 -0
  42. gcore/resources/cloud/k8s/clusters/pools/nodes.py +303 -0
  43. gcore/resources/cloud/k8s/clusters/pools/pools.py +870 -0
  44. gcore/resources/cloud/k8s/flavors.py +209 -0
  45. gcore/resources/cloud/k8s/k8s.py +233 -0
  46. gcore/resources/cloud/load_balancers/l7_policies/l7_policies.py +11 -12
  47. gcore/resources/cloud/load_balancers/l7_policies/rules.py +9 -10
  48. gcore/resources/cloud/load_balancers/listeners.py +18 -18
  49. gcore/resources/cloud/load_balancers/load_balancers.py +4 -4
  50. gcore/resources/cloud/load_balancers/pools/health_monitors.py +18 -6
  51. gcore/resources/cloud/load_balancers/pools/members.py +32 -2
  52. gcore/resources/cloud/load_balancers/pools/pools.py +32 -8
  53. gcore/resources/cloud/networks/networks.py +192 -4
  54. gcore/resources/cloud/networks/subnets.py +140 -8
  55. gcore/resources/cloud/reserved_fixed_ips/reserved_fixed_ips.py +608 -0
  56. gcore/resources/cloud/reserved_fixed_ips/vip.py +5 -7
  57. gcore/resources/cloud/security_groups/security_groups.py +6 -6
  58. gcore/resources/cloud/tasks.py +46 -46
  59. gcore/resources/cloud/users/role_assignments.py +5 -4
  60. gcore/resources/cloud/volumes.py +1125 -223
  61. gcore/resources/dns/__init__.py +75 -0
  62. gcore/resources/dns/dns.py +374 -0
  63. gcore/resources/dns/locations.py +288 -0
  64. gcore/resources/dns/metrics.py +214 -0
  65. gcore/resources/dns/pickers/__init__.py +33 -0
  66. gcore/resources/dns/pickers/pickers.py +167 -0
  67. gcore/resources/dns/pickers/presets.py +135 -0
  68. gcore/resources/dns/zones/__init__.py +47 -0
  69. gcore/resources/{cloud/inference/models.py → dns/zones/dnssec.py} +80 -122
  70. gcore/resources/dns/zones/rrsets.py +1005 -0
  71. gcore/resources/dns/zones/zones.py +1493 -0
  72. gcore/resources/storage/__init__.py +75 -0
  73. gcore/resources/storage/buckets/__init__.py +61 -0
  74. gcore/resources/storage/buckets/buckets.py +470 -0
  75. gcore/resources/storage/buckets/cors.py +265 -0
  76. gcore/resources/storage/buckets/lifecycle.py +276 -0
  77. gcore/resources/storage/buckets/policy.py +345 -0
  78. gcore/resources/storage/credentials.py +221 -0
  79. gcore/resources/storage/locations.py +190 -0
  80. gcore/resources/storage/statistics.py +364 -0
  81. gcore/resources/storage/storage.py +1046 -0
  82. gcore/resources/streaming/ai_tasks.py +56 -70
  83. gcore/resources/streaming/playlists.py +18 -18
  84. gcore/resources/streaming/quality_sets.py +8 -8
  85. gcore/resources/streaming/statistics.py +4 -122
  86. gcore/resources/streaming/streams/overlays.py +6 -6
  87. gcore/resources/streaming/streams/streams.py +40 -64
  88. gcore/resources/streaming/videos/subtitles.py +32 -30
  89. gcore/resources/streaming/videos/videos.py +78 -72
  90. gcore/resources/waap/domains/advanced_rules.py +2 -2
  91. gcore/resources/waap/domains/api_paths.py +13 -13
  92. gcore/resources/waap/domains/custom_rules.py +2 -2
  93. gcore/resources/waap/domains/domains.py +4 -4
  94. gcore/resources/waap/domains/firewall_rules.py +2 -2
  95. gcore/resources/waap/domains/insight_silences.py +6 -6
  96. gcore/resources/waap/domains/insights.py +7 -7
  97. gcore/resources/waap/domains/statistics.py +47 -47
  98. gcore/types/cloud/__init__.py +2 -4
  99. gcore/types/cloud/audit_log_list_params.py +2 -1
  100. gcore/types/cloud/baremetal/image_list_params.py +3 -2
  101. gcore/types/cloud/baremetal/server_create_params.py +8 -6
  102. gcore/types/cloud/baremetal/server_list_params.py +3 -2
  103. gcore/types/cloud/baremetal/server_rebuild_params.py +2 -0
  104. gcore/types/cloud/cost_report_get_aggregated_monthly_params.py +35 -31
  105. gcore/types/cloud/cost_report_get_aggregated_params.py +26 -25
  106. gcore/types/cloud/cost_report_get_detailed_params.py +26 -25
  107. gcore/types/cloud/ddos_profile.py +13 -7
  108. gcore/types/cloud/ddos_profile_field.py +21 -8
  109. gcore/types/cloud/ddos_profile_option_list.py +7 -6
  110. gcore/types/cloud/ddos_profile_status.py +2 -2
  111. gcore/types/cloud/ddos_profile_template.py +7 -3
  112. gcore/types/cloud/ddos_profile_template_field.py +12 -3
  113. gcore/types/cloud/file_share.py +2 -2
  114. gcore/types/cloud/file_share_create_params.py +12 -6
  115. gcore/types/cloud/floating_ip_list_params.py +3 -2
  116. gcore/types/cloud/gpu_baremetal_cluster.py +101 -74
  117. gcore/types/cloud/gpu_baremetal_cluster_create_params.py +76 -93
  118. gcore/types/cloud/gpu_baremetal_cluster_delete_params.py +17 -10
  119. gcore/types/cloud/gpu_baremetal_cluster_list_params.py +14 -3
  120. gcore/types/cloud/gpu_baremetal_cluster_rebuild_params.py +4 -2
  121. gcore/types/cloud/gpu_baremetal_clusters/__init__.py +6 -0
  122. gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server.py +74 -0
  123. gcore/types/cloud/{gpu_baremetal_cluster_server.py → gpu_baremetal_clusters/gpu_baremetal_cluster_server_v1.py} +10 -10
  124. gcore/types/cloud/gpu_baremetal_clusters/gpu_baremetal_cluster_server_v1_list.py +16 -0
  125. gcore/types/cloud/{gpu_baremetal_flavor.py → gpu_baremetal_clusters/gpu_baremetal_flavor.py} +1 -1
  126. gcore/types/cloud/{gpu_baremetal_flavor_list.py → gpu_baremetal_clusters/gpu_baremetal_flavor_list.py} +1 -1
  127. gcore/types/cloud/gpu_baremetal_clusters/server_list_params.py +75 -0
  128. gcore/types/cloud/inference/__init__.py +0 -5
  129. gcore/types/cloud/inference/applications/__init__.py +12 -0
  130. gcore/types/cloud/inference/applications/deployment_create_params.py +68 -0
  131. gcore/types/cloud/inference/applications/deployment_patch_params.py +62 -0
  132. gcore/types/cloud/inference/applications/inference_application_deployment.py +111 -0
  133. gcore/types/cloud/inference/applications/inference_application_deployment_list.py +16 -0
  134. gcore/types/cloud/inference/applications/inference_application_template.py +94 -0
  135. gcore/types/cloud/inference/applications/inference_application_template_list.py +16 -0
  136. gcore/types/cloud/inference/deployment_create_params.py +7 -6
  137. gcore/types/cloud/inference/deployment_update_params.py +7 -6
  138. gcore/types/cloud/instance_assign_security_group_params.py +4 -2
  139. gcore/types/cloud/instance_list_params.py +3 -2
  140. gcore/types/cloud/instance_unassign_security_group_params.py +4 -2
  141. gcore/types/cloud/instances/image_list_params.py +3 -2
  142. gcore/types/cloud/k8s/__init__.py +13 -0
  143. gcore/types/cloud/k8s/cluster_create_params.py +299 -0
  144. gcore/types/cloud/k8s/cluster_delete_params.py +16 -0
  145. gcore/types/cloud/k8s/cluster_update_params.py +203 -0
  146. gcore/types/cloud/k8s/cluster_upgrade_params.py +16 -0
  147. gcore/types/cloud/k8s/clusters/__init__.py +10 -0
  148. gcore/types/cloud/k8s/clusters/k8s_cluster_pool.py +66 -0
  149. gcore/types/cloud/k8s/clusters/k8s_cluster_pool_list.py +16 -0
  150. gcore/types/cloud/k8s/clusters/node_list_params.py +16 -0
  151. gcore/types/cloud/k8s/clusters/pool_create_params.py +53 -0
  152. gcore/types/cloud/k8s/clusters/pool_resize_params.py +18 -0
  153. gcore/types/cloud/k8s/clusters/pool_update_params.py +34 -0
  154. gcore/types/cloud/k8s/clusters/pools/__init__.py +5 -0
  155. gcore/types/cloud/k8s/clusters/pools/node_list_params.py +18 -0
  156. gcore/types/cloud/k8s/flavor_list_params.py +19 -0
  157. gcore/types/cloud/k8s/k8s_cluster.py +209 -0
  158. gcore/types/cloud/k8s/k8s_cluster_certificate.py +13 -0
  159. gcore/types/cloud/k8s/k8s_cluster_kubeconfig.py +19 -0
  160. gcore/types/cloud/k8s/k8s_cluster_list.py +16 -0
  161. gcore/types/cloud/k8s_cluster_version.py +10 -0
  162. gcore/types/cloud/{gpu_baremetal_cluster_server_list.py → k8s_cluster_version_list.py} +4 -4
  163. gcore/types/cloud/load_balancer_create_params.py +23 -4
  164. gcore/types/cloud/load_balancer_list_params.py +3 -2
  165. gcore/types/cloud/load_balancers/l7_policies/rule_create_params.py +3 -2
  166. gcore/types/cloud/load_balancers/l7_policies/rule_replace_params.py +3 -2
  167. gcore/types/cloud/load_balancers/l7_policy_create_params.py +3 -2
  168. gcore/types/cloud/load_balancers/l7_policy_replace_params.py +3 -2
  169. gcore/types/cloud/load_balancers/listener_create_params.py +4 -3
  170. gcore/types/cloud/load_balancers/listener_update_params.py +5 -3
  171. gcore/types/cloud/load_balancers/pool_create_params.py +19 -1
  172. gcore/types/cloud/load_balancers/pool_update_params.py +19 -1
  173. gcore/types/cloud/load_balancers/pools/member_add_params.py +19 -1
  174. gcore/types/cloud/member.py +19 -1
  175. gcore/types/cloud/network_list_params.py +3 -2
  176. gcore/types/cloud/networks/subnet_create_params.py +3 -2
  177. gcore/types/cloud/networks/subnet_list_params.py +3 -2
  178. gcore/types/cloud/networks/subnet_update_params.py +3 -2
  179. gcore/types/cloud/project.py +9 -9
  180. gcore/types/cloud/reserved_fixed_ips/vip_replace_connected_ports_params.py +3 -2
  181. gcore/types/cloud/reserved_fixed_ips/vip_update_connected_ports_params.py +3 -2
  182. gcore/types/cloud/security_group_create_params.py +4 -2
  183. gcore/types/cloud/security_group_list_params.py +3 -2
  184. gcore/types/cloud/task_id_list.py +8 -1
  185. gcore/types/cloud/task_list_params.py +23 -23
  186. gcore/types/cloud/usage_report_get_params.py +26 -25
  187. gcore/types/cloud/users/role_assignment.py +2 -1
  188. gcore/types/cloud/users/role_assignment_create_params.py +4 -2
  189. gcore/types/cloud/users/role_assignment_update_params.py +4 -2
  190. gcore/types/cloud/volume_list_params.py +3 -2
  191. gcore/types/dns/__init__.py +31 -0
  192. gcore/types/dns/dns_get_account_overview_response.py +21 -0
  193. gcore/types/dns/dns_label_name.py +13 -0
  194. gcore/types/dns/dns_location_translations.py +11 -0
  195. gcore/types/dns/dns_lookup_params.py +15 -0
  196. gcore/types/dns/dns_lookup_response.py +21 -0
  197. gcore/types/dns/dns_name_server.py +17 -0
  198. gcore/types/dns/location_list_continents_response.py +10 -0
  199. gcore/types/dns/location_list_countries_response.py +10 -0
  200. gcore/types/dns/location_list_regions_response.py +10 -0
  201. gcore/types/dns/location_list_response.py +16 -0
  202. gcore/types/dns/metric_list_params.py +24 -0
  203. gcore/types/dns/metric_list_response.py +7 -0
  204. gcore/types/dns/picker_list_response.py +10 -0
  205. gcore/types/dns/pickers/__init__.py +5 -0
  206. gcore/types/dns/pickers/preset_list_response.py +10 -0
  207. gcore/types/dns/zone_check_delegation_status_response.py +20 -0
  208. gcore/types/dns/zone_create_params.py +59 -0
  209. gcore/types/dns/zone_create_response.py +13 -0
  210. gcore/types/dns/zone_export_response.py +11 -0
  211. gcore/types/dns/zone_get_response.py +106 -0
  212. gcore/types/dns/zone_get_statistics_params.py +43 -0
  213. gcore/types/dns/zone_get_statistics_response.py +19 -0
  214. gcore/types/dns/zone_import_params.py +32 -0
  215. gcore/types/dns/zone_import_response.py +26 -0
  216. gcore/types/dns/zone_list_params.py +57 -0
  217. gcore/types/dns/zone_list_response.py +105 -0
  218. gcore/types/dns/zone_replace_params.py +61 -0
  219. gcore/types/dns/zones/__init__.py +15 -0
  220. gcore/types/dns/zones/dns_failover_log.py +19 -0
  221. gcore/types/dns/zones/dns_output_rrset.py +123 -0
  222. gcore/types/dns/zones/dnssec_get_response.py +38 -0
  223. gcore/types/dns/zones/dnssec_update_params.py +11 -0
  224. gcore/types/dns/zones/dnssec_update_response.py +38 -0
  225. gcore/types/dns/zones/rrset_create_params.py +82 -0
  226. gcore/types/dns/zones/rrset_get_failover_logs_params.py +21 -0
  227. gcore/types/dns/zones/rrset_get_failover_logs_response.py +15 -0
  228. gcore/types/dns/zones/rrset_list_params.py +21 -0
  229. gcore/types/dns/zones/rrset_list_response.py +14 -0
  230. gcore/types/dns/zones/rrset_replace_params.py +82 -0
  231. gcore/types/security/client_profile.py +1 -1
  232. gcore/types/security/profile_create_params.py +2 -2
  233. gcore/types/security/profile_recreate_params.py +2 -2
  234. gcore/types/security/profile_replace_params.py +2 -2
  235. gcore/types/storage/__init__.py +21 -0
  236. gcore/types/storage/bucket.py +15 -0
  237. gcore/types/storage/bucket_list_params.py +15 -0
  238. gcore/types/storage/buckets/__init__.py +9 -0
  239. gcore/types/storage/buckets/bucket_cors.py +18 -0
  240. gcore/types/storage/buckets/bucket_policy.py +7 -0
  241. gcore/types/storage/buckets/cor_create_params.py +17 -0
  242. gcore/types/storage/buckets/lifecycle_create_params.py +18 -0
  243. gcore/types/storage/buckets/policy_get_response.py +7 -0
  244. gcore/types/storage/credential_recreate_params.py +36 -0
  245. gcore/types/storage/location.py +24 -0
  246. gcore/types/storage/location_list_params.py +13 -0
  247. gcore/types/storage/statistic_get_usage_aggregated_params.py +24 -0
  248. gcore/types/storage/statistic_get_usage_series_params.py +38 -0
  249. gcore/types/storage/statistic_get_usage_series_response.py +12 -0
  250. gcore/types/storage/storage.py +101 -0
  251. gcore/types/storage/storage_create_params.py +44 -0
  252. gcore/types/storage/storage_list_params.py +39 -0
  253. gcore/types/storage/storage_restore_params.py +11 -0
  254. gcore/types/storage/storage_update_params.py +18 -0
  255. gcore/types/storage/usage_series.py +201 -0
  256. gcore/types/storage/usage_total.py +54 -0
  257. gcore/types/streaming/__init__.py +0 -4
  258. gcore/types/streaming/ai_contentmoderation_hardnudity.py +1 -1
  259. gcore/types/streaming/ai_contentmoderation_nsfw.py +1 -1
  260. gcore/types/streaming/ai_contentmoderation_softnudity.py +1 -1
  261. gcore/types/streaming/ai_contentmoderation_sport.py +1 -1
  262. gcore/types/streaming/ai_task.py +1 -5
  263. gcore/types/streaming/ai_task_create_params.py +2 -2
  264. gcore/types/streaming/ai_task_get_response.py +0 -46
  265. gcore/types/streaming/clip.py +2 -1
  266. gcore/types/streaming/create_video_param.py +13 -12
  267. gcore/types/streaming/max_stream_series.py +5 -5
  268. gcore/types/streaming/playlist.py +1 -1
  269. gcore/types/streaming/playlist_create_params.py +1 -1
  270. gcore/types/streaming/playlist_update_params.py +1 -1
  271. gcore/types/streaming/playlist_video.py +13 -12
  272. gcore/types/streaming/storage_series.py +5 -5
  273. gcore/types/streaming/stream.py +86 -49
  274. gcore/types/streaming/stream_create_clip_params.py +2 -1
  275. gcore/types/streaming/stream_create_params.py +9 -23
  276. gcore/types/streaming/stream_series.py +5 -5
  277. gcore/types/streaming/stream_update_params.py +9 -23
  278. gcore/types/streaming/video.py +53 -42
  279. gcore/types/streaming/video_update_params.py +13 -12
  280. gcore/types/streaming/vod_statistics_series.py +5 -5
  281. gcore/types/streaming/vod_total_stream_duration_series.py +3 -3
  282. gcore/types/waap/domain_list_params.py +1 -1
  283. gcore/types/waap/domain_update_params.py +1 -1
  284. gcore/types/waap/domains/advanced_rule_create_params.py +7 -4
  285. gcore/types/waap/domains/advanced_rule_update_params.py +6 -3
  286. gcore/types/waap/domains/api_path_create_params.py +4 -3
  287. gcore/types/waap/domains/api_path_list_params.py +3 -1
  288. gcore/types/waap/domains/api_path_update_params.py +5 -4
  289. gcore/types/waap/domains/custom_rule_create_params.py +13 -14
  290. gcore/types/waap/domains/custom_rule_update_params.py +12 -13
  291. gcore/types/waap/domains/firewall_rule_create_params.py +3 -2
  292. gcore/types/waap/domains/firewall_rule_update_params.py +2 -1
  293. gcore/types/waap/domains/insight_list_params.py +4 -2
  294. gcore/types/waap/domains/insight_replace_params.py +1 -1
  295. gcore/types/waap/domains/insight_silence_list_params.py +5 -3
  296. gcore/types/waap/domains/setting_update_params.py +3 -2
  297. gcore/types/waap/domains/statistic_get_ddos_info_params.py +6 -9
  298. gcore/types/waap/domains/statistic_get_events_aggregated_params.py +9 -10
  299. gcore/types/waap/domains/statistic_get_requests_series_params.py +8 -9
  300. gcore/types/waap/domains/statistic_get_traffic_series_params.py +6 -9
  301. gcore/types/waap/domains/waap_advanced_rule.py +3 -2
  302. gcore/types/waap/domains/waap_api_path.py +4 -4
  303. gcore/types/waap/domains/waap_api_scan_result.py +2 -2
  304. gcore/types/waap/domains/waap_custom_rule.py +4 -7
  305. gcore/types/waap/domains/waap_firewall_rule.py +3 -2
  306. gcore/types/waap/domains/waap_insight.py +1 -1
  307. gcore/types/waap/domains/waap_request_details.py +5 -4
  308. gcore/types/waap/waap_ip_ddos_info_model.py +3 -3
  309. gcore/types/waap/waap_rule_set.py +1 -1
  310. {gcore-0.10.0.dist-info → gcore-0.12.0.dist-info}/METADATA +7 -2
  311. {gcore-0.10.0.dist-info → gcore-0.12.0.dist-info}/RECORD +313 -193
  312. gcore/types/cloud/inference/inference_model.py +0 -65
  313. gcore/types/cloud/inference/inference_registry_credentials_create.py +0 -22
  314. gcore/types/cloud/inference/model_list_params.py +0 -21
  315. gcore/types/streaming/ai_contentmoderation_casm.py +0 -39
  316. gcore/types/streaming/ai_contentmoderation_weapon.py +0 -39
  317. gcore/types/streaming/meet_series.py +0 -23
  318. gcore/types/streaming/statistic_get_meet_series_params.py +0 -20
  319. {gcore-0.10.0.dist-info → gcore-0.12.0.dist-info}/WHEEL +0 -0
  320. {gcore-0.10.0.dist-info → gcore-0.12.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,1046 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing_extensions import Literal
6
+
7
+ import httpx
8
+
9
+ from ..._types import NOT_GIVEN, Body, Query, Headers, NoneType, NotGiven
10
+ from ..._utils import maybe_transform, async_maybe_transform
11
+ from ..._compat import cached_property
12
+ from .locations import (
13
+ LocationsResource,
14
+ AsyncLocationsResource,
15
+ LocationsResourceWithRawResponse,
16
+ AsyncLocationsResourceWithRawResponse,
17
+ LocationsResourceWithStreamingResponse,
18
+ AsyncLocationsResourceWithStreamingResponse,
19
+ )
20
+ from .statistics import (
21
+ StatisticsResource,
22
+ AsyncStatisticsResource,
23
+ StatisticsResourceWithRawResponse,
24
+ AsyncStatisticsResourceWithRawResponse,
25
+ StatisticsResourceWithStreamingResponse,
26
+ AsyncStatisticsResourceWithStreamingResponse,
27
+ )
28
+ from ..._resource import SyncAPIResource, AsyncAPIResource
29
+ from ..._response import (
30
+ to_raw_response_wrapper,
31
+ to_streamed_response_wrapper,
32
+ async_to_raw_response_wrapper,
33
+ async_to_streamed_response_wrapper,
34
+ )
35
+ from .credentials import (
36
+ CredentialsResource,
37
+ AsyncCredentialsResource,
38
+ CredentialsResourceWithRawResponse,
39
+ AsyncCredentialsResourceWithRawResponse,
40
+ CredentialsResourceWithStreamingResponse,
41
+ AsyncCredentialsResourceWithStreamingResponse,
42
+ )
43
+ from ...pagination import SyncOffsetPage, AsyncOffsetPage
44
+ from ..._base_client import AsyncPaginator, make_request_options
45
+ from ...types.storage import storage_list_params, storage_create_params, storage_update_params, storage_restore_params
46
+ from .buckets.buckets import (
47
+ BucketsResource,
48
+ AsyncBucketsResource,
49
+ BucketsResourceWithRawResponse,
50
+ AsyncBucketsResourceWithRawResponse,
51
+ BucketsResourceWithStreamingResponse,
52
+ AsyncBucketsResourceWithStreamingResponse,
53
+ )
54
+ from ...types.storage.storage import Storage
55
+
56
+ __all__ = ["StorageResource", "AsyncStorageResource"]
57
+
58
+
59
+ class StorageResource(SyncAPIResource):
60
+ @cached_property
61
+ def locations(self) -> LocationsResource:
62
+ return LocationsResource(self._client)
63
+
64
+ @cached_property
65
+ def statistics(self) -> StatisticsResource:
66
+ return StatisticsResource(self._client)
67
+
68
+ @cached_property
69
+ def credentials(self) -> CredentialsResource:
70
+ return CredentialsResource(self._client)
71
+
72
+ @cached_property
73
+ def buckets(self) -> BucketsResource:
74
+ return BucketsResource(self._client)
75
+
76
+ @cached_property
77
+ def with_raw_response(self) -> StorageResourceWithRawResponse:
78
+ """
79
+ This property can be used as a prefix for any HTTP method call to return
80
+ the raw response object instead of the parsed content.
81
+
82
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
83
+ """
84
+ return StorageResourceWithRawResponse(self)
85
+
86
+ @cached_property
87
+ def with_streaming_response(self) -> StorageResourceWithStreamingResponse:
88
+ """
89
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
90
+
91
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
92
+ """
93
+ return StorageResourceWithStreamingResponse(self)
94
+
95
+ def create(
96
+ self,
97
+ *,
98
+ location: Literal["s-ed1", "s-drc2", "s-sgc1", "s-nhn2", "s-darz", "s-ws1", "ams", "sin", "fra", "mia"],
99
+ name: str,
100
+ type: Literal["sftp", "s3"],
101
+ generate_sftp_password: bool | NotGiven = NOT_GIVEN,
102
+ sftp_password: str | NotGiven = NOT_GIVEN,
103
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
104
+ # The extra values given here take precedence over values defined on the client or passed to this method.
105
+ extra_headers: Headers | None = None,
106
+ extra_query: Query | None = None,
107
+ extra_body: Body | None = None,
108
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
109
+ ) -> Storage:
110
+ """
111
+ Creates a new storage instance (S3 or SFTP) in the specified location and
112
+ returns the storage details including credentials.
113
+
114
+ Args:
115
+ location: Geographic location where the storage will be provisioned. Each location
116
+ represents a specific data center region.
117
+
118
+ name: Unique storage name identifier. Must contain only letters, numbers, dashes, and
119
+ underscores. Cannot be empty and must be less than 256 characters.
120
+
121
+ type: Storage protocol type. Choose 's3' for S3-compatible object storage with API
122
+ access, or `sftp` for SFTP file transfer protocol.
123
+
124
+ generate_sftp_password: Automatically generate a secure password for SFTP storage access. Only
125
+ applicable when type is `sftp`. When `true`, a random password will be generated
126
+ and returned in the response.
127
+
128
+ sftp_password: Custom password for SFTP storage access. Only applicable when type is `sftp`. If
129
+ not provided and `generate_sftp_password` is `false`, no password authentication
130
+ will be available.
131
+
132
+ extra_headers: Send extra headers
133
+
134
+ extra_query: Add additional query parameters to the request
135
+
136
+ extra_body: Add additional JSON properties to the request
137
+
138
+ timeout: Override the client-level default timeout for this request, in seconds
139
+ """
140
+ return self._post(
141
+ "/storage/provisioning/v2/storage",
142
+ body=maybe_transform(
143
+ {
144
+ "location": location,
145
+ "name": name,
146
+ "type": type,
147
+ "generate_sftp_password": generate_sftp_password,
148
+ "sftp_password": sftp_password,
149
+ },
150
+ storage_create_params.StorageCreateParams,
151
+ ),
152
+ options=make_request_options(
153
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
154
+ ),
155
+ cast_to=Storage,
156
+ )
157
+
158
+ def update(
159
+ self,
160
+ storage_id: int,
161
+ *,
162
+ expires: str | NotGiven = NOT_GIVEN,
163
+ server_alias: str | NotGiven = NOT_GIVEN,
164
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
165
+ # The extra values given here take precedence over values defined on the client or passed to this method.
166
+ extra_headers: Headers | None = None,
167
+ extra_query: Query | None = None,
168
+ extra_body: Body | None = None,
169
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
170
+ ) -> Storage:
171
+ """Updates storage configuration such as expiration date and server alias.
172
+
173
+ Used for
174
+ SFTP storages.
175
+
176
+ Args:
177
+ expires: Duration when the storage should expire in format like "1 years 6 months 2 weeks
178
+ 3 days 5 hours 10 minutes 15 seconds". Set empty to remove expiration.
179
+
180
+ server_alias: Custom domain alias for accessing the storage. Set empty to remove alias.
181
+
182
+ extra_headers: Send extra headers
183
+
184
+ extra_query: Add additional query parameters to the request
185
+
186
+ extra_body: Add additional JSON properties to the request
187
+
188
+ timeout: Override the client-level default timeout for this request, in seconds
189
+ """
190
+ return self._patch(
191
+ f"/storage/provisioning/v2/storage/{storage_id}",
192
+ body=maybe_transform(
193
+ {
194
+ "expires": expires,
195
+ "server_alias": server_alias,
196
+ },
197
+ storage_update_params.StorageUpdateParams,
198
+ ),
199
+ options=make_request_options(
200
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
201
+ ),
202
+ cast_to=Storage,
203
+ )
204
+
205
+ def list(
206
+ self,
207
+ *,
208
+ id: str | NotGiven = NOT_GIVEN,
209
+ limit: int | NotGiven = NOT_GIVEN,
210
+ location: str | NotGiven = NOT_GIVEN,
211
+ name: str | NotGiven = NOT_GIVEN,
212
+ offset: int | NotGiven = NOT_GIVEN,
213
+ order_by: str | NotGiven = NOT_GIVEN,
214
+ order_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
215
+ show_deleted: bool | NotGiven = NOT_GIVEN,
216
+ status: Literal["active", "suspended", "deleted", "pending"] | NotGiven = NOT_GIVEN,
217
+ type: Literal["s3", "sftp"] | NotGiven = NOT_GIVEN,
218
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
219
+ # The extra values given here take precedence over values defined on the client or passed to this method.
220
+ extra_headers: Headers | None = None,
221
+ extra_query: Query | None = None,
222
+ extra_body: Body | None = None,
223
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
224
+ ) -> SyncOffsetPage[Storage]:
225
+ """
226
+ Returns storages with the same filtering and pagination as v2, but in a
227
+ simplified response shape for easier client consumption. Response format: count:
228
+ total number of storages matching the filter (independent of pagination)
229
+ results: the current page of storages according to limit/offset
230
+
231
+ Args:
232
+ id: Filter by storage ID
233
+
234
+ limit: Max number of records in response
235
+
236
+ location: Filter by storage location/region
237
+
238
+ name: Filter by storage name (exact match)
239
+
240
+ offset: Number of records to skip before beginning to write in response.
241
+
242
+ order_by: Field name to sort by
243
+
244
+ order_direction: Ascending or descending order
245
+
246
+ show_deleted: Include deleted storages in the response
247
+
248
+ status: Filter by storage status
249
+
250
+ type: Filter by storage type
251
+
252
+ extra_headers: Send extra headers
253
+
254
+ extra_query: Add additional query parameters to the request
255
+
256
+ extra_body: Add additional JSON properties to the request
257
+
258
+ timeout: Override the client-level default timeout for this request, in seconds
259
+ """
260
+ return self._get_api_list(
261
+ "/storage/provisioning/v3/storage",
262
+ page=SyncOffsetPage[Storage],
263
+ options=make_request_options(
264
+ extra_headers=extra_headers,
265
+ extra_query=extra_query,
266
+ extra_body=extra_body,
267
+ timeout=timeout,
268
+ query=maybe_transform(
269
+ {
270
+ "id": id,
271
+ "limit": limit,
272
+ "location": location,
273
+ "name": name,
274
+ "offset": offset,
275
+ "order_by": order_by,
276
+ "order_direction": order_direction,
277
+ "show_deleted": show_deleted,
278
+ "status": status,
279
+ "type": type,
280
+ },
281
+ storage_list_params.StorageListParams,
282
+ ),
283
+ ),
284
+ model=Storage,
285
+ )
286
+
287
+ def delete(
288
+ self,
289
+ storage_id: int,
290
+ *,
291
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
292
+ # The extra values given here take precedence over values defined on the client or passed to this method.
293
+ extra_headers: Headers | None = None,
294
+ extra_query: Query | None = None,
295
+ extra_body: Body | None = None,
296
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
297
+ ) -> None:
298
+ """Permanently deletes a storage and all its data.
299
+
300
+ This action cannot be undone.
301
+
302
+ Args:
303
+ extra_headers: Send extra headers
304
+
305
+ extra_query: Add additional query parameters to the request
306
+
307
+ extra_body: Add additional JSON properties to the request
308
+
309
+ timeout: Override the client-level default timeout for this request, in seconds
310
+ """
311
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
312
+ return self._delete(
313
+ f"/storage/provisioning/v1/storage/{storage_id}",
314
+ options=make_request_options(
315
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
316
+ ),
317
+ cast_to=NoneType,
318
+ )
319
+
320
+ def get(
321
+ self,
322
+ storage_id: int,
323
+ *,
324
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
325
+ # The extra values given here take precedence over values defined on the client or passed to this method.
326
+ extra_headers: Headers | None = None,
327
+ extra_query: Query | None = None,
328
+ extra_body: Body | None = None,
329
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
330
+ ) -> Storage:
331
+ """
332
+ Retrieves detailed information about a specific storage including its
333
+ configuration, credentials, and current status.
334
+
335
+ Args:
336
+ extra_headers: Send extra headers
337
+
338
+ extra_query: Add additional query parameters to the request
339
+
340
+ extra_body: Add additional JSON properties to the request
341
+
342
+ timeout: Override the client-level default timeout for this request, in seconds
343
+ """
344
+ return self._get(
345
+ f"/storage/provisioning/v1/storage/{storage_id}",
346
+ options=make_request_options(
347
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
348
+ ),
349
+ cast_to=Storage,
350
+ )
351
+
352
+ def link_ssh_key(
353
+ self,
354
+ key_id: int,
355
+ *,
356
+ storage_id: int,
357
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
358
+ # The extra values given here take precedence over values defined on the client or passed to this method.
359
+ extra_headers: Headers | None = None,
360
+ extra_query: Query | None = None,
361
+ extra_body: Body | None = None,
362
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
363
+ ) -> None:
364
+ """
365
+ Associates an SSH public key with an SFTP storage, enabling passwordless
366
+ authentication. Only works with SFTP storage types - not applicable to
367
+ S3-compatible storage.
368
+
369
+ Args:
370
+ extra_headers: Send extra headers
371
+
372
+ extra_query: Add additional query parameters to the request
373
+
374
+ extra_body: Add additional JSON properties to the request
375
+
376
+ timeout: Override the client-level default timeout for this request, in seconds
377
+ """
378
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
379
+ return self._post(
380
+ f"/storage/provisioning/v1/storage/{storage_id}/key/{key_id}/link",
381
+ options=make_request_options(
382
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
383
+ ),
384
+ cast_to=NoneType,
385
+ )
386
+
387
+ def restore(
388
+ self,
389
+ storage_id: int,
390
+ *,
391
+ client_id: int | NotGiven = NOT_GIVEN,
392
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
393
+ # The extra values given here take precedence over values defined on the client or passed to this method.
394
+ extra_headers: Headers | None = None,
395
+ extra_query: Query | None = None,
396
+ extra_body: Body | None = None,
397
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
398
+ ) -> None:
399
+ """
400
+ Restores a previously deleted S3 storage if it was deleted within the last 2
401
+ weeks. SFTP storages cannot be restored.
402
+
403
+ Args:
404
+ extra_headers: Send extra headers
405
+
406
+ extra_query: Add additional query parameters to the request
407
+
408
+ extra_body: Add additional JSON properties to the request
409
+
410
+ timeout: Override the client-level default timeout for this request, in seconds
411
+ """
412
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
413
+ return self._post(
414
+ f"/storage/provisioning/v1/storage/{storage_id}/restore",
415
+ options=make_request_options(
416
+ extra_headers=extra_headers,
417
+ extra_query=extra_query,
418
+ extra_body=extra_body,
419
+ timeout=timeout,
420
+ query=maybe_transform({"client_id": client_id}, storage_restore_params.StorageRestoreParams),
421
+ ),
422
+ cast_to=NoneType,
423
+ )
424
+
425
+ def unlink_ssh_key(
426
+ self,
427
+ key_id: int,
428
+ *,
429
+ storage_id: int,
430
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
431
+ # The extra values given here take precedence over values defined on the client or passed to this method.
432
+ extra_headers: Headers | None = None,
433
+ extra_query: Query | None = None,
434
+ extra_body: Body | None = None,
435
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
436
+ ) -> None:
437
+ """
438
+ Removes SSH key association from an SFTP storage, disabling passwordless
439
+ authentication for that key. The key itself remains available for other
440
+ storages.
441
+
442
+ Args:
443
+ extra_headers: Send extra headers
444
+
445
+ extra_query: Add additional query parameters to the request
446
+
447
+ extra_body: Add additional JSON properties to the request
448
+
449
+ timeout: Override the client-level default timeout for this request, in seconds
450
+ """
451
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
452
+ return self._post(
453
+ f"/storage/provisioning/v1/storage/{storage_id}/key/{key_id}/unlink",
454
+ options=make_request_options(
455
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
456
+ ),
457
+ cast_to=NoneType,
458
+ )
459
+
460
+
461
+ class AsyncStorageResource(AsyncAPIResource):
462
+ @cached_property
463
+ def locations(self) -> AsyncLocationsResource:
464
+ return AsyncLocationsResource(self._client)
465
+
466
+ @cached_property
467
+ def statistics(self) -> AsyncStatisticsResource:
468
+ return AsyncStatisticsResource(self._client)
469
+
470
+ @cached_property
471
+ def credentials(self) -> AsyncCredentialsResource:
472
+ return AsyncCredentialsResource(self._client)
473
+
474
+ @cached_property
475
+ def buckets(self) -> AsyncBucketsResource:
476
+ return AsyncBucketsResource(self._client)
477
+
478
+ @cached_property
479
+ def with_raw_response(self) -> AsyncStorageResourceWithRawResponse:
480
+ """
481
+ This property can be used as a prefix for any HTTP method call to return
482
+ the raw response object instead of the parsed content.
483
+
484
+ For more information, see https://www.github.com/G-Core/gcore-python#accessing-raw-response-data-eg-headers
485
+ """
486
+ return AsyncStorageResourceWithRawResponse(self)
487
+
488
+ @cached_property
489
+ def with_streaming_response(self) -> AsyncStorageResourceWithStreamingResponse:
490
+ """
491
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
492
+
493
+ For more information, see https://www.github.com/G-Core/gcore-python#with_streaming_response
494
+ """
495
+ return AsyncStorageResourceWithStreamingResponse(self)
496
+
497
+ async def create(
498
+ self,
499
+ *,
500
+ location: Literal["s-ed1", "s-drc2", "s-sgc1", "s-nhn2", "s-darz", "s-ws1", "ams", "sin", "fra", "mia"],
501
+ name: str,
502
+ type: Literal["sftp", "s3"],
503
+ generate_sftp_password: bool | NotGiven = NOT_GIVEN,
504
+ sftp_password: str | NotGiven = NOT_GIVEN,
505
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
506
+ # The extra values given here take precedence over values defined on the client or passed to this method.
507
+ extra_headers: Headers | None = None,
508
+ extra_query: Query | None = None,
509
+ extra_body: Body | None = None,
510
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
511
+ ) -> Storage:
512
+ """
513
+ Creates a new storage instance (S3 or SFTP) in the specified location and
514
+ returns the storage details including credentials.
515
+
516
+ Args:
517
+ location: Geographic location where the storage will be provisioned. Each location
518
+ represents a specific data center region.
519
+
520
+ name: Unique storage name identifier. Must contain only letters, numbers, dashes, and
521
+ underscores. Cannot be empty and must be less than 256 characters.
522
+
523
+ type: Storage protocol type. Choose 's3' for S3-compatible object storage with API
524
+ access, or `sftp` for SFTP file transfer protocol.
525
+
526
+ generate_sftp_password: Automatically generate a secure password for SFTP storage access. Only
527
+ applicable when type is `sftp`. When `true`, a random password will be generated
528
+ and returned in the response.
529
+
530
+ sftp_password: Custom password for SFTP storage access. Only applicable when type is `sftp`. If
531
+ not provided and `generate_sftp_password` is `false`, no password authentication
532
+ will be available.
533
+
534
+ extra_headers: Send extra headers
535
+
536
+ extra_query: Add additional query parameters to the request
537
+
538
+ extra_body: Add additional JSON properties to the request
539
+
540
+ timeout: Override the client-level default timeout for this request, in seconds
541
+ """
542
+ return await self._post(
543
+ "/storage/provisioning/v2/storage",
544
+ body=await async_maybe_transform(
545
+ {
546
+ "location": location,
547
+ "name": name,
548
+ "type": type,
549
+ "generate_sftp_password": generate_sftp_password,
550
+ "sftp_password": sftp_password,
551
+ },
552
+ storage_create_params.StorageCreateParams,
553
+ ),
554
+ options=make_request_options(
555
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
556
+ ),
557
+ cast_to=Storage,
558
+ )
559
+
560
+ async def update(
561
+ self,
562
+ storage_id: int,
563
+ *,
564
+ expires: str | NotGiven = NOT_GIVEN,
565
+ server_alias: str | NotGiven = NOT_GIVEN,
566
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
567
+ # The extra values given here take precedence over values defined on the client or passed to this method.
568
+ extra_headers: Headers | None = None,
569
+ extra_query: Query | None = None,
570
+ extra_body: Body | None = None,
571
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
572
+ ) -> Storage:
573
+ """Updates storage configuration such as expiration date and server alias.
574
+
575
+ Used for
576
+ SFTP storages.
577
+
578
+ Args:
579
+ expires: Duration when the storage should expire in format like "1 years 6 months 2 weeks
580
+ 3 days 5 hours 10 minutes 15 seconds". Set empty to remove expiration.
581
+
582
+ server_alias: Custom domain alias for accessing the storage. Set empty to remove alias.
583
+
584
+ extra_headers: Send extra headers
585
+
586
+ extra_query: Add additional query parameters to the request
587
+
588
+ extra_body: Add additional JSON properties to the request
589
+
590
+ timeout: Override the client-level default timeout for this request, in seconds
591
+ """
592
+ return await self._patch(
593
+ f"/storage/provisioning/v2/storage/{storage_id}",
594
+ body=await async_maybe_transform(
595
+ {
596
+ "expires": expires,
597
+ "server_alias": server_alias,
598
+ },
599
+ storage_update_params.StorageUpdateParams,
600
+ ),
601
+ options=make_request_options(
602
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
603
+ ),
604
+ cast_to=Storage,
605
+ )
606
+
607
+ def list(
608
+ self,
609
+ *,
610
+ id: str | NotGiven = NOT_GIVEN,
611
+ limit: int | NotGiven = NOT_GIVEN,
612
+ location: str | NotGiven = NOT_GIVEN,
613
+ name: str | NotGiven = NOT_GIVEN,
614
+ offset: int | NotGiven = NOT_GIVEN,
615
+ order_by: str | NotGiven = NOT_GIVEN,
616
+ order_direction: Literal["asc", "desc"] | NotGiven = NOT_GIVEN,
617
+ show_deleted: bool | NotGiven = NOT_GIVEN,
618
+ status: Literal["active", "suspended", "deleted", "pending"] | NotGiven = NOT_GIVEN,
619
+ type: Literal["s3", "sftp"] | NotGiven = NOT_GIVEN,
620
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
621
+ # The extra values given here take precedence over values defined on the client or passed to this method.
622
+ extra_headers: Headers | None = None,
623
+ extra_query: Query | None = None,
624
+ extra_body: Body | None = None,
625
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
626
+ ) -> AsyncPaginator[Storage, AsyncOffsetPage[Storage]]:
627
+ """
628
+ Returns storages with the same filtering and pagination as v2, but in a
629
+ simplified response shape for easier client consumption. Response format: count:
630
+ total number of storages matching the filter (independent of pagination)
631
+ results: the current page of storages according to limit/offset
632
+
633
+ Args:
634
+ id: Filter by storage ID
635
+
636
+ limit: Max number of records in response
637
+
638
+ location: Filter by storage location/region
639
+
640
+ name: Filter by storage name (exact match)
641
+
642
+ offset: Number of records to skip before beginning to write in response.
643
+
644
+ order_by: Field name to sort by
645
+
646
+ order_direction: Ascending or descending order
647
+
648
+ show_deleted: Include deleted storages in the response
649
+
650
+ status: Filter by storage status
651
+
652
+ type: Filter by storage type
653
+
654
+ extra_headers: Send extra headers
655
+
656
+ extra_query: Add additional query parameters to the request
657
+
658
+ extra_body: Add additional JSON properties to the request
659
+
660
+ timeout: Override the client-level default timeout for this request, in seconds
661
+ """
662
+ return self._get_api_list(
663
+ "/storage/provisioning/v3/storage",
664
+ page=AsyncOffsetPage[Storage],
665
+ options=make_request_options(
666
+ extra_headers=extra_headers,
667
+ extra_query=extra_query,
668
+ extra_body=extra_body,
669
+ timeout=timeout,
670
+ query=maybe_transform(
671
+ {
672
+ "id": id,
673
+ "limit": limit,
674
+ "location": location,
675
+ "name": name,
676
+ "offset": offset,
677
+ "order_by": order_by,
678
+ "order_direction": order_direction,
679
+ "show_deleted": show_deleted,
680
+ "status": status,
681
+ "type": type,
682
+ },
683
+ storage_list_params.StorageListParams,
684
+ ),
685
+ ),
686
+ model=Storage,
687
+ )
688
+
689
+ async def delete(
690
+ self,
691
+ storage_id: int,
692
+ *,
693
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
694
+ # The extra values given here take precedence over values defined on the client or passed to this method.
695
+ extra_headers: Headers | None = None,
696
+ extra_query: Query | None = None,
697
+ extra_body: Body | None = None,
698
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
699
+ ) -> None:
700
+ """Permanently deletes a storage and all its data.
701
+
702
+ This action cannot be undone.
703
+
704
+ Args:
705
+ extra_headers: Send extra headers
706
+
707
+ extra_query: Add additional query parameters to the request
708
+
709
+ extra_body: Add additional JSON properties to the request
710
+
711
+ timeout: Override the client-level default timeout for this request, in seconds
712
+ """
713
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
714
+ return await self._delete(
715
+ f"/storage/provisioning/v1/storage/{storage_id}",
716
+ options=make_request_options(
717
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
718
+ ),
719
+ cast_to=NoneType,
720
+ )
721
+
722
+ async def get(
723
+ self,
724
+ storage_id: int,
725
+ *,
726
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
727
+ # The extra values given here take precedence over values defined on the client or passed to this method.
728
+ extra_headers: Headers | None = None,
729
+ extra_query: Query | None = None,
730
+ extra_body: Body | None = None,
731
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
732
+ ) -> Storage:
733
+ """
734
+ Retrieves detailed information about a specific storage including its
735
+ configuration, credentials, and current status.
736
+
737
+ Args:
738
+ extra_headers: Send extra headers
739
+
740
+ extra_query: Add additional query parameters to the request
741
+
742
+ extra_body: Add additional JSON properties to the request
743
+
744
+ timeout: Override the client-level default timeout for this request, in seconds
745
+ """
746
+ return await self._get(
747
+ f"/storage/provisioning/v1/storage/{storage_id}",
748
+ options=make_request_options(
749
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
750
+ ),
751
+ cast_to=Storage,
752
+ )
753
+
754
+ async def link_ssh_key(
755
+ self,
756
+ key_id: int,
757
+ *,
758
+ storage_id: int,
759
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
760
+ # The extra values given here take precedence over values defined on the client or passed to this method.
761
+ extra_headers: Headers | None = None,
762
+ extra_query: Query | None = None,
763
+ extra_body: Body | None = None,
764
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
765
+ ) -> None:
766
+ """
767
+ Associates an SSH public key with an SFTP storage, enabling passwordless
768
+ authentication. Only works with SFTP storage types - not applicable to
769
+ S3-compatible storage.
770
+
771
+ Args:
772
+ extra_headers: Send extra headers
773
+
774
+ extra_query: Add additional query parameters to the request
775
+
776
+ extra_body: Add additional JSON properties to the request
777
+
778
+ timeout: Override the client-level default timeout for this request, in seconds
779
+ """
780
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
781
+ return await self._post(
782
+ f"/storage/provisioning/v1/storage/{storage_id}/key/{key_id}/link",
783
+ options=make_request_options(
784
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
785
+ ),
786
+ cast_to=NoneType,
787
+ )
788
+
789
+ async def restore(
790
+ self,
791
+ storage_id: int,
792
+ *,
793
+ client_id: int | NotGiven = NOT_GIVEN,
794
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
795
+ # The extra values given here take precedence over values defined on the client or passed to this method.
796
+ extra_headers: Headers | None = None,
797
+ extra_query: Query | None = None,
798
+ extra_body: Body | None = None,
799
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
800
+ ) -> None:
801
+ """
802
+ Restores a previously deleted S3 storage if it was deleted within the last 2
803
+ weeks. SFTP storages cannot be restored.
804
+
805
+ Args:
806
+ extra_headers: Send extra headers
807
+
808
+ extra_query: Add additional query parameters to the request
809
+
810
+ extra_body: Add additional JSON properties to the request
811
+
812
+ timeout: Override the client-level default timeout for this request, in seconds
813
+ """
814
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
815
+ return await self._post(
816
+ f"/storage/provisioning/v1/storage/{storage_id}/restore",
817
+ options=make_request_options(
818
+ extra_headers=extra_headers,
819
+ extra_query=extra_query,
820
+ extra_body=extra_body,
821
+ timeout=timeout,
822
+ query=await async_maybe_transform(
823
+ {"client_id": client_id}, storage_restore_params.StorageRestoreParams
824
+ ),
825
+ ),
826
+ cast_to=NoneType,
827
+ )
828
+
829
+ async def unlink_ssh_key(
830
+ self,
831
+ key_id: int,
832
+ *,
833
+ storage_id: int,
834
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
835
+ # The extra values given here take precedence over values defined on the client or passed to this method.
836
+ extra_headers: Headers | None = None,
837
+ extra_query: Query | None = None,
838
+ extra_body: Body | None = None,
839
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
840
+ ) -> None:
841
+ """
842
+ Removes SSH key association from an SFTP storage, disabling passwordless
843
+ authentication for that key. The key itself remains available for other
844
+ storages.
845
+
846
+ Args:
847
+ extra_headers: Send extra headers
848
+
849
+ extra_query: Add additional query parameters to the request
850
+
851
+ extra_body: Add additional JSON properties to the request
852
+
853
+ timeout: Override the client-level default timeout for this request, in seconds
854
+ """
855
+ extra_headers = {"Accept": "*/*", **(extra_headers or {})}
856
+ return await self._post(
857
+ f"/storage/provisioning/v1/storage/{storage_id}/key/{key_id}/unlink",
858
+ options=make_request_options(
859
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
860
+ ),
861
+ cast_to=NoneType,
862
+ )
863
+
864
+
865
+ class StorageResourceWithRawResponse:
866
+ def __init__(self, storage: StorageResource) -> None:
867
+ self._storage = storage
868
+
869
+ self.create = to_raw_response_wrapper(
870
+ storage.create,
871
+ )
872
+ self.update = to_raw_response_wrapper(
873
+ storage.update,
874
+ )
875
+ self.list = to_raw_response_wrapper(
876
+ storage.list,
877
+ )
878
+ self.delete = to_raw_response_wrapper(
879
+ storage.delete,
880
+ )
881
+ self.get = to_raw_response_wrapper(
882
+ storage.get,
883
+ )
884
+ self.link_ssh_key = to_raw_response_wrapper(
885
+ storage.link_ssh_key,
886
+ )
887
+ self.restore = to_raw_response_wrapper(
888
+ storage.restore,
889
+ )
890
+ self.unlink_ssh_key = to_raw_response_wrapper(
891
+ storage.unlink_ssh_key,
892
+ )
893
+
894
+ @cached_property
895
+ def locations(self) -> LocationsResourceWithRawResponse:
896
+ return LocationsResourceWithRawResponse(self._storage.locations)
897
+
898
+ @cached_property
899
+ def statistics(self) -> StatisticsResourceWithRawResponse:
900
+ return StatisticsResourceWithRawResponse(self._storage.statistics)
901
+
902
+ @cached_property
903
+ def credentials(self) -> CredentialsResourceWithRawResponse:
904
+ return CredentialsResourceWithRawResponse(self._storage.credentials)
905
+
906
+ @cached_property
907
+ def buckets(self) -> BucketsResourceWithRawResponse:
908
+ return BucketsResourceWithRawResponse(self._storage.buckets)
909
+
910
+
911
+ class AsyncStorageResourceWithRawResponse:
912
+ def __init__(self, storage: AsyncStorageResource) -> None:
913
+ self._storage = storage
914
+
915
+ self.create = async_to_raw_response_wrapper(
916
+ storage.create,
917
+ )
918
+ self.update = async_to_raw_response_wrapper(
919
+ storage.update,
920
+ )
921
+ self.list = async_to_raw_response_wrapper(
922
+ storage.list,
923
+ )
924
+ self.delete = async_to_raw_response_wrapper(
925
+ storage.delete,
926
+ )
927
+ self.get = async_to_raw_response_wrapper(
928
+ storage.get,
929
+ )
930
+ self.link_ssh_key = async_to_raw_response_wrapper(
931
+ storage.link_ssh_key,
932
+ )
933
+ self.restore = async_to_raw_response_wrapper(
934
+ storage.restore,
935
+ )
936
+ self.unlink_ssh_key = async_to_raw_response_wrapper(
937
+ storage.unlink_ssh_key,
938
+ )
939
+
940
+ @cached_property
941
+ def locations(self) -> AsyncLocationsResourceWithRawResponse:
942
+ return AsyncLocationsResourceWithRawResponse(self._storage.locations)
943
+
944
+ @cached_property
945
+ def statistics(self) -> AsyncStatisticsResourceWithRawResponse:
946
+ return AsyncStatisticsResourceWithRawResponse(self._storage.statistics)
947
+
948
+ @cached_property
949
+ def credentials(self) -> AsyncCredentialsResourceWithRawResponse:
950
+ return AsyncCredentialsResourceWithRawResponse(self._storage.credentials)
951
+
952
+ @cached_property
953
+ def buckets(self) -> AsyncBucketsResourceWithRawResponse:
954
+ return AsyncBucketsResourceWithRawResponse(self._storage.buckets)
955
+
956
+
957
+ class StorageResourceWithStreamingResponse:
958
+ def __init__(self, storage: StorageResource) -> None:
959
+ self._storage = storage
960
+
961
+ self.create = to_streamed_response_wrapper(
962
+ storage.create,
963
+ )
964
+ self.update = to_streamed_response_wrapper(
965
+ storage.update,
966
+ )
967
+ self.list = to_streamed_response_wrapper(
968
+ storage.list,
969
+ )
970
+ self.delete = to_streamed_response_wrapper(
971
+ storage.delete,
972
+ )
973
+ self.get = to_streamed_response_wrapper(
974
+ storage.get,
975
+ )
976
+ self.link_ssh_key = to_streamed_response_wrapper(
977
+ storage.link_ssh_key,
978
+ )
979
+ self.restore = to_streamed_response_wrapper(
980
+ storage.restore,
981
+ )
982
+ self.unlink_ssh_key = to_streamed_response_wrapper(
983
+ storage.unlink_ssh_key,
984
+ )
985
+
986
+ @cached_property
987
+ def locations(self) -> LocationsResourceWithStreamingResponse:
988
+ return LocationsResourceWithStreamingResponse(self._storage.locations)
989
+
990
+ @cached_property
991
+ def statistics(self) -> StatisticsResourceWithStreamingResponse:
992
+ return StatisticsResourceWithStreamingResponse(self._storage.statistics)
993
+
994
+ @cached_property
995
+ def credentials(self) -> CredentialsResourceWithStreamingResponse:
996
+ return CredentialsResourceWithStreamingResponse(self._storage.credentials)
997
+
998
+ @cached_property
999
+ def buckets(self) -> BucketsResourceWithStreamingResponse:
1000
+ return BucketsResourceWithStreamingResponse(self._storage.buckets)
1001
+
1002
+
1003
+ class AsyncStorageResourceWithStreamingResponse:
1004
+ def __init__(self, storage: AsyncStorageResource) -> None:
1005
+ self._storage = storage
1006
+
1007
+ self.create = async_to_streamed_response_wrapper(
1008
+ storage.create,
1009
+ )
1010
+ self.update = async_to_streamed_response_wrapper(
1011
+ storage.update,
1012
+ )
1013
+ self.list = async_to_streamed_response_wrapper(
1014
+ storage.list,
1015
+ )
1016
+ self.delete = async_to_streamed_response_wrapper(
1017
+ storage.delete,
1018
+ )
1019
+ self.get = async_to_streamed_response_wrapper(
1020
+ storage.get,
1021
+ )
1022
+ self.link_ssh_key = async_to_streamed_response_wrapper(
1023
+ storage.link_ssh_key,
1024
+ )
1025
+ self.restore = async_to_streamed_response_wrapper(
1026
+ storage.restore,
1027
+ )
1028
+ self.unlink_ssh_key = async_to_streamed_response_wrapper(
1029
+ storage.unlink_ssh_key,
1030
+ )
1031
+
1032
+ @cached_property
1033
+ def locations(self) -> AsyncLocationsResourceWithStreamingResponse:
1034
+ return AsyncLocationsResourceWithStreamingResponse(self._storage.locations)
1035
+
1036
+ @cached_property
1037
+ def statistics(self) -> AsyncStatisticsResourceWithStreamingResponse:
1038
+ return AsyncStatisticsResourceWithStreamingResponse(self._storage.statistics)
1039
+
1040
+ @cached_property
1041
+ def credentials(self) -> AsyncCredentialsResourceWithStreamingResponse:
1042
+ return AsyncCredentialsResourceWithStreamingResponse(self._storage.credentials)
1043
+
1044
+ @cached_property
1045
+ def buckets(self) -> AsyncBucketsResourceWithStreamingResponse:
1046
+ return AsyncBucketsResourceWithStreamingResponse(self._storage.buckets)