appwrite-console 0.1.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.
Files changed (552) hide show
  1. appwrite_console/__init__.py +1 -0
  2. appwrite_console/client.py +371 -0
  3. appwrite_console/encoders/__init__.py +1 -0
  4. appwrite_console/encoders/value_class_encoder.py +373 -0
  5. appwrite_console/enums/__init__.py +1 -0
  6. appwrite_console/enums/account_key_scopes.py +6 -0
  7. appwrite_console/enums/adapter.py +5 -0
  8. appwrite_console/enums/addon.py +7 -0
  9. appwrite_console/enums/appwrite_migration_resource.py +42 -0
  10. appwrite_console/enums/attribute_status.py +8 -0
  11. appwrite_console/enums/authentication_factor.py +7 -0
  12. appwrite_console/enums/authenticator_type.py +4 -0
  13. appwrite_console/enums/backup_services.py +10 -0
  14. appwrite_console/enums/billing_plan_group.py +6 -0
  15. appwrite_console/enums/block_mode.py +5 -0
  16. appwrite_console/enums/block_resource_type.py +12 -0
  17. appwrite_console/enums/browser.py +17 -0
  18. appwrite_console/enums/browser_permission.py +23 -0
  19. appwrite_console/enums/browser_theme.py +5 -0
  20. appwrite_console/enums/build_runtime.py +95 -0
  21. appwrite_console/enums/cache_database.py +6 -0
  22. appwrite_console/enums/cache_target.py +9 -0
  23. appwrite_console/enums/column_status.py +8 -0
  24. appwrite_console/enums/compression.py +6 -0
  25. appwrite_console/enums/console_resource_type.py +4 -0
  26. appwrite_console/enums/credit_card.py +20 -0
  27. appwrite_console/enums/database_status.py +17 -0
  28. appwrite_console/enums/database_type.py +10 -0
  29. appwrite_console/enums/databases_index_type.py +7 -0
  30. appwrite_console/enums/deployment_download_type.py +5 -0
  31. appwrite_console/enums/deployment_status.py +9 -0
  32. appwrite_console/enums/detection_framework_type.py +4 -0
  33. appwrite_console/enums/detection_runtime_type.py +4 -0
  34. appwrite_console/enums/documents_db_index_type.py +6 -0
  35. appwrite_console/enums/domain_purchase_status.py +7 -0
  36. appwrite_console/enums/domain_registration_type.py +7 -0
  37. appwrite_console/enums/domain_suggestion_type.py +5 -0
  38. appwrite_console/enums/domain_transfer_status_enum.py +11 -0
  39. appwrite_console/enums/embedding_model.py +7 -0
  40. appwrite_console/enums/execution_method.py +10 -0
  41. appwrite_console/enums/execution_status.py +8 -0
  42. appwrite_console/enums/execution_trigger.py +6 -0
  43. appwrite_console/enums/firebase_migration_resource.py +13 -0
  44. appwrite_console/enums/flag.py +198 -0
  45. appwrite_console/enums/framework.py +18 -0
  46. appwrite_console/enums/function_template_use_case.py +10 -0
  47. appwrite_console/enums/image_format.py +10 -0
  48. appwrite_console/enums/image_gravity.py +12 -0
  49. appwrite_console/enums/index_status.py +8 -0
  50. appwrite_console/enums/message_priority.py +5 -0
  51. appwrite_console/enums/message_status.py +8 -0
  52. appwrite_console/enums/messaging_provider_type.py +6 -0
  53. appwrite_console/enums/n_host_migration_resource.py +14 -0
  54. appwrite_console/enums/o_auth2_google_prompt.py +6 -0
  55. appwrite_console/enums/o_auth2_oidc_prompt.py +7 -0
  56. appwrite_console/enums/o_auth_provider.py +47 -0
  57. appwrite_console/enums/on_duplicate.py +6 -0
  58. appwrite_console/enums/order_by.py +5 -0
  59. appwrite_console/enums/organization_key_scopes.py +19 -0
  60. appwrite_console/enums/password_hash.py +14 -0
  61. appwrite_console/enums/platform.py +5 -0
  62. appwrite_console/enums/platform_type.py +8 -0
  63. appwrite_console/enums/project_auth_method_id.py +10 -0
  64. appwrite_console/enums/project_email_template_id.py +10 -0
  65. appwrite_console/enums/project_email_template_locale.py +134 -0
  66. appwrite_console/enums/project_key_scopes.py +107 -0
  67. appwrite_console/enums/project_o_auth2_google_prompt.py +6 -0
  68. appwrite_console/enums/project_o_auth2_oidc_prompt.py +7 -0
  69. appwrite_console/enums/project_o_auth_provider_id.py +47 -0
  70. appwrite_console/enums/project_policy_id.py +17 -0
  71. appwrite_console/enums/project_protocol_id.py +6 -0
  72. appwrite_console/enums/project_service_id.py +22 -0
  73. appwrite_console/enums/project_smtp_secure.py +5 -0
  74. appwrite_console/enums/project_usage_range.py +5 -0
  75. appwrite_console/enums/proxy_resource_type.py +5 -0
  76. appwrite_console/enums/proxy_rule_deployment_resource_type.py +5 -0
  77. appwrite_console/enums/proxy_rule_status.py +6 -0
  78. appwrite_console/enums/query_suggestion_resource.py +97 -0
  79. appwrite_console/enums/region.py +9 -0
  80. appwrite_console/enums/relation_mutate.py +6 -0
  81. appwrite_console/enums/relationship_type.py +7 -0
  82. appwrite_console/enums/runtime.py +95 -0
  83. appwrite_console/enums/schedule_resource_type.py +7 -0
  84. appwrite_console/enums/site_template_use_case.py +12 -0
  85. appwrite_console/enums/smtp_encryption.py +6 -0
  86. appwrite_console/enums/status.py +4 -0
  87. appwrite_console/enums/status_code.py +7 -0
  88. appwrite_console/enums/supabase_migration_resource.py +14 -0
  89. appwrite_console/enums/tables_db_index_type.py +7 -0
  90. appwrite_console/enums/template_reference_type.py +6 -0
  91. appwrite_console/enums/timezone.py +422 -0
  92. appwrite_console/enums/usage_range.py +6 -0
  93. appwrite_console/enums/vcs_detection_type.py +5 -0
  94. appwrite_console/enums/vcs_reference_type.py +6 -0
  95. appwrite_console/enums/vectors_db_index_type.py +9 -0
  96. appwrite_console/enums/waf_rule_action.py +8 -0
  97. appwrite_console/exception.py +7 -0
  98. appwrite_console/id.py +26 -0
  99. appwrite_console/input_file.py +21 -0
  100. appwrite_console/models/__init__.py +803 -0
  101. appwrite_console/models/activity_event.py +99 -0
  102. appwrite_console/models/activity_event_list.py +19 -0
  103. appwrite_console/models/additional_resource.py +30 -0
  104. appwrite_console/models/addon.py +42 -0
  105. appwrite_console/models/addon_list.py +19 -0
  106. appwrite_console/models/addon_price.py +36 -0
  107. appwrite_console/models/aggregation_breakdown.py +28 -0
  108. appwrite_console/models/aggregation_team.py +101 -0
  109. appwrite_console/models/aggregation_team_list.py +19 -0
  110. appwrite_console/models/algo_argon2.py +24 -0
  111. appwrite_console/models/algo_bcrypt.py +15 -0
  112. appwrite_console/models/algo_md5.py +15 -0
  113. appwrite_console/models/algo_phpass.py +15 -0
  114. appwrite_console/models/algo_scrypt.py +27 -0
  115. appwrite_console/models/algo_scrypt_modified.py +24 -0
  116. appwrite_console/models/algo_sha.py +15 -0
  117. appwrite_console/models/app.py +91 -0
  118. appwrite_console/models/app_installation.py +42 -0
  119. appwrite_console/models/app_installation_list.py +19 -0
  120. appwrite_console/models/app_key.py +39 -0
  121. appwrite_console/models/app_key_list.py +19 -0
  122. appwrite_console/models/app_scope.py +27 -0
  123. appwrite_console/models/app_scope_list.py +19 -0
  124. appwrite_console/models/app_secret.py +39 -0
  125. appwrite_console/models/app_secret_list.py +19 -0
  126. appwrite_console/models/app_secret_plaintext.py +39 -0
  127. appwrite_console/models/apps_list.py +19 -0
  128. appwrite_console/models/attribute_bigint.py +46 -0
  129. appwrite_console/models/attribute_boolean.py +40 -0
  130. appwrite_console/models/attribute_datetime.py +43 -0
  131. appwrite_console/models/attribute_email.py +43 -0
  132. appwrite_console/models/attribute_enum.py +46 -0
  133. appwrite_console/models/attribute_float.py +46 -0
  134. appwrite_console/models/attribute_integer.py +46 -0
  135. appwrite_console/models/attribute_ip.py +43 -0
  136. appwrite_console/models/attribute_line.py +40 -0
  137. appwrite_console/models/attribute_list.py +36 -0
  138. appwrite_console/models/attribute_longtext.py +43 -0
  139. appwrite_console/models/attribute_mediumtext.py +43 -0
  140. appwrite_console/models/attribute_object.py +37 -0
  141. appwrite_console/models/attribute_point.py +40 -0
  142. appwrite_console/models/attribute_polygon.py +40 -0
  143. appwrite_console/models/attribute_relationship.py +55 -0
  144. appwrite_console/models/attribute_string.py +46 -0
  145. appwrite_console/models/attribute_text.py +43 -0
  146. appwrite_console/models/attribute_url.py +43 -0
  147. appwrite_console/models/attribute_varchar.py +46 -0
  148. appwrite_console/models/attribute_vector.py +40 -0
  149. appwrite_console/models/backup_archive.py +48 -0
  150. appwrite_console/models/backup_archive_list.py +19 -0
  151. appwrite_console/models/backup_policy.py +48 -0
  152. appwrite_console/models/backup_policy_list.py +19 -0
  153. appwrite_console/models/backup_restoration.py +45 -0
  154. appwrite_console/models/backup_restoration_list.py +19 -0
  155. appwrite_console/models/base_model.py +27 -0
  156. appwrite_console/models/billing_address.py +36 -0
  157. appwrite_console/models/billing_address_list.py +19 -0
  158. appwrite_console/models/billing_limits.py +36 -0
  159. appwrite_console/models/billing_plan.py +226 -0
  160. appwrite_console/models/billing_plan_addon.py +19 -0
  161. appwrite_console/models/billing_plan_addon_details.py +36 -0
  162. appwrite_console/models/billing_plan_dedicated_database_limits.py +69 -0
  163. appwrite_console/models/billing_plan_limits.py +18 -0
  164. appwrite_console/models/billing_plan_list.py +19 -0
  165. appwrite_console/models/billing_plan_supported_addons.py +21 -0
  166. appwrite_console/models/block.py +45 -0
  167. appwrite_console/models/block_delete.py +19 -0
  168. appwrite_console/models/block_list.py +19 -0
  169. appwrite_console/models/branch.py +15 -0
  170. appwrite_console/models/branch_list.py +19 -0
  171. appwrite_console/models/bucket.py +54 -0
  172. appwrite_console/models/bucket_list.py +19 -0
  173. appwrite_console/models/campaign.py +49 -0
  174. appwrite_console/models/collection.py +67 -0
  175. appwrite_console/models/collection_list.py +19 -0
  176. appwrite_console/models/column_bigint.py +46 -0
  177. appwrite_console/models/column_boolean.py +40 -0
  178. appwrite_console/models/column_datetime.py +43 -0
  179. appwrite_console/models/column_email.py +43 -0
  180. appwrite_console/models/column_enum.py +46 -0
  181. appwrite_console/models/column_float.py +46 -0
  182. appwrite_console/models/column_index.py +42 -0
  183. appwrite_console/models/column_index_list.py +19 -0
  184. appwrite_console/models/column_integer.py +46 -0
  185. appwrite_console/models/column_ip.py +43 -0
  186. appwrite_console/models/column_line.py +40 -0
  187. appwrite_console/models/column_list.py +36 -0
  188. appwrite_console/models/column_longtext.py +43 -0
  189. appwrite_console/models/column_mediumtext.py +43 -0
  190. appwrite_console/models/column_point.py +40 -0
  191. appwrite_console/models/column_polygon.py +40 -0
  192. appwrite_console/models/column_relationship.py +55 -0
  193. appwrite_console/models/column_string.py +46 -0
  194. appwrite_console/models/column_text.py +43 -0
  195. appwrite_console/models/column_url.py +43 -0
  196. appwrite_console/models/column_varchar.py +46 -0
  197. appwrite_console/models/console_key_scope.py +24 -0
  198. appwrite_console/models/console_key_scope_list.py +19 -0
  199. appwrite_console/models/console_o_auth2_provider.py +19 -0
  200. appwrite_console/models/console_o_auth2_provider_list.py +19 -0
  201. appwrite_console/models/console_o_auth2_provider_parameter.py +24 -0
  202. appwrite_console/models/console_region.py +30 -0
  203. appwrite_console/models/console_region_list.py +19 -0
  204. appwrite_console/models/console_variables.py +96 -0
  205. appwrite_console/models/continent.py +18 -0
  206. appwrite_console/models/continent_list.py +19 -0
  207. appwrite_console/models/country.py +18 -0
  208. appwrite_console/models/country_list.py +19 -0
  209. appwrite_console/models/coupon.py +36 -0
  210. appwrite_console/models/credit.py +45 -0
  211. appwrite_console/models/credit_available.py +15 -0
  212. appwrite_console/models/credit_list.py +22 -0
  213. appwrite_console/models/currency.py +33 -0
  214. appwrite_console/models/currency_list.py +19 -0
  215. appwrite_console/models/database.py +52 -0
  216. appwrite_console/models/database_list.py +19 -0
  217. appwrite_console/models/database_migration.py +57 -0
  218. appwrite_console/models/database_migration_list.py +19 -0
  219. appwrite_console/models/database_status.py +57 -0
  220. appwrite_console/models/database_status_connections.py +18 -0
  221. appwrite_console/models/database_status_replica.py +24 -0
  222. appwrite_console/models/database_status_volume.py +24 -0
  223. appwrite_console/models/dedicated_database.py +159 -0
  224. appwrite_console/models/dedicated_database_backup.py +63 -0
  225. appwrite_console/models/dedicated_database_backup_list.py +19 -0
  226. appwrite_console/models/dedicated_database_backup_storage.py +27 -0
  227. appwrite_console/models/dedicated_database_branch.py +48 -0
  228. appwrite_console/models/dedicated_database_branch_list.py +16 -0
  229. appwrite_console/models/dedicated_database_execution.py +31 -0
  230. appwrite_console/models/dedicated_database_execution_column.py +18 -0
  231. appwrite_console/models/dedicated_database_extensions.py +22 -0
  232. appwrite_console/models/dedicated_database_list.py +19 -0
  233. appwrite_console/models/dedicated_database_member.py +24 -0
  234. appwrite_console/models/dedicated_database_operation.py +45 -0
  235. appwrite_console/models/dedicated_database_operation_list.py +19 -0
  236. appwrite_console/models/dedicated_database_pitr_windows.py +18 -0
  237. appwrite_console/models/dedicated_database_pooler.py +42 -0
  238. appwrite_console/models/dedicated_database_replicas.py +37 -0
  239. appwrite_console/models/dedicated_database_restoration.py +45 -0
  240. appwrite_console/models/dedicated_database_restoration_list.py +19 -0
  241. appwrite_console/models/dedicated_database_specification.py +39 -0
  242. appwrite_console/models/dedicated_database_specification_list.py +23 -0
  243. appwrite_console/models/dedicated_database_specification_pricing.py +27 -0
  244. appwrite_console/models/deployment.py +94 -0
  245. appwrite_console/models/deployment_list.py +19 -0
  246. appwrite_console/models/detection_framework.py +32 -0
  247. appwrite_console/models/detection_runtime.py +29 -0
  248. appwrite_console/models/detection_variable.py +18 -0
  249. appwrite_console/models/dev_key.py +36 -0
  250. appwrite_console/models/dev_key_list.py +19 -0
  251. appwrite_console/models/dns_record.py +48 -0
  252. appwrite_console/models/dns_records_list.py +19 -0
  253. appwrite_console/models/document.py +80 -0
  254. appwrite_console/models/document_list.py +32 -0
  255. appwrite_console/models/domain.py +53 -0
  256. appwrite_console/models/domain_price.py +30 -0
  257. appwrite_console/models/domain_purchase.py +43 -0
  258. appwrite_console/models/domain_suggestion.py +24 -0
  259. appwrite_console/models/domain_suggestions_list.py +19 -0
  260. appwrite_console/models/domain_transfer_out.py +15 -0
  261. appwrite_console/models/domain_transfer_status.py +22 -0
  262. appwrite_console/models/domains_list.py +19 -0
  263. appwrite_console/models/downgrade_feedback.py +42 -0
  264. appwrite_console/models/email_template.py +36 -0
  265. appwrite_console/models/email_template_list.py +19 -0
  266. appwrite_console/models/embedding.py +24 -0
  267. appwrite_console/models/embedding_list.py +19 -0
  268. appwrite_console/models/ephemeral_key.py +39 -0
  269. appwrite_console/models/estimation.py +37 -0
  270. appwrite_console/models/estimation_delete_organization.py +16 -0
  271. appwrite_console/models/estimation_item.py +18 -0
  272. appwrite_console/models/estimation_plan_change.py +29 -0
  273. appwrite_console/models/estimation_update_plan.py +40 -0
  274. appwrite_console/models/execution.py +69 -0
  275. appwrite_console/models/execution_list.py +19 -0
  276. appwrite_console/models/file.py +60 -0
  277. appwrite_console/models/file_list.py +19 -0
  278. appwrite_console/models/framework.py +28 -0
  279. appwrite_console/models/framework_adapter.py +27 -0
  280. appwrite_console/models/framework_list.py +19 -0
  281. appwrite_console/models/function.py +109 -0
  282. appwrite_console/models/function_list.py +19 -0
  283. appwrite_console/models/headers.py +18 -0
  284. appwrite_console/models/identity.py +42 -0
  285. appwrite_console/models/identity_list.py +19 -0
  286. appwrite_console/models/index.py +43 -0
  287. appwrite_console/models/index_list.py +19 -0
  288. appwrite_console/models/insight.py +64 -0
  289. appwrite_console/models/insight_cta.py +24 -0
  290. appwrite_console/models/insight_list.py +19 -0
  291. appwrite_console/models/installation.py +30 -0
  292. appwrite_console/models/installation_list.py +19 -0
  293. appwrite_console/models/invoice.py +82 -0
  294. appwrite_console/models/invoice_list.py +19 -0
  295. appwrite_console/models/jwt.py +15 -0
  296. appwrite_console/models/key.py +39 -0
  297. appwrite_console/models/key_list.py +19 -0
  298. appwrite_console/models/language.py +21 -0
  299. appwrite_console/models/language_list.py +19 -0
  300. appwrite_console/models/locale.py +66 -0
  301. appwrite_console/models/locale_code.py +18 -0
  302. appwrite_console/models/locale_code_list.py +19 -0
  303. appwrite_console/models/log.py +78 -0
  304. appwrite_console/models/log_list.py +19 -0
  305. appwrite_console/models/membership.py +57 -0
  306. appwrite_console/models/membership_list.py +19 -0
  307. appwrite_console/models/message.py +52 -0
  308. appwrite_console/models/message_list.py +19 -0
  309. appwrite_console/models/metric.py +18 -0
  310. appwrite_console/models/metric_breakdown.py +24 -0
  311. appwrite_console/models/mfa_challenge.py +24 -0
  312. appwrite_console/models/mfa_factors.py +24 -0
  313. appwrite_console/models/mfa_recovery_codes.py +15 -0
  314. appwrite_console/models/mfa_type.py +18 -0
  315. appwrite_console/models/migration.py +75 -0
  316. appwrite_console/models/migration_list.py +19 -0
  317. appwrite_console/models/migration_report.py +96 -0
  318. appwrite_console/models/mock_number.py +24 -0
  319. appwrite_console/models/mock_number_list.py +19 -0
  320. appwrite_console/models/notification.py +60 -0
  321. appwrite_console/models/notification_list.py +19 -0
  322. appwrite_console/models/o_auth2_amazon.py +24 -0
  323. appwrite_console/models/o_auth2_apple.py +30 -0
  324. appwrite_console/models/o_auth2_appwrite.py +24 -0
  325. appwrite_console/models/o_auth2_auth0.py +27 -0
  326. appwrite_console/models/o_auth2_authentik.py +27 -0
  327. appwrite_console/models/o_auth2_autodesk.py +24 -0
  328. appwrite_console/models/o_auth2_bitbucket.py +24 -0
  329. appwrite_console/models/o_auth2_bitly.py +24 -0
  330. appwrite_console/models/o_auth2_box.py +24 -0
  331. appwrite_console/models/o_auth2_dailymotion.py +24 -0
  332. appwrite_console/models/o_auth2_discord.py +24 -0
  333. appwrite_console/models/o_auth2_disqus.py +24 -0
  334. appwrite_console/models/o_auth2_dropbox.py +24 -0
  335. appwrite_console/models/o_auth2_etsy.py +24 -0
  336. appwrite_console/models/o_auth2_facebook.py +24 -0
  337. appwrite_console/models/o_auth2_figma.py +24 -0
  338. appwrite_console/models/o_auth2_fusion_auth.py +27 -0
  339. appwrite_console/models/o_auth2_github.py +24 -0
  340. appwrite_console/models/o_auth2_gitlab.py +27 -0
  341. appwrite_console/models/o_auth2_google.py +28 -0
  342. appwrite_console/models/o_auth2_keycloak.py +30 -0
  343. appwrite_console/models/o_auth2_kick.py +24 -0
  344. appwrite_console/models/o_auth2_linkedin.py +24 -0
  345. appwrite_console/models/o_auth2_microsoft.py +27 -0
  346. appwrite_console/models/o_auth2_notion.py +24 -0
  347. appwrite_console/models/o_auth2_oidc.py +43 -0
  348. appwrite_console/models/o_auth2_okta.py +30 -0
  349. appwrite_console/models/o_auth2_paypal.py +24 -0
  350. appwrite_console/models/o_auth2_podio.py +24 -0
  351. appwrite_console/models/o_auth2_provider_list.py +59 -0
  352. appwrite_console/models/o_auth2_salesforce.py +24 -0
  353. appwrite_console/models/o_auth2_slack.py +24 -0
  354. appwrite_console/models/o_auth2_spotify.py +24 -0
  355. appwrite_console/models/o_auth2_stripe.py +24 -0
  356. appwrite_console/models/o_auth2_tradeshift.py +24 -0
  357. appwrite_console/models/o_auth2_twitch.py +24 -0
  358. appwrite_console/models/o_auth2_word_press.py +24 -0
  359. appwrite_console/models/o_auth2_x.py +24 -0
  360. appwrite_console/models/o_auth2_yahoo.py +24 -0
  361. appwrite_console/models/o_auth2_yandex.py +24 -0
  362. appwrite_console/models/o_auth2_zoho.py +24 -0
  363. appwrite_console/models/o_auth2_zoom.py +24 -0
  364. appwrite_console/models/oauth2_approve.py +15 -0
  365. appwrite_console/models/oauth2_authorize.py +18 -0
  366. appwrite_console/models/oauth2_consent.py +42 -0
  367. appwrite_console/models/oauth2_consent_list.py +19 -0
  368. appwrite_console/models/oauth2_consent_token.py +45 -0
  369. appwrite_console/models/oauth2_consent_token_list.py +19 -0
  370. appwrite_console/models/oauth2_device_authorization.py +30 -0
  371. appwrite_console/models/oauth2_grant.py +48 -0
  372. appwrite_console/models/oauth2_organization.py +15 -0
  373. appwrite_console/models/oauth2_organization_list.py +19 -0
  374. appwrite_console/models/oauth2_par.py +18 -0
  375. appwrite_console/models/oauth2_project.py +21 -0
  376. appwrite_console/models/oauth2_project_list.py +19 -0
  377. appwrite_console/models/oauth2_reject.py +15 -0
  378. appwrite_console/models/oauth2_token.py +33 -0
  379. appwrite_console/models/organization.py +132 -0
  380. appwrite_console/models/organization_list.py +32 -0
  381. appwrite_console/models/payment_authentication.py +30 -0
  382. appwrite_console/models/payment_method.py +72 -0
  383. appwrite_console/models/payment_method_list.py +19 -0
  384. appwrite_console/models/phone.py +21 -0
  385. appwrite_console/models/phone_list.py +19 -0
  386. appwrite_console/models/plan_change_estimation_details.py +39 -0
  387. appwrite_console/models/plan_change_limits.py +28 -0
  388. appwrite_console/models/plan_change_project_compliance.py +28 -0
  389. appwrite_console/models/plan_change_resource_compliance.py +30 -0
  390. appwrite_console/models/platform_android.py +31 -0
  391. appwrite_console/models/platform_apple.py +31 -0
  392. appwrite_console/models/platform_linux.py +31 -0
  393. appwrite_console/models/platform_list.py +23 -0
  394. appwrite_console/models/platform_web.py +31 -0
  395. appwrite_console/models/platform_windows.py +31 -0
  396. appwrite_console/models/policy_deny_aliased_email.py +18 -0
  397. appwrite_console/models/policy_deny_corporate_email.py +18 -0
  398. appwrite_console/models/policy_deny_disposable_email.py +18 -0
  399. appwrite_console/models/policy_deny_free_email.py +18 -0
  400. appwrite_console/models/policy_list.py +32 -0
  401. appwrite_console/models/policy_membership_privacy.py +33 -0
  402. appwrite_console/models/policy_password_dictionary.py +18 -0
  403. appwrite_console/models/policy_password_history.py +18 -0
  404. appwrite_console/models/policy_password_personal_data.py +18 -0
  405. appwrite_console/models/policy_password_strength.py +30 -0
  406. appwrite_console/models/policy_session_alert.py +18 -0
  407. appwrite_console/models/policy_session_duration.py +18 -0
  408. appwrite_console/models/policy_session_invalidation.py +18 -0
  409. appwrite_console/models/policy_session_limit.py +18 -0
  410. appwrite_console/models/policy_user_limit.py +18 -0
  411. appwrite_console/models/postgres_extension.py +24 -0
  412. appwrite_console/models/postgres_extension_list.py +19 -0
  413. appwrite_console/models/preferences.py +52 -0
  414. appwrite_console/models/presence.py +39 -0
  415. appwrite_console/models/presence_list.py +19 -0
  416. appwrite_console/models/program.py +39 -0
  417. appwrite_console/models/project.py +153 -0
  418. appwrite_console/models/project_auth_method.py +19 -0
  419. appwrite_console/models/project_list.py +19 -0
  420. appwrite_console/models/project_protocol.py +19 -0
  421. appwrite_console/models/project_service.py +19 -0
  422. appwrite_console/models/provider.py +39 -0
  423. appwrite_console/models/provider_list.py +19 -0
  424. appwrite_console/models/provider_repository.py +42 -0
  425. appwrite_console/models/provider_repository_framework.py +45 -0
  426. appwrite_console/models/provider_repository_framework_list.py +22 -0
  427. appwrite_console/models/provider_repository_runtime.py +45 -0
  428. appwrite_console/models/provider_repository_runtime_list.py +22 -0
  429. appwrite_console/models/proxy_rule.py +59 -0
  430. appwrite_console/models/proxy_rule_list.py +19 -0
  431. appwrite_console/models/report.py +49 -0
  432. appwrite_console/models/report_list.py +19 -0
  433. appwrite_console/models/resource_token.py +33 -0
  434. appwrite_console/models/resource_token_list.py +19 -0
  435. appwrite_console/models/review.py +24 -0
  436. appwrite_console/models/roles.py +18 -0
  437. appwrite_console/models/row.py +80 -0
  438. appwrite_console/models/row_list.py +32 -0
  439. appwrite_console/models/runtime.py +36 -0
  440. appwrite_console/models/runtime_list.py +19 -0
  441. appwrite_console/models/schedule.py +45 -0
  442. appwrite_console/models/schedule_list.py +19 -0
  443. appwrite_console/models/session.py +99 -0
  444. appwrite_console/models/session_list.py +19 -0
  445. appwrite_console/models/site.py +115 -0
  446. appwrite_console/models/site_list.py +19 -0
  447. appwrite_console/models/specification.py +24 -0
  448. appwrite_console/models/specification_list.py +19 -0
  449. appwrite_console/models/stage.py +27 -0
  450. appwrite_console/models/stage_list.py +16 -0
  451. appwrite_console/models/subscriber.py +40 -0
  452. appwrite_console/models/subscriber_list.py +19 -0
  453. appwrite_console/models/table.py +67 -0
  454. appwrite_console/models/table_list.py +19 -0
  455. appwrite_console/models/target.py +39 -0
  456. appwrite_console/models/target_list.py +19 -0
  457. appwrite_console/models/team.py +43 -0
  458. appwrite_console/models/team_list.py +32 -0
  459. appwrite_console/models/template_framework.py +39 -0
  460. appwrite_console/models/template_function.py +65 -0
  461. appwrite_console/models/template_function_list.py +19 -0
  462. appwrite_console/models/template_runtime.py +24 -0
  463. appwrite_console/models/template_site.py +53 -0
  464. appwrite_console/models/template_site_list.py +19 -0
  465. appwrite_console/models/template_variable.py +33 -0
  466. appwrite_console/models/token.py +30 -0
  467. appwrite_console/models/topic.py +36 -0
  468. appwrite_console/models/topic_list.py +19 -0
  469. appwrite_console/models/transaction.py +30 -0
  470. appwrite_console/models/transaction_list.py +19 -0
  471. appwrite_console/models/usage_billing_plan.py +46 -0
  472. appwrite_console/models/usage_data_point.py +99 -0
  473. appwrite_console/models/usage_event_list.py +19 -0
  474. appwrite_console/models/usage_gauge_list.py +19 -0
  475. appwrite_console/models/usage_metric.py +19 -0
  476. appwrite_console/models/usage_organization.py +104 -0
  477. appwrite_console/models/usage_organization_project.py +73 -0
  478. appwrite_console/models/usage_presence.py +22 -0
  479. appwrite_console/models/usage_project.py +218 -0
  480. appwrite_console/models/usage_resources.py +36 -0
  481. appwrite_console/models/usage_users.py +28 -0
  482. appwrite_console/models/user.py +111 -0
  483. appwrite_console/models/user_list.py +32 -0
  484. appwrite_console/models/variable.py +36 -0
  485. appwrite_console/models/variable_list.py +19 -0
  486. appwrite_console/models/vcs_content.py +21 -0
  487. appwrite_console/models/vcs_content_list.py +19 -0
  488. appwrite_console/models/vcs_namespace.py +27 -0
  489. appwrite_console/models/vcs_namespace_list.py +19 -0
  490. appwrite_console/models/vectorsdb_collection.py +54 -0
  491. appwrite_console/models/vectorsdb_collection_list.py +19 -0
  492. appwrite_console/models/waf_rule.py +55 -0
  493. appwrite_console/models/waf_rule_bypass.py +55 -0
  494. appwrite_console/models/waf_rule_challenge.py +64 -0
  495. appwrite_console/models/waf_rule_deny.py +55 -0
  496. appwrite_console/models/waf_rule_list.py +19 -0
  497. appwrite_console/models/waf_rule_rate_limit.py +64 -0
  498. appwrite_console/models/waf_rule_redirect.py +61 -0
  499. appwrite_console/models/webhook.py +51 -0
  500. appwrite_console/models/webhook_list.py +19 -0
  501. appwrite_console/operator.py +150 -0
  502. appwrite_console/permission.py +21 -0
  503. appwrite_console/query.py +293 -0
  504. appwrite_console/role.py +111 -0
  505. appwrite_console/service.py +50 -0
  506. appwrite_console/services/__init__.py +1 -0
  507. appwrite_console/services/account.py +3328 -0
  508. appwrite_console/services/activities.py +89 -0
  509. appwrite_console/services/advisor.py +234 -0
  510. appwrite_console/services/apps.py +1156 -0
  511. appwrite_console/services/assistant.py +50 -0
  512. appwrite_console/services/avatars.py +531 -0
  513. appwrite_console/services/backups.py +572 -0
  514. appwrite_console/services/console.py +807 -0
  515. appwrite_console/services/databases.py +4976 -0
  516. appwrite_console/services/documents_db.py +2052 -0
  517. appwrite_console/services/domains.py +3047 -0
  518. appwrite_console/services/functions.py +1659 -0
  519. appwrite_console/services/graphql.py +92 -0
  520. appwrite_console/services/locale.py +243 -0
  521. appwrite_console/services/manager.py +301 -0
  522. appwrite_console/services/messaging.py +3137 -0
  523. appwrite_console/services/migrations.py +1036 -0
  524. appwrite_console/services/mongo.py +1683 -0
  525. appwrite_console/services/mysql.py +1861 -0
  526. appwrite_console/services/notifications.py +98 -0
  527. appwrite_console/services/oauth2.py +914 -0
  528. appwrite_console/services/organization.py +1039 -0
  529. appwrite_console/services/organizations.py +2245 -0
  530. appwrite_console/services/postgresql.py +1995 -0
  531. appwrite_console/services/presences.py +309 -0
  532. appwrite_console/services/project.py +5271 -0
  533. appwrite_console/services/projects.py +885 -0
  534. appwrite_console/services/proxy.py +394 -0
  535. appwrite_console/services/sites.py +1593 -0
  536. appwrite_console/services/storage.py +818 -0
  537. appwrite_console/services/tables_db.py +5189 -0
  538. appwrite_console/services/teams.py +993 -0
  539. appwrite_console/services/tokens.py +243 -0
  540. appwrite_console/services/usage.py +194 -0
  541. appwrite_console/services/users.py +2314 -0
  542. appwrite_console/services/vcs.py +599 -0
  543. appwrite_console/services/vectors_db.py +2054 -0
  544. appwrite_console/services/waf.py +1014 -0
  545. appwrite_console/services/webhooks.py +344 -0
  546. appwrite_console/utils/__init__.py +1 -0
  547. appwrite_console/utils/deprecated.py +51 -0
  548. appwrite_console-0.1.0.dist-info/METADATA +189 -0
  549. appwrite_console-0.1.0.dist-info/RECORD +552 -0
  550. appwrite_console-0.1.0.dist-info/WHEEL +5 -0
  551. appwrite_console-0.1.0.dist-info/licenses/LICENSE +12 -0
  552. appwrite_console-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1861 @@
1
+ from ..service import Service
2
+ from urllib.parse import quote
3
+ from typing import Any, Dict, List, Optional, Union
4
+ from ..exception import AppwriteException
5
+ from appwrite_console.utils.deprecated import deprecated
6
+ from ..models.dedicated_database_list import DedicatedDatabaseList
7
+ from ..models.dedicated_database import DedicatedDatabase
8
+ from ..models.dedicated_database_specification_list import DedicatedDatabaseSpecificationList
9
+ from ..models.dedicated_database_backup_list import DedicatedDatabaseBackupList
10
+ from ..models.dedicated_database_backup import DedicatedDatabaseBackup
11
+ from ..models.backup_policy_list import BackupPolicyList
12
+ from ..models.backup_policy import BackupPolicy
13
+ from ..models.dedicated_database_backup_storage import DedicatedDatabaseBackupStorage
14
+ from ..models.dedicated_database_branch_list import DedicatedDatabaseBranchList
15
+ from ..models.dedicated_database_execution import DedicatedDatabaseExecution
16
+ from ..models.dedicated_database_operation_list import DedicatedDatabaseOperationList
17
+ from ..models.dedicated_database_pitr_windows import DedicatedDatabasePITRWindows
18
+ from ..models.dedicated_database_pooler import DedicatedDatabasePooler
19
+ from ..models.dedicated_database_replicas import DedicatedDatabaseReplicas
20
+ from ..models.dedicated_database_restoration_list import DedicatedDatabaseRestorationList
21
+ from ..models.dedicated_database_restoration import DedicatedDatabaseRestoration
22
+ from ..models.database_status import DatabaseStatus
23
+
24
+ class Mysql(Service):
25
+
26
+ def __init__(self, client) -> None:
27
+ super(Mysql, self).__init__(client)
28
+
29
+ def list(
30
+ self,
31
+ queries: Optional[List[str]] = None
32
+ ) -> DedicatedDatabaseList:
33
+ """
34
+ List all dedicated databases. Results support pagination.
35
+
36
+ Parameters
37
+ ----------
38
+ queries : Optional[List[str]]
39
+ Array of query strings.
40
+
41
+ Returns
42
+ -------
43
+ DedicatedDatabaseList
44
+ API response as a typed Pydantic model
45
+
46
+ Raises
47
+ ------
48
+ AppwriteException
49
+ If API request fails
50
+ """
51
+
52
+ api_path = '/mysql'
53
+ api_params = {}
54
+
55
+ if queries is not None:
56
+ api_params['queries'] = self._normalize_value(queries)
57
+
58
+ response = self.client.call('get', api_path, {
59
+ 'X-Appwrite-Project': self.client.get_config('project'),
60
+ 'accept': 'application/json',
61
+ }, api_params)
62
+
63
+ return self._parse_response(response, model=DedicatedDatabaseList)
64
+
65
+
66
+ def create(
67
+ self,
68
+ database_id: str,
69
+ name: str,
70
+ version: Optional[str] = None,
71
+ specification: Optional[str] = None,
72
+ replicas: Optional[float] = None,
73
+ sync_mode: Optional[str] = None,
74
+ standby_region: Optional[str] = None,
75
+ network_idle_timeout_seconds: Optional[float] = None,
76
+ network_ip_allowlist: Optional[List[str]] = None,
77
+ idle_timeout_minutes: Optional[float] = None,
78
+ pitr: Optional[bool] = None,
79
+ pitr_retention_days: Optional[float] = None,
80
+ storage_autoscaling: Optional[bool] = None,
81
+ storage_autoscaling_threshold_percent: Optional[float] = None,
82
+ storage_autoscaling_max_gb: Optional[float] = None
83
+ ) -> DedicatedDatabase:
84
+ """
85
+ Create a new dedicated database with the chosen engine and configuration. Status will be 'provisioning' until the database is ready.
86
+
87
+ Parameters
88
+ ----------
89
+ database_id : str
90
+ Database ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
91
+ name : str
92
+ Database display name. Max length: 128 chars.
93
+ version : Optional[str]
94
+ Database engine version. Defaults to latest for selected engine.
95
+ specification : Optional[str]
96
+ Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling.
97
+ replicas : Optional[float]
98
+ Number of high availability replicas (0-5). High availability is enabled when greater than 0.
99
+ sync_mode : Optional[str]
100
+ Replication sync mode preference. Allowed values: async, sync, quorum.
101
+ standby_region : Optional[str]
102
+ Standby region for a cross-region replica. When set, a replica is provisioned in this region for cross-region high availability. Must differ from the database region.
103
+ network_idle_timeout_seconds : Optional[float]
104
+ Connection idle timeout in seconds.
105
+ network_ip_allowlist : Optional[List[str]]
106
+ IP addresses/CIDR ranges allowed to connect.
107
+ idle_timeout_minutes : Optional[float]
108
+ Minutes of inactivity before container scales to zero.
109
+ pitr : Optional[bool]
110
+ Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window.
111
+ pitr_retention_days : Optional[float]
112
+ Number of days to retain PITR data.
113
+ storage_autoscaling : Optional[bool]
114
+ Enable automatic storage expansion when usage exceeds threshold.
115
+ storage_autoscaling_threshold_percent : Optional[float]
116
+ Storage usage percentage (50-95) that triggers automatic expansion.
117
+ storage_autoscaling_max_gb : Optional[float]
118
+ Maximum storage size in GB for autoscaling. 0 means no limit.
119
+
120
+ Returns
121
+ -------
122
+ DedicatedDatabase
123
+ API response as a typed Pydantic model
124
+
125
+ Raises
126
+ ------
127
+ AppwriteException
128
+ If API request fails
129
+ """
130
+
131
+ api_path = '/mysql'
132
+ api_params = {}
133
+ if database_id is None:
134
+ raise AppwriteException('Missing required parameter: "database_id"')
135
+
136
+ if name is None:
137
+ raise AppwriteException('Missing required parameter: "name"')
138
+
139
+
140
+ api_params['databaseId'] = self._normalize_value(database_id)
141
+ api_params['name'] = self._normalize_value(name)
142
+ if version is not None:
143
+ api_params['version'] = self._normalize_value(version)
144
+ if specification is not None:
145
+ api_params['specification'] = self._normalize_value(specification)
146
+ if replicas is not None:
147
+ api_params['replicas'] = self._normalize_value(replicas)
148
+ if sync_mode is not None:
149
+ api_params['syncMode'] = self._normalize_value(sync_mode)
150
+ if standby_region is not None:
151
+ api_params['standbyRegion'] = self._normalize_value(standby_region)
152
+ if network_idle_timeout_seconds is not None:
153
+ api_params['networkIdleTimeoutSeconds'] = self._normalize_value(network_idle_timeout_seconds)
154
+ if network_ip_allowlist is not None:
155
+ api_params['networkIPAllowlist'] = self._normalize_value(network_ip_allowlist)
156
+ if idle_timeout_minutes is not None:
157
+ api_params['idleTimeoutMinutes'] = self._normalize_value(idle_timeout_minutes)
158
+ if pitr is not None:
159
+ api_params['pitr'] = self._normalize_value(pitr)
160
+ if pitr_retention_days is not None:
161
+ api_params['pitrRetentionDays'] = self._normalize_value(pitr_retention_days)
162
+ if storage_autoscaling is not None:
163
+ api_params['storageAutoscaling'] = self._normalize_value(storage_autoscaling)
164
+ if storage_autoscaling_threshold_percent is not None:
165
+ api_params['storageAutoscalingThresholdPercent'] = self._normalize_value(storage_autoscaling_threshold_percent)
166
+ if storage_autoscaling_max_gb is not None:
167
+ api_params['storageAutoscalingMaxGb'] = self._normalize_value(storage_autoscaling_max_gb)
168
+
169
+ response = self.client.call('post', api_path, {
170
+ 'X-Appwrite-Project': self.client.get_config('project'),
171
+ 'content-type': 'application/json',
172
+ 'accept': 'application/json',
173
+ }, api_params)
174
+
175
+ return self._parse_response(response, model=DedicatedDatabase)
176
+
177
+
178
+ def list_specifications(
179
+ self
180
+ ) -> DedicatedDatabaseSpecificationList:
181
+ """
182
+ List the dedicated database specifications available on the current plan. Each specification reports its resource limits, pricing, and whether it is enabled for the organization.
183
+
184
+ Returns
185
+ -------
186
+ DedicatedDatabaseSpecificationList
187
+ API response as a typed Pydantic model
188
+
189
+ Raises
190
+ ------
191
+ AppwriteException
192
+ If API request fails
193
+ """
194
+
195
+ api_path = '/mysql/specifications'
196
+ api_params = {}
197
+
198
+ response = self.client.call('get', api_path, {
199
+ 'X-Appwrite-Project': self.client.get_config('project'),
200
+ 'accept': 'application/json',
201
+ }, api_params)
202
+
203
+ return self._parse_response(response, model=DedicatedDatabaseSpecificationList)
204
+
205
+
206
+ def get(
207
+ self,
208
+ database_id: str
209
+ ) -> DedicatedDatabase:
210
+ """
211
+ Get a dedicated database by its unique ID. Returns the database configuration and current status.
212
+
213
+ Parameters
214
+ ----------
215
+ database_id : str
216
+ Database ID.
217
+
218
+ Returns
219
+ -------
220
+ DedicatedDatabase
221
+ API response as a typed Pydantic model
222
+
223
+ Raises
224
+ ------
225
+ AppwriteException
226
+ If API request fails
227
+ """
228
+
229
+ api_path = '/mysql/{databaseId}'
230
+ api_params = {}
231
+ if database_id is None:
232
+ raise AppwriteException('Missing required parameter: "database_id"')
233
+
234
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
235
+
236
+
237
+ response = self.client.call('get', api_path, {
238
+ 'X-Appwrite-Project': self.client.get_config('project'),
239
+ 'accept': 'application/json',
240
+ }, api_params)
241
+
242
+ return self._parse_response(response, model=DedicatedDatabase)
243
+
244
+
245
+ def update(
246
+ self,
247
+ database_id: str,
248
+ name: Optional[str] = None,
249
+ status: Optional[str] = None,
250
+ specification: Optional[str] = None,
251
+ replicas: Optional[float] = None,
252
+ sync_mode: Optional[str] = None,
253
+ cross_region_replicas: Optional[float] = None,
254
+ standby_region: Optional[str] = None,
255
+ network_idle_timeout_seconds: Optional[float] = None,
256
+ network_ip_allowlist: Optional[List[str]] = None,
257
+ idle_timeout_minutes: Optional[float] = None,
258
+ pitr: Optional[bool] = None,
259
+ pitr_retention_days: Optional[float] = None,
260
+ storage_autoscaling: Optional[bool] = None,
261
+ storage_autoscaling_threshold_percent: Optional[float] = None,
262
+ storage_autoscaling_max_gb: Optional[float] = None,
263
+ metrics_trace_sample_rate: Optional[float] = None,
264
+ metrics_slow_query_log_threshold_ms: Optional[float] = None,
265
+ sql_api_enabled: Optional[bool] = None,
266
+ sql_api_allowed_statements: Optional[List[str]] = None,
267
+ sql_api_max_rows: Optional[float] = None,
268
+ sql_api_max_bytes: Optional[float] = None,
269
+ sql_api_timeout_seconds: Optional[float] = None
270
+ ) -> DedicatedDatabase:
271
+ """
272
+ Update a dedicated database configuration. All changes are applied with zero downtime. Specification changes (cpu, memory, storage) are handled via rolling cutover. Storage expansion is done online. All other settings are applied in-place.
273
+
274
+ Parameters
275
+ ----------
276
+ database_id : str
277
+ Database ID.
278
+ name : Optional[str]
279
+ Database display name.
280
+ status : Optional[str]
281
+ Database status. Allowed values: ready, paused, inactive. Set to "paused" to pause, "ready" to resume (also recovers a failed database whose infrastructure is healthy), or "inactive" to spin down a shared-pool database.
282
+ specification : Optional[str]
283
+ Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime.
284
+ replicas : Optional[float]
285
+ Number of high availability replicas (0-5). High availability is enabled when greater than 0.
286
+ sync_mode : Optional[str]
287
+ Replication sync mode preference. Allowed values: async, sync, quorum.
288
+ cross_region_replicas : Optional[float]
289
+ Number of cross-region standby replicas (0-1). Cross-region replication is enabled when greater than 0.
290
+ standby_region : Optional[str]
291
+ Standby region for the cross-region replica. Required when enabling cross-region replication and no standby region is already configured. Must differ from the database region.
292
+ network_idle_timeout_seconds : Optional[float]
293
+ Connection idle timeout in seconds (60-86400).
294
+ network_ip_allowlist : Optional[List[str]]
295
+ IP addresses/CIDR ranges allowed to connect.
296
+ idle_timeout_minutes : Optional[float]
297
+ Minutes before container scales to zero.
298
+ pitr : Optional[bool]
299
+ Enable or disable point-in-time recovery (PITR).
300
+ pitr_retention_days : Optional[float]
301
+ Days to retain PITR data.
302
+ storage_autoscaling : Optional[bool]
303
+ Enable automatic storage expansion when usage exceeds threshold.
304
+ storage_autoscaling_threshold_percent : Optional[float]
305
+ Storage usage percentage (50-95) that triggers automatic expansion.
306
+ storage_autoscaling_max_gb : Optional[float]
307
+ Maximum storage size in GB for autoscaling. 0 means no limit.
308
+ metrics_trace_sample_rate : Optional[float]
309
+ Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar.
310
+ metrics_slow_query_log_threshold_ms : Optional[float]
311
+ Threshold in ms above which queries are logged as slow. Forwarded to the sidecar.
312
+ sql_api_enabled : Optional[bool]
313
+ Enable the SQL API sidecar for this database.
314
+ sql_api_allowed_statements : Optional[List[str]]
315
+ Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE.
316
+ sql_api_max_rows : Optional[float]
317
+ Maximum rows returned per SQL API execution (1-1000000).
318
+ sql_api_max_bytes : Optional[float]
319
+ Maximum serialised SQL API result payload in bytes (1024-104857600).
320
+ sql_api_timeout_seconds : Optional[float]
321
+ Per-call SQL API execution timeout in seconds (1-300).
322
+
323
+ Returns
324
+ -------
325
+ DedicatedDatabase
326
+ API response as a typed Pydantic model
327
+
328
+ Raises
329
+ ------
330
+ AppwriteException
331
+ If API request fails
332
+ """
333
+
334
+ api_path = '/mysql/{databaseId}'
335
+ api_params = {}
336
+ if database_id is None:
337
+ raise AppwriteException('Missing required parameter: "database_id"')
338
+
339
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
340
+
341
+ if name is not None:
342
+ api_params['name'] = self._normalize_value(name)
343
+ if status is not None:
344
+ api_params['status'] = self._normalize_value(status)
345
+ if specification is not None:
346
+ api_params['specification'] = self._normalize_value(specification)
347
+ if replicas is not None:
348
+ api_params['replicas'] = self._normalize_value(replicas)
349
+ if sync_mode is not None:
350
+ api_params['syncMode'] = self._normalize_value(sync_mode)
351
+ if cross_region_replicas is not None:
352
+ api_params['crossRegionReplicas'] = self._normalize_value(cross_region_replicas)
353
+ if standby_region is not None:
354
+ api_params['standbyRegion'] = self._normalize_value(standby_region)
355
+ if network_idle_timeout_seconds is not None:
356
+ api_params['networkIdleTimeoutSeconds'] = self._normalize_value(network_idle_timeout_seconds)
357
+ if network_ip_allowlist is not None:
358
+ api_params['networkIPAllowlist'] = self._normalize_value(network_ip_allowlist)
359
+ if idle_timeout_minutes is not None:
360
+ api_params['idleTimeoutMinutes'] = self._normalize_value(idle_timeout_minutes)
361
+ if pitr is not None:
362
+ api_params['pitr'] = self._normalize_value(pitr)
363
+ if pitr_retention_days is not None:
364
+ api_params['pitrRetentionDays'] = self._normalize_value(pitr_retention_days)
365
+ if storage_autoscaling is not None:
366
+ api_params['storageAutoscaling'] = self._normalize_value(storage_autoscaling)
367
+ if storage_autoscaling_threshold_percent is not None:
368
+ api_params['storageAutoscalingThresholdPercent'] = self._normalize_value(storage_autoscaling_threshold_percent)
369
+ if storage_autoscaling_max_gb is not None:
370
+ api_params['storageAutoscalingMaxGb'] = self._normalize_value(storage_autoscaling_max_gb)
371
+ if metrics_trace_sample_rate is not None:
372
+ api_params['metricsTraceSampleRate'] = self._normalize_value(metrics_trace_sample_rate)
373
+ if metrics_slow_query_log_threshold_ms is not None:
374
+ api_params['metricsSlowQueryLogThresholdMs'] = self._normalize_value(metrics_slow_query_log_threshold_ms)
375
+ if sql_api_enabled is not None:
376
+ api_params['sqlApiEnabled'] = self._normalize_value(sql_api_enabled)
377
+ if sql_api_allowed_statements is not None:
378
+ api_params['sqlApiAllowedStatements'] = self._normalize_value(sql_api_allowed_statements)
379
+ if sql_api_max_rows is not None:
380
+ api_params['sqlApiMaxRows'] = self._normalize_value(sql_api_max_rows)
381
+ if sql_api_max_bytes is not None:
382
+ api_params['sqlApiMaxBytes'] = self._normalize_value(sql_api_max_bytes)
383
+ if sql_api_timeout_seconds is not None:
384
+ api_params['sqlApiTimeoutSeconds'] = self._normalize_value(sql_api_timeout_seconds)
385
+
386
+ response = self.client.call('patch', api_path, {
387
+ 'X-Appwrite-Project': self.client.get_config('project'),
388
+ 'content-type': 'application/json',
389
+ 'accept': 'application/json',
390
+ }, api_params)
391
+
392
+ return self._parse_response(response, model=DedicatedDatabase)
393
+
394
+
395
+ def delete(
396
+ self,
397
+ database_id: str
398
+ ) -> Dict[str, Any]:
399
+ """
400
+ Delete a dedicated database. This action is irreversible. The database status will be set to 'deleting' and all resources will be cleaned up. Deletion is allowed from any state, and repeating the call re-dispatches the cleanup.
401
+
402
+ Parameters
403
+ ----------
404
+ database_id : str
405
+ Database ID.
406
+
407
+ Returns
408
+ -------
409
+ Dict[str, Any]
410
+ API response as a dictionary
411
+
412
+ Raises
413
+ ------
414
+ AppwriteException
415
+ If API request fails
416
+ """
417
+
418
+ api_path = '/mysql/{databaseId}'
419
+ api_params = {}
420
+ if database_id is None:
421
+ raise AppwriteException('Missing required parameter: "database_id"')
422
+
423
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
424
+
425
+
426
+ response = self.client.call('delete', api_path, {
427
+ 'X-Appwrite-Project': self.client.get_config('project'),
428
+ 'content-type': 'application/json',
429
+ 'accept': 'application/json',
430
+ }, api_params)
431
+
432
+ return response
433
+
434
+
435
+ def list_backups(
436
+ self,
437
+ database_id: str,
438
+ queries: Optional[List[str]] = None
439
+ ) -> DedicatedDatabaseBackupList:
440
+ """
441
+ List all backups for a dedicated database. Results can be filtered by status and type.
442
+
443
+ Parameters
444
+ ----------
445
+ database_id : str
446
+ Database ID.
447
+ queries : Optional[List[str]]
448
+ Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: status, type, databaseId
449
+
450
+ Returns
451
+ -------
452
+ DedicatedDatabaseBackupList
453
+ API response as a typed Pydantic model
454
+
455
+ Raises
456
+ ------
457
+ AppwriteException
458
+ If API request fails
459
+ """
460
+
461
+ api_path = '/mysql/{databaseId}/backups'
462
+ api_params = {}
463
+ if database_id is None:
464
+ raise AppwriteException('Missing required parameter: "database_id"')
465
+
466
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
467
+
468
+ if queries is not None:
469
+ api_params['queries'] = self._normalize_value(queries)
470
+
471
+ response = self.client.call('get', api_path, {
472
+ 'X-Appwrite-Project': self.client.get_config('project'),
473
+ 'accept': 'application/json',
474
+ }, api_params)
475
+
476
+ return self._parse_response(response, model=DedicatedDatabaseBackupList)
477
+
478
+
479
+ def create_backup(
480
+ self,
481
+ database_id: str,
482
+ type: Optional[str] = None
483
+ ) -> DedicatedDatabaseBackup:
484
+ """
485
+ Create a manual backup of a dedicated database. The backup will be created asynchronously and its status can be checked via the get backup endpoint.
486
+
487
+ Parameters
488
+ ----------
489
+ database_id : str
490
+ Database ID.
491
+ type : Optional[str]
492
+ Backup type: full or incremental.
493
+
494
+ Returns
495
+ -------
496
+ DedicatedDatabaseBackup
497
+ API response as a typed Pydantic model
498
+
499
+ Raises
500
+ ------
501
+ AppwriteException
502
+ If API request fails
503
+ """
504
+
505
+ api_path = '/mysql/{databaseId}/backups'
506
+ api_params = {}
507
+ if database_id is None:
508
+ raise AppwriteException('Missing required parameter: "database_id"')
509
+
510
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
511
+
512
+ if type is not None:
513
+ api_params['type'] = self._normalize_value(type)
514
+
515
+ response = self.client.call('post', api_path, {
516
+ 'X-Appwrite-Project': self.client.get_config('project'),
517
+ 'content-type': 'application/json',
518
+ 'accept': 'application/json',
519
+ }, api_params)
520
+
521
+ return self._parse_response(response, model=DedicatedDatabaseBackup)
522
+
523
+
524
+ def list_backup_policies(
525
+ self,
526
+ database_id: str,
527
+ queries: Optional[List[str]] = None
528
+ ) -> BackupPolicyList:
529
+ """
530
+ List scheduled backup policies for a dedicated database.
531
+
532
+ Parameters
533
+ ----------
534
+ database_id : str
535
+ Database ID.
536
+ queries : Optional[List[str]]
537
+ Array of query strings generated using the Query class provided by the SDK.
538
+
539
+ Returns
540
+ -------
541
+ BackupPolicyList
542
+ API response as a typed Pydantic model
543
+
544
+ Raises
545
+ ------
546
+ AppwriteException
547
+ If API request fails
548
+ """
549
+
550
+ api_path = '/mysql/{databaseId}/backups/policies'
551
+ api_params = {}
552
+ if database_id is None:
553
+ raise AppwriteException('Missing required parameter: "database_id"')
554
+
555
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
556
+
557
+ if queries is not None:
558
+ api_params['queries'] = self._normalize_value(queries)
559
+
560
+ response = self.client.call('get', api_path, {
561
+ 'X-Appwrite-Project': self.client.get_config('project'),
562
+ 'accept': 'application/json',
563
+ }, api_params)
564
+
565
+ return self._parse_response(response, model=BackupPolicyList)
566
+
567
+
568
+ def create_backup_policy(
569
+ self,
570
+ database_id: str,
571
+ policy_id: str,
572
+ name: str,
573
+ schedule: str,
574
+ retention: float,
575
+ type: Optional[str] = None,
576
+ enabled: Optional[bool] = None
577
+ ) -> BackupPolicy:
578
+ """
579
+ Create a scheduled backup policy for a dedicated database.
580
+
581
+ Parameters
582
+ ----------
583
+ database_id : str
584
+ Database ID.
585
+ policy_id : str
586
+ Policy ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
587
+ name : str
588
+ Policy name. Max length: 128 chars.
589
+ schedule : str
590
+ Schedule CRON syntax.
591
+ retention : float
592
+ Days to keep backups before deletion.
593
+ type : Optional[str]
594
+ Backup type: full or incremental.
595
+ enabled : Optional[bool]
596
+ Is policy enabled? When disabled, no backups will be taken.
597
+
598
+ Returns
599
+ -------
600
+ BackupPolicy
601
+ API response as a typed Pydantic model
602
+
603
+ Raises
604
+ ------
605
+ AppwriteException
606
+ If API request fails
607
+ """
608
+
609
+ api_path = '/mysql/{databaseId}/backups/policies'
610
+ api_params = {}
611
+ if database_id is None:
612
+ raise AppwriteException('Missing required parameter: "database_id"')
613
+
614
+ if policy_id is None:
615
+ raise AppwriteException('Missing required parameter: "policy_id"')
616
+
617
+ if name is None:
618
+ raise AppwriteException('Missing required parameter: "name"')
619
+
620
+ if schedule is None:
621
+ raise AppwriteException('Missing required parameter: "schedule"')
622
+
623
+ if retention is None:
624
+ raise AppwriteException('Missing required parameter: "retention"')
625
+
626
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
627
+
628
+ api_params['policyId'] = self._normalize_value(policy_id)
629
+ api_params['name'] = self._normalize_value(name)
630
+ api_params['schedule'] = self._normalize_value(schedule)
631
+ api_params['retention'] = self._normalize_value(retention)
632
+ if type is not None:
633
+ api_params['type'] = self._normalize_value(type)
634
+ if enabled is not None:
635
+ api_params['enabled'] = self._normalize_value(enabled)
636
+
637
+ response = self.client.call('post', api_path, {
638
+ 'X-Appwrite-Project': self.client.get_config('project'),
639
+ 'content-type': 'application/json',
640
+ 'accept': 'application/json',
641
+ }, api_params)
642
+
643
+ return self._parse_response(response, model=BackupPolicy)
644
+
645
+
646
+ def get_backup_policy(
647
+ self,
648
+ database_id: str,
649
+ policy_id: str
650
+ ) -> BackupPolicy:
651
+ """
652
+ Get a scheduled backup policy for a dedicated database.
653
+
654
+ Parameters
655
+ ----------
656
+ database_id : str
657
+ Database ID.
658
+ policy_id : str
659
+ Policy ID.
660
+
661
+ Returns
662
+ -------
663
+ BackupPolicy
664
+ API response as a typed Pydantic model
665
+
666
+ Raises
667
+ ------
668
+ AppwriteException
669
+ If API request fails
670
+ """
671
+
672
+ api_path = '/mysql/{databaseId}/backups/policies/{policyId}'
673
+ api_params = {}
674
+ if database_id is None:
675
+ raise AppwriteException('Missing required parameter: "database_id"')
676
+
677
+ if policy_id is None:
678
+ raise AppwriteException('Missing required parameter: "policy_id"')
679
+
680
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
681
+ api_path = api_path.replace('{policyId}', str(self._normalize_value(policy_id)))
682
+
683
+
684
+ response = self.client.call('get', api_path, {
685
+ 'X-Appwrite-Project': self.client.get_config('project'),
686
+ 'accept': 'application/json',
687
+ }, api_params)
688
+
689
+ return self._parse_response(response, model=BackupPolicy)
690
+
691
+
692
+ def update_backup_policy(
693
+ self,
694
+ database_id: str,
695
+ policy_id: str,
696
+ name: Optional[str] = None,
697
+ schedule: Optional[str] = None,
698
+ retention: Optional[float] = None,
699
+ enabled: Optional[bool] = None
700
+ ) -> BackupPolicy:
701
+ """
702
+ Update a scheduled backup policy for a dedicated database.
703
+
704
+ Parameters
705
+ ----------
706
+ database_id : str
707
+ Database ID.
708
+ policy_id : str
709
+ Policy ID.
710
+ name : Optional[str]
711
+ Policy name. Max length: 128 chars.
712
+ schedule : Optional[str]
713
+ Schedule CRON syntax.
714
+ retention : Optional[float]
715
+ Days to keep backups before deletion.
716
+ enabled : Optional[bool]
717
+ Is policy enabled? When disabled, no backups will be taken.
718
+
719
+ Returns
720
+ -------
721
+ BackupPolicy
722
+ API response as a typed Pydantic model
723
+
724
+ Raises
725
+ ------
726
+ AppwriteException
727
+ If API request fails
728
+ """
729
+
730
+ api_path = '/mysql/{databaseId}/backups/policies/{policyId}'
731
+ api_params = {}
732
+ if database_id is None:
733
+ raise AppwriteException('Missing required parameter: "database_id"')
734
+
735
+ if policy_id is None:
736
+ raise AppwriteException('Missing required parameter: "policy_id"')
737
+
738
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
739
+ api_path = api_path.replace('{policyId}', str(self._normalize_value(policy_id)))
740
+
741
+ if name is not None:
742
+ api_params['name'] = self._normalize_value(name)
743
+ if schedule is not None:
744
+ api_params['schedule'] = self._normalize_value(schedule)
745
+ if retention is not None:
746
+ api_params['retention'] = self._normalize_value(retention)
747
+ if enabled is not None:
748
+ api_params['enabled'] = self._normalize_value(enabled)
749
+
750
+ response = self.client.call('patch', api_path, {
751
+ 'X-Appwrite-Project': self.client.get_config('project'),
752
+ 'content-type': 'application/json',
753
+ 'accept': 'application/json',
754
+ }, api_params)
755
+
756
+ return self._parse_response(response, model=BackupPolicy)
757
+
758
+
759
+ def delete_backup_policy(
760
+ self,
761
+ database_id: str,
762
+ policy_id: str
763
+ ) -> Dict[str, Any]:
764
+ """
765
+ Delete a scheduled backup policy for a dedicated database. Backups already taken by the policy are kept until their retention expires.
766
+
767
+ Parameters
768
+ ----------
769
+ database_id : str
770
+ Database ID.
771
+ policy_id : str
772
+ Policy ID.
773
+
774
+ Returns
775
+ -------
776
+ Dict[str, Any]
777
+ API response as a dictionary
778
+
779
+ Raises
780
+ ------
781
+ AppwriteException
782
+ If API request fails
783
+ """
784
+
785
+ api_path = '/mysql/{databaseId}/backups/policies/{policyId}'
786
+ api_params = {}
787
+ if database_id is None:
788
+ raise AppwriteException('Missing required parameter: "database_id"')
789
+
790
+ if policy_id is None:
791
+ raise AppwriteException('Missing required parameter: "policy_id"')
792
+
793
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
794
+ api_path = api_path.replace('{policyId}', str(self._normalize_value(policy_id)))
795
+
796
+
797
+ response = self.client.call('delete', api_path, {
798
+ 'X-Appwrite-Project': self.client.get_config('project'),
799
+ 'content-type': 'application/json',
800
+ 'accept': 'application/json',
801
+ }, api_params)
802
+
803
+ return response
804
+
805
+
806
+ def update_backup_storage(
807
+ self,
808
+ database_id: str,
809
+ provider: str,
810
+ bucket: str,
811
+ access_key: str,
812
+ secret_key: str,
813
+ region: Optional[str] = None,
814
+ prefix: Optional[str] = None,
815
+ endpoint: Optional[str] = None
816
+ ) -> DedicatedDatabaseBackupStorage:
817
+ """
818
+ Configure off-cluster backup storage for a dedicated database. Supports S3, GCS, and Azure Blob Storage destinations. Backups will be stored to the configured destination in addition to on-cluster storage.
819
+
820
+ Parameters
821
+ ----------
822
+ database_id : str
823
+ Database ID.
824
+ provider : str
825
+ Storage provider for off-cluster backups. Allowed values: s3 (Amazon S3 or S3-compatible), gcs (Google Cloud Storage), azure (Azure Blob Storage).
826
+ bucket : str
827
+ Storage bucket or container name.
828
+ access_key : str
829
+ Access key or client ID for authentication.
830
+ secret_key : str
831
+ Secret key or service account JSON for authentication.
832
+ region : Optional[str]
833
+ Storage region.
834
+ prefix : Optional[str]
835
+ Object key prefix for backups.
836
+ endpoint : Optional[str]
837
+ Custom endpoint for S3-compatible storage (e.g. MinIO).
838
+
839
+ Returns
840
+ -------
841
+ DedicatedDatabaseBackupStorage
842
+ API response as a typed Pydantic model
843
+
844
+ Raises
845
+ ------
846
+ AppwriteException
847
+ If API request fails
848
+ """
849
+
850
+ api_path = '/mysql/{databaseId}/backups/storage'
851
+ api_params = {}
852
+ if database_id is None:
853
+ raise AppwriteException('Missing required parameter: "database_id"')
854
+
855
+ if provider is None:
856
+ raise AppwriteException('Missing required parameter: "provider"')
857
+
858
+ if bucket is None:
859
+ raise AppwriteException('Missing required parameter: "bucket"')
860
+
861
+ if access_key is None:
862
+ raise AppwriteException('Missing required parameter: "access_key"')
863
+
864
+ if secret_key is None:
865
+ raise AppwriteException('Missing required parameter: "secret_key"')
866
+
867
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
868
+
869
+ api_params['provider'] = self._normalize_value(provider)
870
+ api_params['bucket'] = self._normalize_value(bucket)
871
+ if region is not None:
872
+ api_params['region'] = self._normalize_value(region)
873
+ if prefix is not None:
874
+ api_params['prefix'] = self._normalize_value(prefix)
875
+ if endpoint is not None:
876
+ api_params['endpoint'] = self._normalize_value(endpoint)
877
+ api_params['accessKey'] = self._normalize_value(access_key)
878
+ api_params['secretKey'] = self._normalize_value(secret_key)
879
+
880
+ response = self.client.call('put', api_path, {
881
+ 'X-Appwrite-Project': self.client.get_config('project'),
882
+ 'content-type': 'application/json',
883
+ 'accept': 'application/json',
884
+ }, api_params)
885
+
886
+ return self._parse_response(response, model=DedicatedDatabaseBackupStorage)
887
+
888
+
889
+ def get_backup(
890
+ self,
891
+ database_id: str,
892
+ backup_id: str
893
+ ) -> DedicatedDatabaseBackup:
894
+ """
895
+ Get details of a specific database backup including its status, size, and timestamps.
896
+
897
+ Parameters
898
+ ----------
899
+ database_id : str
900
+ Database ID.
901
+ backup_id : str
902
+ Backup ID.
903
+
904
+ Returns
905
+ -------
906
+ DedicatedDatabaseBackup
907
+ API response as a typed Pydantic model
908
+
909
+ Raises
910
+ ------
911
+ AppwriteException
912
+ If API request fails
913
+ """
914
+
915
+ api_path = '/mysql/{databaseId}/backups/{backupId}'
916
+ api_params = {}
917
+ if database_id is None:
918
+ raise AppwriteException('Missing required parameter: "database_id"')
919
+
920
+ if backup_id is None:
921
+ raise AppwriteException('Missing required parameter: "backup_id"')
922
+
923
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
924
+ api_path = api_path.replace('{backupId}', str(self._normalize_value(backup_id)))
925
+
926
+
927
+ response = self.client.call('get', api_path, {
928
+ 'X-Appwrite-Project': self.client.get_config('project'),
929
+ 'accept': 'application/json',
930
+ }, api_params)
931
+
932
+ return self._parse_response(response, model=DedicatedDatabaseBackup)
933
+
934
+
935
+ def delete_backup(
936
+ self,
937
+ database_id: str,
938
+ backup_id: str
939
+ ) -> Dict[str, Any]:
940
+ """
941
+ Delete a database backup. This will permanently remove the backup from storage and cannot be undone.
942
+
943
+ Parameters
944
+ ----------
945
+ database_id : str
946
+ Database ID.
947
+ backup_id : str
948
+ Backup ID.
949
+
950
+ Returns
951
+ -------
952
+ Dict[str, Any]
953
+ API response as a dictionary
954
+
955
+ Raises
956
+ ------
957
+ AppwriteException
958
+ If API request fails
959
+ """
960
+
961
+ api_path = '/mysql/{databaseId}/backups/{backupId}'
962
+ api_params = {}
963
+ if database_id is None:
964
+ raise AppwriteException('Missing required parameter: "database_id"')
965
+
966
+ if backup_id is None:
967
+ raise AppwriteException('Missing required parameter: "backup_id"')
968
+
969
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
970
+ api_path = api_path.replace('{backupId}', str(self._normalize_value(backup_id)))
971
+
972
+
973
+ response = self.client.call('delete', api_path, {
974
+ 'X-Appwrite-Project': self.client.get_config('project'),
975
+ 'content-type': 'application/json',
976
+ 'accept': 'application/json',
977
+ }, api_params)
978
+
979
+ return response
980
+
981
+
982
+ def list_branches(
983
+ self,
984
+ database_id: str
985
+ ) -> DedicatedDatabaseBranchList:
986
+ """
987
+ List all ephemeral branches for a dedicated database. Returns branch metadata including ID, name, namespace, and expiration time.
988
+
989
+ Parameters
990
+ ----------
991
+ database_id : str
992
+ Database ID.
993
+
994
+ Returns
995
+ -------
996
+ DedicatedDatabaseBranchList
997
+ API response as a typed Pydantic model
998
+
999
+ Raises
1000
+ ------
1001
+ AppwriteException
1002
+ If API request fails
1003
+ """
1004
+
1005
+ api_path = '/mysql/{databaseId}/branches'
1006
+ api_params = {}
1007
+ if database_id is None:
1008
+ raise AppwriteException('Missing required parameter: "database_id"')
1009
+
1010
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1011
+
1012
+
1013
+ response = self.client.call('get', api_path, {
1014
+ 'X-Appwrite-Project': self.client.get_config('project'),
1015
+ 'accept': 'application/json',
1016
+ }, api_params)
1017
+
1018
+ return self._parse_response(response, model=DedicatedDatabaseBranchList)
1019
+
1020
+
1021
+ def create_branch(
1022
+ self,
1023
+ database_id: str,
1024
+ branch_id: Optional[str] = None,
1025
+ ttl: Optional[float] = None
1026
+ ) -> DedicatedDatabase:
1027
+ """
1028
+ Create an ephemeral database branch from the primary via PVC snapshot. The branch is a full copy of the database at the current point in time, useful for testing schema migrations or running experiments without affecting production data. Branches expire after the configured TTL (default 24 hours). The branch is created asynchronously.
1029
+
1030
+ Parameters
1031
+ ----------
1032
+ database_id : str
1033
+ Database ID.
1034
+ branch_id : Optional[str]
1035
+ Branch ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
1036
+ ttl : Optional[float]
1037
+ Time-to-live in seconds before the branch expires. Min 300 (5 min), max 604800 (7 days). Default: 86400 (24h).
1038
+
1039
+ Returns
1040
+ -------
1041
+ DedicatedDatabase
1042
+ API response as a typed Pydantic model
1043
+
1044
+ Raises
1045
+ ------
1046
+ AppwriteException
1047
+ If API request fails
1048
+ """
1049
+
1050
+ api_path = '/mysql/{databaseId}/branches'
1051
+ api_params = {}
1052
+ if database_id is None:
1053
+ raise AppwriteException('Missing required parameter: "database_id"')
1054
+
1055
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1056
+
1057
+ if branch_id is not None:
1058
+ api_params['branchId'] = self._normalize_value(branch_id)
1059
+ if ttl is not None:
1060
+ api_params['ttl'] = self._normalize_value(ttl)
1061
+
1062
+ response = self.client.call('post', api_path, {
1063
+ 'X-Appwrite-Project': self.client.get_config('project'),
1064
+ 'content-type': 'application/json',
1065
+ 'accept': 'application/json',
1066
+ }, api_params)
1067
+
1068
+ return self._parse_response(response, model=DedicatedDatabase)
1069
+
1070
+
1071
+ def delete_branch(
1072
+ self,
1073
+ database_id: str,
1074
+ branch_id: str
1075
+ ) -> DedicatedDatabase:
1076
+ """
1077
+ Delete an ephemeral database branch. This removes the branch namespace, its PVC, and the associated VolumeSnapshot. The deletion runs asynchronously and is irreversible.
1078
+
1079
+ Parameters
1080
+ ----------
1081
+ database_id : str
1082
+ Database ID.
1083
+ branch_id : str
1084
+ Branch ID.
1085
+
1086
+ Returns
1087
+ -------
1088
+ DedicatedDatabase
1089
+ API response as a typed Pydantic model
1090
+
1091
+ Raises
1092
+ ------
1093
+ AppwriteException
1094
+ If API request fails
1095
+ """
1096
+
1097
+ api_path = '/mysql/{databaseId}/branches/{branchId}'
1098
+ api_params = {}
1099
+ if database_id is None:
1100
+ raise AppwriteException('Missing required parameter: "database_id"')
1101
+
1102
+ if branch_id is None:
1103
+ raise AppwriteException('Missing required parameter: "branch_id"')
1104
+
1105
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1106
+ api_path = api_path.replace('{branchId}', str(self._normalize_value(branch_id)))
1107
+
1108
+
1109
+ response = self.client.call('delete', api_path, {
1110
+ 'X-Appwrite-Project': self.client.get_config('project'),
1111
+ 'content-type': 'application/json',
1112
+ 'accept': 'application/json',
1113
+ }, api_params)
1114
+
1115
+ return self._parse_response(response, model=DedicatedDatabase)
1116
+
1117
+
1118
+ def update_credentials(
1119
+ self,
1120
+ database_id: str
1121
+ ) -> DedicatedDatabase:
1122
+ """
1123
+ Rotate the primary connection credentials for a dedicated database. Generates a new password and updates the database atomically. Previous credentials stop working immediately. Returns the database with a refreshed connection string carrying the new password.
1124
+
1125
+ Parameters
1126
+ ----------
1127
+ database_id : str
1128
+ Database ID.
1129
+
1130
+ Returns
1131
+ -------
1132
+ DedicatedDatabase
1133
+ API response as a typed Pydantic model
1134
+
1135
+ Raises
1136
+ ------
1137
+ AppwriteException
1138
+ If API request fails
1139
+ """
1140
+
1141
+ api_path = '/mysql/{databaseId}/credentials'
1142
+ api_params = {}
1143
+ if database_id is None:
1144
+ raise AppwriteException('Missing required parameter: "database_id"')
1145
+
1146
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1147
+
1148
+
1149
+ response = self.client.call('patch', api_path, {
1150
+ 'X-Appwrite-Project': self.client.get_config('project'),
1151
+ 'content-type': 'application/json',
1152
+ 'accept': 'application/json',
1153
+ }, api_params)
1154
+
1155
+ return self._parse_response(response, model=DedicatedDatabase)
1156
+
1157
+
1158
+ def create_execution(
1159
+ self,
1160
+ database_id: str,
1161
+ sql: str,
1162
+ bindings: Optional[Dict[str, Any]] = None,
1163
+ timeout_seconds: Optional[float] = None
1164
+ ) -> DedicatedDatabaseExecution:
1165
+ """
1166
+ Execute SQL through the console-facing Cloud endpoint. Cloud proxies through the edge platform to the per-database SQL API sidecar. Application traffic should bypass cloud entirely and POST directly to the per-database hostname: `https://db-{project}-{db}.{region}.appwrite.center/v1/sql/executions` with an `X-Appwrite-Key` header — that path scales to the whole DB fleet without a per-query cloud round-trip. The statement type must be on the database's configured allow-list. Use bound parameters for any user-supplied values — the API does not interpolate raw strings.
1167
+
1168
+ Parameters
1169
+ ----------
1170
+ database_id : str
1171
+ Database ID.
1172
+ sql : str
1173
+ SQL statement to execute. Exactly one statement per request.
1174
+ bindings : Optional[Dict[str, Any]]
1175
+ Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL.
1176
+ timeout_seconds : Optional[float]
1177
+ Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds.
1178
+
1179
+ Returns
1180
+ -------
1181
+ DedicatedDatabaseExecution
1182
+ API response as a typed Pydantic model
1183
+
1184
+ Raises
1185
+ ------
1186
+ AppwriteException
1187
+ If API request fails
1188
+ """
1189
+
1190
+ api_path = '/mysql/{databaseId}/executions'
1191
+ api_params = {}
1192
+ if database_id is None:
1193
+ raise AppwriteException('Missing required parameter: "database_id"')
1194
+
1195
+ if sql is None:
1196
+ raise AppwriteException('Missing required parameter: "sql"')
1197
+
1198
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1199
+
1200
+ api_params['sql'] = self._normalize_value(sql)
1201
+ if bindings is not None:
1202
+ api_params['bindings'] = self._normalize_value(bindings)
1203
+ if timeout_seconds is not None:
1204
+ api_params['timeoutSeconds'] = self._normalize_value(timeout_seconds)
1205
+
1206
+ response = self.client.call('post', api_path, {
1207
+ 'X-Appwrite-Project': self.client.get_config('project'),
1208
+ 'content-type': 'application/json',
1209
+ 'accept': 'application/json',
1210
+ }, api_params)
1211
+
1212
+ return self._parse_response(response, model=DedicatedDatabaseExecution)
1213
+
1214
+
1215
+ def create_failover(
1216
+ self,
1217
+ database_id: str,
1218
+ target_replica_id: Optional[str] = None
1219
+ ) -> DedicatedDatabase:
1220
+ """
1221
+ Trigger a manual failover for a dedicated database with high availability enabled. Promotes a replica to primary. The failover runs asynchronously; poll the database document for status updates. A database left mid-operation by a failover that did not finish also accepts this call as a repair, provided `targetReplicaId` names the member to promote.
1222
+
1223
+ Parameters
1224
+ ----------
1225
+ database_id : str
1226
+ Database ID.
1227
+ target_replica_id : Optional[str]
1228
+ Target replica ID to promote. If not specified, the healthiest replica is selected.
1229
+
1230
+ Returns
1231
+ -------
1232
+ DedicatedDatabase
1233
+ API response as a typed Pydantic model
1234
+
1235
+ Raises
1236
+ ------
1237
+ AppwriteException
1238
+ If API request fails
1239
+ """
1240
+
1241
+ api_path = '/mysql/{databaseId}/failovers'
1242
+ api_params = {}
1243
+ if database_id is None:
1244
+ raise AppwriteException('Missing required parameter: "database_id"')
1245
+
1246
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1247
+
1248
+ if target_replica_id is not None:
1249
+ api_params['targetReplicaId'] = self._normalize_value(target_replica_id)
1250
+
1251
+ response = self.client.call('post', api_path, {
1252
+ 'X-Appwrite-Project': self.client.get_config('project'),
1253
+ 'content-type': 'application/json',
1254
+ 'accept': 'application/json',
1255
+ }, api_params)
1256
+
1257
+ return self._parse_response(response, model=DedicatedDatabase)
1258
+
1259
+
1260
+ def update_maintenance(
1261
+ self,
1262
+ database_id: str,
1263
+ day: str,
1264
+ hour_utc: float
1265
+ ) -> DedicatedDatabase:
1266
+ """
1267
+ Update the maintenance window for a dedicated database. Maintenance operations like minor version upgrades will be performed during this window.
1268
+
1269
+ Parameters
1270
+ ----------
1271
+ database_id : str
1272
+ Database ID.
1273
+ day : str
1274
+ Day of the week for the maintenance window. Allowed values: sun, mon, tue, wed, thu, fri, sat.
1275
+ hour_utc : float
1276
+ Hour in UTC (0-23) for maintenance window start.
1277
+
1278
+ Returns
1279
+ -------
1280
+ DedicatedDatabase
1281
+ API response as a typed Pydantic model
1282
+
1283
+ Raises
1284
+ ------
1285
+ AppwriteException
1286
+ If API request fails
1287
+ """
1288
+
1289
+ api_path = '/mysql/{databaseId}/maintenance'
1290
+ api_params = {}
1291
+ if database_id is None:
1292
+ raise AppwriteException('Missing required parameter: "database_id"')
1293
+
1294
+ if day is None:
1295
+ raise AppwriteException('Missing required parameter: "day"')
1296
+
1297
+ if hour_utc is None:
1298
+ raise AppwriteException('Missing required parameter: "hour_utc"')
1299
+
1300
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1301
+
1302
+ api_params['day'] = self._normalize_value(day)
1303
+ api_params['hourUtc'] = self._normalize_value(hour_utc)
1304
+
1305
+ response = self.client.call('patch', api_path, {
1306
+ 'X-Appwrite-Project': self.client.get_config('project'),
1307
+ 'content-type': 'application/json',
1308
+ 'accept': 'application/json',
1309
+ }, api_params)
1310
+
1311
+ return self._parse_response(response, model=DedicatedDatabase)
1312
+
1313
+
1314
+ def create_migration(
1315
+ self,
1316
+ database_id: str,
1317
+ target_type: str,
1318
+ specification: Optional[str] = None
1319
+ ) -> DedicatedDatabase:
1320
+ """
1321
+ Migrate a database between shared and dedicated types. Shared to dedicated provisions an always-on dedicated instance; dedicated to shared converts to a serverless instance that scales to zero when idle. Data is copied to the target with a brief read-only window during cutover.
1322
+
1323
+ Parameters
1324
+ ----------
1325
+ database_id : str
1326
+ Database ID.
1327
+ target_type : str
1328
+ Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources).
1329
+ specification : Optional[str]
1330
+ Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification.
1331
+
1332
+ Returns
1333
+ -------
1334
+ DedicatedDatabase
1335
+ API response as a typed Pydantic model
1336
+
1337
+ Raises
1338
+ ------
1339
+ AppwriteException
1340
+ If API request fails
1341
+ """
1342
+
1343
+ api_path = '/mysql/{databaseId}/migrations'
1344
+ api_params = {}
1345
+ if database_id is None:
1346
+ raise AppwriteException('Missing required parameter: "database_id"')
1347
+
1348
+ if target_type is None:
1349
+ raise AppwriteException('Missing required parameter: "target_type"')
1350
+
1351
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1352
+
1353
+ api_params['targetType'] = self._normalize_value(target_type)
1354
+ if specification is not None:
1355
+ api_params['specification'] = self._normalize_value(specification)
1356
+
1357
+ response = self.client.call('post', api_path, {
1358
+ 'X-Appwrite-Project': self.client.get_config('project'),
1359
+ 'content-type': 'application/json',
1360
+ 'accept': 'application/json',
1361
+ }, api_params)
1362
+
1363
+ return self._parse_response(response, model=DedicatedDatabase)
1364
+
1365
+
1366
+ def list_operations(
1367
+ self,
1368
+ database_id: str,
1369
+ status: Optional[str] = None,
1370
+ limit: Optional[float] = None,
1371
+ offset: Optional[float] = None
1372
+ ) -> DedicatedDatabaseOperationList:
1373
+ """
1374
+ List the lifecycle operations recorded for a dedicated database, newest first. Every provision, update, restore, backup and replication action is recorded here with its outcome, including an attempt that was abandoned because another worker took over the database.
1375
+
1376
+ Parameters
1377
+ ----------
1378
+ database_id : str
1379
+ Database ID.
1380
+ status : Optional[str]
1381
+ Filter by operation status.
1382
+ limit : Optional[float]
1383
+ Maximum number of operations to return.
1384
+ offset : Optional[float]
1385
+ Number of operations to skip.
1386
+
1387
+ Returns
1388
+ -------
1389
+ DedicatedDatabaseOperationList
1390
+ API response as a typed Pydantic model
1391
+
1392
+ Raises
1393
+ ------
1394
+ AppwriteException
1395
+ If API request fails
1396
+ """
1397
+
1398
+ api_path = '/mysql/{databaseId}/operations'
1399
+ api_params = {}
1400
+ if database_id is None:
1401
+ raise AppwriteException('Missing required parameter: "database_id"')
1402
+
1403
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1404
+
1405
+ if status is not None:
1406
+ api_params['status'] = self._normalize_value(status)
1407
+ if limit is not None:
1408
+ api_params['limit'] = self._normalize_value(limit)
1409
+ if offset is not None:
1410
+ api_params['offset'] = self._normalize_value(offset)
1411
+
1412
+ response = self.client.call('get', api_path, {
1413
+ 'X-Appwrite-Project': self.client.get_config('project'),
1414
+ 'accept': 'application/json',
1415
+ }, api_params)
1416
+
1417
+ return self._parse_response(response, model=DedicatedDatabaseOperationList)
1418
+
1419
+
1420
+ def get_pitr(
1421
+ self,
1422
+ database_id: str
1423
+ ) -> DedicatedDatabasePITRWindows:
1424
+ """
1425
+ Get available point-in-time recovery windows for a dedicated database. Returns the earliest and latest recovery points.
1426
+
1427
+ Parameters
1428
+ ----------
1429
+ database_id : str
1430
+ Database ID.
1431
+
1432
+ Returns
1433
+ -------
1434
+ DedicatedDatabasePITRWindows
1435
+ API response as a typed Pydantic model
1436
+
1437
+ Raises
1438
+ ------
1439
+ AppwriteException
1440
+ If API request fails
1441
+ """
1442
+
1443
+ api_path = '/mysql/{databaseId}/pitr'
1444
+ api_params = {}
1445
+ if database_id is None:
1446
+ raise AppwriteException('Missing required parameter: "database_id"')
1447
+
1448
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1449
+
1450
+
1451
+ response = self.client.call('get', api_path, {
1452
+ 'X-Appwrite-Project': self.client.get_config('project'),
1453
+ 'accept': 'application/json',
1454
+ }, api_params)
1455
+
1456
+ return self._parse_response(response, model=DedicatedDatabasePITRWindows)
1457
+
1458
+
1459
+ def get_pooler(
1460
+ self,
1461
+ database_id: str
1462
+ ) -> DedicatedDatabasePooler:
1463
+ """
1464
+ Get the connection pooler configuration for a dedicated database. Returns pooler mode, max connections, and pool size settings.
1465
+
1466
+ Parameters
1467
+ ----------
1468
+ database_id : str
1469
+ Database ID.
1470
+
1471
+ Returns
1472
+ -------
1473
+ DedicatedDatabasePooler
1474
+ API response as a typed Pydantic model
1475
+
1476
+ Raises
1477
+ ------
1478
+ AppwriteException
1479
+ If API request fails
1480
+ """
1481
+
1482
+ api_path = '/mysql/{databaseId}/pooler'
1483
+ api_params = {}
1484
+ if database_id is None:
1485
+ raise AppwriteException('Missing required parameter: "database_id"')
1486
+
1487
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1488
+
1489
+
1490
+ response = self.client.call('get', api_path, {
1491
+ 'X-Appwrite-Project': self.client.get_config('project'),
1492
+ 'accept': 'application/json',
1493
+ }, api_params)
1494
+
1495
+ return self._parse_response(response, model=DedicatedDatabasePooler)
1496
+
1497
+
1498
+ def update_pooler(
1499
+ self,
1500
+ database_id: str,
1501
+ mode: Optional[str] = None,
1502
+ max_connections: Optional[float] = None,
1503
+ default_pool_size: Optional[float] = None,
1504
+ read_write_splitting: Optional[bool] = None,
1505
+ pooler_cpu_request: Optional[str] = None,
1506
+ pooler_cpu_limit: Optional[str] = None,
1507
+ pooler_memory_request: Optional[str] = None,
1508
+ pooler_memory_limit: Optional[str] = None
1509
+ ) -> DedicatedDatabasePooler:
1510
+ """
1511
+ Update the connection pooler configuration for a dedicated database. Configure pool mode, max connections, and pool sizes.
1512
+
1513
+ Parameters
1514
+ ----------
1515
+ database_id : str
1516
+ Database ID.
1517
+ mode : Optional[str]
1518
+ Connection pool mode. Allowed values: transaction, session. Transaction mode returns connections to the pool after each transaction; session mode holds connections for the entire session lifetime.
1519
+ max_connections : Optional[float]
1520
+ Client-connection ceiling the pooler accepts. Supported on MySQL and MariaDB only; the PostgreSQL pooler has no client cap, so set networkMaxConnections on the database instead.
1521
+ default_pool_size : Optional[float]
1522
+ Default pool size per user.
1523
+ read_write_splitting : Optional[bool]
1524
+ Route SELECTs to HA replicas, writes and locked reads to the primary. Defaults to true when HA is enabled.
1525
+ pooler_cpu_request : Optional[str]
1526
+ Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m).
1527
+ pooler_cpu_limit : Optional[str]
1528
+ Pooler sidecar CPU limit override (Kubernetes quantity, e.g. "500m" or "1"). Leave null for the proportional default (10% of DB CPU, floor 200m). Changing this field rolls the database pod.
1529
+ pooler_memory_request : Optional[str]
1530
+ Pooler sidecar memory request override (Kubernetes quantity, e.g. "128Mi" or "1Gi"). Leave null for the proportional default (7.5% of DB memory, floor 64Mi).
1531
+ pooler_memory_limit : Optional[str]
1532
+ Pooler sidecar memory limit override (Kubernetes quantity, e.g. "256Mi" or "1Gi"). Leave null for the proportional default (15% of DB memory, floor 128Mi). Changing this field rolls the database pod.
1533
+
1534
+ Returns
1535
+ -------
1536
+ DedicatedDatabasePooler
1537
+ API response as a typed Pydantic model
1538
+
1539
+ Raises
1540
+ ------
1541
+ AppwriteException
1542
+ If API request fails
1543
+ """
1544
+
1545
+ api_path = '/mysql/{databaseId}/pooler'
1546
+ api_params = {}
1547
+ if database_id is None:
1548
+ raise AppwriteException('Missing required parameter: "database_id"')
1549
+
1550
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1551
+
1552
+ if mode is not None:
1553
+ api_params['mode'] = self._normalize_value(mode)
1554
+ if max_connections is not None:
1555
+ api_params['maxConnections'] = self._normalize_value(max_connections)
1556
+ if default_pool_size is not None:
1557
+ api_params['defaultPoolSize'] = self._normalize_value(default_pool_size)
1558
+ if read_write_splitting is not None:
1559
+ api_params['readWriteSplitting'] = self._normalize_value(read_write_splitting)
1560
+ if pooler_cpu_request is not None:
1561
+ api_params['poolerCpuRequest'] = self._normalize_value(pooler_cpu_request)
1562
+ if pooler_cpu_limit is not None:
1563
+ api_params['poolerCpuLimit'] = self._normalize_value(pooler_cpu_limit)
1564
+ if pooler_memory_request is not None:
1565
+ api_params['poolerMemoryRequest'] = self._normalize_value(pooler_memory_request)
1566
+ if pooler_memory_limit is not None:
1567
+ api_params['poolerMemoryLimit'] = self._normalize_value(pooler_memory_limit)
1568
+
1569
+ response = self.client.call('patch', api_path, {
1570
+ 'X-Appwrite-Project': self.client.get_config('project'),
1571
+ 'content-type': 'application/json',
1572
+ 'accept': 'application/json',
1573
+ }, api_params)
1574
+
1575
+ return self._parse_response(response, model=DedicatedDatabasePooler)
1576
+
1577
+
1578
+ def get_replicas(
1579
+ self,
1580
+ database_id: str
1581
+ ) -> DedicatedDatabaseReplicas:
1582
+ """
1583
+ Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode.
1584
+
1585
+ Parameters
1586
+ ----------
1587
+ database_id : str
1588
+ Database ID.
1589
+
1590
+ Returns
1591
+ -------
1592
+ DedicatedDatabaseReplicas
1593
+ API response as a typed Pydantic model
1594
+
1595
+ Raises
1596
+ ------
1597
+ AppwriteException
1598
+ If API request fails
1599
+ """
1600
+
1601
+ api_path = '/mysql/{databaseId}/replicas'
1602
+ api_params = {}
1603
+ if database_id is None:
1604
+ raise AppwriteException('Missing required parameter: "database_id"')
1605
+
1606
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1607
+
1608
+
1609
+ response = self.client.call('get', api_path, {
1610
+ 'X-Appwrite-Project': self.client.get_config('project'),
1611
+ 'accept': 'application/json',
1612
+ }, api_params)
1613
+
1614
+ return self._parse_response(response, model=DedicatedDatabaseReplicas)
1615
+
1616
+
1617
+ def list_restorations(
1618
+ self,
1619
+ database_id: str,
1620
+ status: Optional[str] = None,
1621
+ type: Optional[str] = None,
1622
+ limit: Optional[float] = None,
1623
+ offset: Optional[float] = None
1624
+ ) -> DedicatedDatabaseRestorationList:
1625
+ """
1626
+ List all restorations for a dedicated database. Results can be filtered by status and type.
1627
+
1628
+ Parameters
1629
+ ----------
1630
+ database_id : str
1631
+ Database ID.
1632
+ status : Optional[str]
1633
+ Filter by restoration status.
1634
+ type : Optional[str]
1635
+ Filter by restoration type.
1636
+ limit : Optional[float]
1637
+ Maximum number of restorations to return.
1638
+ offset : Optional[float]
1639
+ Number of restorations to skip.
1640
+
1641
+ Returns
1642
+ -------
1643
+ DedicatedDatabaseRestorationList
1644
+ API response as a typed Pydantic model
1645
+
1646
+ Raises
1647
+ ------
1648
+ AppwriteException
1649
+ If API request fails
1650
+ """
1651
+
1652
+ api_path = '/mysql/{databaseId}/restorations'
1653
+ api_params = {}
1654
+ if database_id is None:
1655
+ raise AppwriteException('Missing required parameter: "database_id"')
1656
+
1657
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1658
+
1659
+ if status is not None:
1660
+ api_params['status'] = self._normalize_value(status)
1661
+ if type is not None:
1662
+ api_params['type'] = self._normalize_value(type)
1663
+ if limit is not None:
1664
+ api_params['limit'] = self._normalize_value(limit)
1665
+ if offset is not None:
1666
+ api_params['offset'] = self._normalize_value(offset)
1667
+
1668
+ response = self.client.call('get', api_path, {
1669
+ 'X-Appwrite-Project': self.client.get_config('project'),
1670
+ 'accept': 'application/json',
1671
+ }, api_params)
1672
+
1673
+ return self._parse_response(response, model=DedicatedDatabaseRestorationList)
1674
+
1675
+
1676
+ def create_restoration(
1677
+ self,
1678
+ database_id: str,
1679
+ type: Optional[str] = None,
1680
+ backup_id: Optional[str] = None,
1681
+ target_time: Optional[str] = None
1682
+ ) -> DedicatedDatabaseRestoration:
1683
+ """
1684
+ Restore a database from a backup or to a specific point in time (PITR). For backup restoration, provide a backupId. For PITR, provide a targetTime as an ISO 8601 datetime. PITR requires the database to have PITR enabled and is only available for enterprise databases.
1685
+
1686
+ Parameters
1687
+ ----------
1688
+ database_id : str
1689
+ Database ID.
1690
+ type : Optional[str]
1691
+ Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery.
1692
+ backup_id : Optional[str]
1693
+ Backup ID to restore from (required for backup type).
1694
+ target_time : Optional[str]
1695
+ Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime.
1696
+
1697
+ Returns
1698
+ -------
1699
+ DedicatedDatabaseRestoration
1700
+ API response as a typed Pydantic model
1701
+
1702
+ Raises
1703
+ ------
1704
+ AppwriteException
1705
+ If API request fails
1706
+ """
1707
+
1708
+ api_path = '/mysql/{databaseId}/restorations'
1709
+ api_params = {}
1710
+ if database_id is None:
1711
+ raise AppwriteException('Missing required parameter: "database_id"')
1712
+
1713
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1714
+
1715
+ if type is not None:
1716
+ api_params['type'] = self._normalize_value(type)
1717
+ if backup_id is not None:
1718
+ api_params['backupId'] = self._normalize_value(backup_id)
1719
+ if target_time is not None:
1720
+ api_params['targetTime'] = self._normalize_value(target_time)
1721
+
1722
+ response = self.client.call('post', api_path, {
1723
+ 'X-Appwrite-Project': self.client.get_config('project'),
1724
+ 'content-type': 'application/json',
1725
+ 'accept': 'application/json',
1726
+ }, api_params)
1727
+
1728
+ return self._parse_response(response, model=DedicatedDatabaseRestoration)
1729
+
1730
+
1731
+ def get_restoration(
1732
+ self,
1733
+ database_id: str,
1734
+ restoration_id: str
1735
+ ) -> DedicatedDatabaseRestoration:
1736
+ """
1737
+ Get details of a specific database restoration including its status, type, and timestamps.
1738
+
1739
+ Parameters
1740
+ ----------
1741
+ database_id : str
1742
+ Database ID.
1743
+ restoration_id : str
1744
+ Restoration ID.
1745
+
1746
+ Returns
1747
+ -------
1748
+ DedicatedDatabaseRestoration
1749
+ API response as a typed Pydantic model
1750
+
1751
+ Raises
1752
+ ------
1753
+ AppwriteException
1754
+ If API request fails
1755
+ """
1756
+
1757
+ api_path = '/mysql/{databaseId}/restorations/{restorationId}'
1758
+ api_params = {}
1759
+ if database_id is None:
1760
+ raise AppwriteException('Missing required parameter: "database_id"')
1761
+
1762
+ if restoration_id is None:
1763
+ raise AppwriteException('Missing required parameter: "restoration_id"')
1764
+
1765
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1766
+ api_path = api_path.replace('{restorationId}', str(self._normalize_value(restoration_id)))
1767
+
1768
+
1769
+ response = self.client.call('get', api_path, {
1770
+ 'X-Appwrite-Project': self.client.get_config('project'),
1771
+ 'accept': 'application/json',
1772
+ }, api_params)
1773
+
1774
+ return self._parse_response(response, model=DedicatedDatabaseRestoration)
1775
+
1776
+
1777
+ def get_status(
1778
+ self,
1779
+ database_id: str
1780
+ ) -> DatabaseStatus:
1781
+ """
1782
+ Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information.
1783
+
1784
+ Parameters
1785
+ ----------
1786
+ database_id : str
1787
+ Database ID.
1788
+
1789
+ Returns
1790
+ -------
1791
+ DatabaseStatus
1792
+ API response as a typed Pydantic model
1793
+
1794
+ Raises
1795
+ ------
1796
+ AppwriteException
1797
+ If API request fails
1798
+ """
1799
+
1800
+ api_path = '/mysql/{databaseId}/status'
1801
+ api_params = {}
1802
+ if database_id is None:
1803
+ raise AppwriteException('Missing required parameter: "database_id"')
1804
+
1805
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1806
+
1807
+
1808
+ response = self.client.call('get', api_path, {
1809
+ 'X-Appwrite-Project': self.client.get_config('project'),
1810
+ 'accept': 'application/json',
1811
+ }, api_params)
1812
+
1813
+ return self._parse_response(response, model=DatabaseStatus)
1814
+
1815
+
1816
+ def create_upgrade(
1817
+ self,
1818
+ database_id: str,
1819
+ target_version: str
1820
+ ) -> DedicatedDatabase:
1821
+ """
1822
+ Upgrade a dedicated database to a new engine version. Uses blue-green deployment for zero-downtime cutover.
1823
+
1824
+ Parameters
1825
+ ----------
1826
+ database_id : str
1827
+ Database ID.
1828
+ target_version : str
1829
+ Target engine version to upgrade to.
1830
+
1831
+ Returns
1832
+ -------
1833
+ DedicatedDatabase
1834
+ API response as a typed Pydantic model
1835
+
1836
+ Raises
1837
+ ------
1838
+ AppwriteException
1839
+ If API request fails
1840
+ """
1841
+
1842
+ api_path = '/mysql/{databaseId}/upgrades'
1843
+ api_params = {}
1844
+ if database_id is None:
1845
+ raise AppwriteException('Missing required parameter: "database_id"')
1846
+
1847
+ if target_version is None:
1848
+ raise AppwriteException('Missing required parameter: "target_version"')
1849
+
1850
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1851
+
1852
+ api_params['targetVersion'] = self._normalize_value(target_version)
1853
+
1854
+ response = self.client.call('post', api_path, {
1855
+ 'X-Appwrite-Project': self.client.get_config('project'),
1856
+ 'content-type': 'application/json',
1857
+ 'accept': 'application/json',
1858
+ }, api_params)
1859
+
1860
+ return self._parse_response(response, model=DedicatedDatabase)
1861
+