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,1995 @@
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_extensions import DedicatedDatabaseExtensions
17
+ from ..models.dedicated_database_operation_list import DedicatedDatabaseOperationList
18
+ from ..models.dedicated_database_pitr_windows import DedicatedDatabasePITRWindows
19
+ from ..models.dedicated_database_pooler import DedicatedDatabasePooler
20
+ from ..models.dedicated_database_replicas import DedicatedDatabaseReplicas
21
+ from ..models.dedicated_database_restoration_list import DedicatedDatabaseRestorationList
22
+ from ..models.dedicated_database_restoration import DedicatedDatabaseRestoration
23
+ from ..models.database_status import DatabaseStatus
24
+
25
+ class Postgresql(Service):
26
+
27
+ def __init__(self, client) -> None:
28
+ super(Postgresql, self).__init__(client)
29
+
30
+ def list(
31
+ self,
32
+ queries: Optional[List[str]] = None
33
+ ) -> DedicatedDatabaseList:
34
+ """
35
+ List all dedicated databases. Results support pagination.
36
+
37
+ Parameters
38
+ ----------
39
+ queries : Optional[List[str]]
40
+ Array of query strings.
41
+
42
+ Returns
43
+ -------
44
+ DedicatedDatabaseList
45
+ API response as a typed Pydantic model
46
+
47
+ Raises
48
+ ------
49
+ AppwriteException
50
+ If API request fails
51
+ """
52
+
53
+ api_path = '/postgresql'
54
+ api_params = {}
55
+
56
+ if queries is not None:
57
+ api_params['queries'] = self._normalize_value(queries)
58
+
59
+ response = self.client.call('get', api_path, {
60
+ 'X-Appwrite-Project': self.client.get_config('project'),
61
+ 'accept': 'application/json',
62
+ }, api_params)
63
+
64
+ return self._parse_response(response, model=DedicatedDatabaseList)
65
+
66
+
67
+ def create(
68
+ self,
69
+ database_id: str,
70
+ name: str,
71
+ version: Optional[str] = None,
72
+ specification: Optional[str] = None,
73
+ replicas: Optional[float] = None,
74
+ sync_mode: Optional[str] = None,
75
+ standby_region: Optional[str] = None,
76
+ network_idle_timeout_seconds: Optional[float] = None,
77
+ network_ip_allowlist: Optional[List[str]] = None,
78
+ idle_timeout_minutes: Optional[float] = None,
79
+ pitr: Optional[bool] = None,
80
+ pitr_retention_days: Optional[float] = None,
81
+ storage_autoscaling: Optional[bool] = None,
82
+ storage_autoscaling_threshold_percent: Optional[float] = None,
83
+ storage_autoscaling_max_gb: Optional[float] = None
84
+ ) -> DedicatedDatabase:
85
+ """
86
+ Create a new dedicated database with the chosen engine and configuration. Status will be 'provisioning' until the database is ready.
87
+
88
+ Parameters
89
+ ----------
90
+ database_id : str
91
+ 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.
92
+ name : str
93
+ Database display name. Max length: 128 chars.
94
+ version : Optional[str]
95
+ Database engine version. Defaults to latest for selected engine.
96
+ specification : Optional[str]
97
+ Specification identifier. Drives the allocated CPU, memory, storage, storage class, and connection ceiling.
98
+ replicas : Optional[float]
99
+ Number of high availability replicas (0-5). High availability is enabled when greater than 0.
100
+ sync_mode : Optional[str]
101
+ Replication sync mode preference. Allowed values: async, sync, quorum.
102
+ standby_region : Optional[str]
103
+ 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.
104
+ network_idle_timeout_seconds : Optional[float]
105
+ Connection idle timeout in seconds.
106
+ network_ip_allowlist : Optional[List[str]]
107
+ IP addresses/CIDR ranges allowed to connect.
108
+ idle_timeout_minutes : Optional[float]
109
+ Minutes of inactivity before container scales to zero.
110
+ pitr : Optional[bool]
111
+ Enable point-in-time recovery (PITR). Continuously archives changes so the database can be restored to any moment within the retention window.
112
+ pitr_retention_days : Optional[float]
113
+ Number of days to retain PITR data.
114
+ storage_autoscaling : Optional[bool]
115
+ Enable automatic storage expansion when usage exceeds threshold.
116
+ storage_autoscaling_threshold_percent : Optional[float]
117
+ Storage usage percentage (50-95) that triggers automatic expansion.
118
+ storage_autoscaling_max_gb : Optional[float]
119
+ Maximum storage size in GB for autoscaling. 0 means no limit.
120
+
121
+ Returns
122
+ -------
123
+ DedicatedDatabase
124
+ API response as a typed Pydantic model
125
+
126
+ Raises
127
+ ------
128
+ AppwriteException
129
+ If API request fails
130
+ """
131
+
132
+ api_path = '/postgresql'
133
+ api_params = {}
134
+ if database_id is None:
135
+ raise AppwriteException('Missing required parameter: "database_id"')
136
+
137
+ if name is None:
138
+ raise AppwriteException('Missing required parameter: "name"')
139
+
140
+
141
+ api_params['databaseId'] = self._normalize_value(database_id)
142
+ api_params['name'] = self._normalize_value(name)
143
+ if version is not None:
144
+ api_params['version'] = self._normalize_value(version)
145
+ if specification is not None:
146
+ api_params['specification'] = self._normalize_value(specification)
147
+ if replicas is not None:
148
+ api_params['replicas'] = self._normalize_value(replicas)
149
+ if sync_mode is not None:
150
+ api_params['syncMode'] = self._normalize_value(sync_mode)
151
+ if standby_region is not None:
152
+ api_params['standbyRegion'] = self._normalize_value(standby_region)
153
+ if network_idle_timeout_seconds is not None:
154
+ api_params['networkIdleTimeoutSeconds'] = self._normalize_value(network_idle_timeout_seconds)
155
+ if network_ip_allowlist is not None:
156
+ api_params['networkIPAllowlist'] = self._normalize_value(network_ip_allowlist)
157
+ if idle_timeout_minutes is not None:
158
+ api_params['idleTimeoutMinutes'] = self._normalize_value(idle_timeout_minutes)
159
+ if pitr is not None:
160
+ api_params['pitr'] = self._normalize_value(pitr)
161
+ if pitr_retention_days is not None:
162
+ api_params['pitrRetentionDays'] = self._normalize_value(pitr_retention_days)
163
+ if storage_autoscaling is not None:
164
+ api_params['storageAutoscaling'] = self._normalize_value(storage_autoscaling)
165
+ if storage_autoscaling_threshold_percent is not None:
166
+ api_params['storageAutoscalingThresholdPercent'] = self._normalize_value(storage_autoscaling_threshold_percent)
167
+ if storage_autoscaling_max_gb is not None:
168
+ api_params['storageAutoscalingMaxGb'] = self._normalize_value(storage_autoscaling_max_gb)
169
+
170
+ response = self.client.call('post', api_path, {
171
+ 'X-Appwrite-Project': self.client.get_config('project'),
172
+ 'content-type': 'application/json',
173
+ 'accept': 'application/json',
174
+ }, api_params)
175
+
176
+ return self._parse_response(response, model=DedicatedDatabase)
177
+
178
+
179
+ def list_specifications(
180
+ self
181
+ ) -> DedicatedDatabaseSpecificationList:
182
+ """
183
+ 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.
184
+
185
+ Returns
186
+ -------
187
+ DedicatedDatabaseSpecificationList
188
+ API response as a typed Pydantic model
189
+
190
+ Raises
191
+ ------
192
+ AppwriteException
193
+ If API request fails
194
+ """
195
+
196
+ api_path = '/postgresql/specifications'
197
+ api_params = {}
198
+
199
+ response = self.client.call('get', api_path, {
200
+ 'X-Appwrite-Project': self.client.get_config('project'),
201
+ 'accept': 'application/json',
202
+ }, api_params)
203
+
204
+ return self._parse_response(response, model=DedicatedDatabaseSpecificationList)
205
+
206
+
207
+ def get(
208
+ self,
209
+ database_id: str
210
+ ) -> DedicatedDatabase:
211
+ """
212
+ Get a dedicated database by its unique ID. Returns the database configuration and current status.
213
+
214
+ Parameters
215
+ ----------
216
+ database_id : str
217
+ Database ID.
218
+
219
+ Returns
220
+ -------
221
+ DedicatedDatabase
222
+ API response as a typed Pydantic model
223
+
224
+ Raises
225
+ ------
226
+ AppwriteException
227
+ If API request fails
228
+ """
229
+
230
+ api_path = '/postgresql/{databaseId}'
231
+ api_params = {}
232
+ if database_id is None:
233
+ raise AppwriteException('Missing required parameter: "database_id"')
234
+
235
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
236
+
237
+
238
+ response = self.client.call('get', api_path, {
239
+ 'X-Appwrite-Project': self.client.get_config('project'),
240
+ 'accept': 'application/json',
241
+ }, api_params)
242
+
243
+ return self._parse_response(response, model=DedicatedDatabase)
244
+
245
+
246
+ def update(
247
+ self,
248
+ database_id: str,
249
+ name: Optional[str] = None,
250
+ status: Optional[str] = None,
251
+ specification: Optional[str] = None,
252
+ replicas: Optional[float] = None,
253
+ sync_mode: Optional[str] = None,
254
+ cross_region_replicas: Optional[float] = None,
255
+ standby_region: Optional[str] = None,
256
+ network_idle_timeout_seconds: Optional[float] = None,
257
+ network_ip_allowlist: Optional[List[str]] = None,
258
+ idle_timeout_minutes: Optional[float] = None,
259
+ pitr: Optional[bool] = None,
260
+ pitr_retention_days: Optional[float] = None,
261
+ storage_autoscaling: Optional[bool] = None,
262
+ storage_autoscaling_threshold_percent: Optional[float] = None,
263
+ storage_autoscaling_max_gb: Optional[float] = None,
264
+ metrics_trace_sample_rate: Optional[float] = None,
265
+ metrics_slow_query_log_threshold_ms: Optional[float] = None,
266
+ sql_api_enabled: Optional[bool] = None,
267
+ sql_api_allowed_statements: Optional[List[str]] = None,
268
+ sql_api_max_rows: Optional[float] = None,
269
+ sql_api_max_bytes: Optional[float] = None,
270
+ sql_api_timeout_seconds: Optional[float] = None
271
+ ) -> DedicatedDatabase:
272
+ """
273
+ 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.
274
+
275
+ Parameters
276
+ ----------
277
+ database_id : str
278
+ Database ID.
279
+ name : Optional[str]
280
+ Database display name.
281
+ status : Optional[str]
282
+ 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.
283
+ specification : Optional[str]
284
+ Specification. Changes cpu, memory, storage, connection ceiling, and node pool based on specification config. Resource changes are applied via rolling cutover with zero downtime.
285
+ replicas : Optional[float]
286
+ Number of high availability replicas (0-5). High availability is enabled when greater than 0.
287
+ sync_mode : Optional[str]
288
+ Replication sync mode preference. Allowed values: async, sync, quorum.
289
+ cross_region_replicas : Optional[float]
290
+ Number of cross-region standby replicas (0-1). Cross-region replication is enabled when greater than 0.
291
+ standby_region : Optional[str]
292
+ 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.
293
+ network_idle_timeout_seconds : Optional[float]
294
+ Connection idle timeout in seconds (60-86400).
295
+ network_ip_allowlist : Optional[List[str]]
296
+ IP addresses/CIDR ranges allowed to connect.
297
+ idle_timeout_minutes : Optional[float]
298
+ Minutes before container scales to zero.
299
+ pitr : Optional[bool]
300
+ Enable or disable point-in-time recovery (PITR).
301
+ pitr_retention_days : Optional[float]
302
+ Days to retain PITR data.
303
+ storage_autoscaling : Optional[bool]
304
+ Enable automatic storage expansion when usage exceeds threshold.
305
+ storage_autoscaling_threshold_percent : Optional[float]
306
+ Storage usage percentage (50-95) that triggers automatic expansion.
307
+ storage_autoscaling_max_gb : Optional[float]
308
+ Maximum storage size in GB for autoscaling. 0 means no limit.
309
+ metrics_trace_sample_rate : Optional[float]
310
+ Fraction of queries to trace (0.0–1.0). Forwarded to the sidecar.
311
+ metrics_slow_query_log_threshold_ms : Optional[float]
312
+ Threshold in ms above which queries are logged as slow. Forwarded to the sidecar.
313
+ sql_api_enabled : Optional[bool]
314
+ Enable the SQL API sidecar for this database.
315
+ sql_api_allowed_statements : Optional[List[str]]
316
+ Statement types the SQL API accepts. Allowed values: SELECT, INSERT, UPDATE, DELETE, CREATE, ALTER, DROP, TRUNCATE, GRANT, REVOKE.
317
+ sql_api_max_rows : Optional[float]
318
+ Maximum rows returned per SQL API execution (1-1000000).
319
+ sql_api_max_bytes : Optional[float]
320
+ Maximum serialised SQL API result payload in bytes (1024-104857600).
321
+ sql_api_timeout_seconds : Optional[float]
322
+ Per-call SQL API execution timeout in seconds (1-300).
323
+
324
+ Returns
325
+ -------
326
+ DedicatedDatabase
327
+ API response as a typed Pydantic model
328
+
329
+ Raises
330
+ ------
331
+ AppwriteException
332
+ If API request fails
333
+ """
334
+
335
+ api_path = '/postgresql/{databaseId}'
336
+ api_params = {}
337
+ if database_id is None:
338
+ raise AppwriteException('Missing required parameter: "database_id"')
339
+
340
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
341
+
342
+ if name is not None:
343
+ api_params['name'] = self._normalize_value(name)
344
+ if status is not None:
345
+ api_params['status'] = self._normalize_value(status)
346
+ if specification is not None:
347
+ api_params['specification'] = self._normalize_value(specification)
348
+ if replicas is not None:
349
+ api_params['replicas'] = self._normalize_value(replicas)
350
+ if sync_mode is not None:
351
+ api_params['syncMode'] = self._normalize_value(sync_mode)
352
+ if cross_region_replicas is not None:
353
+ api_params['crossRegionReplicas'] = self._normalize_value(cross_region_replicas)
354
+ if standby_region is not None:
355
+ api_params['standbyRegion'] = self._normalize_value(standby_region)
356
+ if network_idle_timeout_seconds is not None:
357
+ api_params['networkIdleTimeoutSeconds'] = self._normalize_value(network_idle_timeout_seconds)
358
+ if network_ip_allowlist is not None:
359
+ api_params['networkIPAllowlist'] = self._normalize_value(network_ip_allowlist)
360
+ if idle_timeout_minutes is not None:
361
+ api_params['idleTimeoutMinutes'] = self._normalize_value(idle_timeout_minutes)
362
+ if pitr is not None:
363
+ api_params['pitr'] = self._normalize_value(pitr)
364
+ if pitr_retention_days is not None:
365
+ api_params['pitrRetentionDays'] = self._normalize_value(pitr_retention_days)
366
+ if storage_autoscaling is not None:
367
+ api_params['storageAutoscaling'] = self._normalize_value(storage_autoscaling)
368
+ if storage_autoscaling_threshold_percent is not None:
369
+ api_params['storageAutoscalingThresholdPercent'] = self._normalize_value(storage_autoscaling_threshold_percent)
370
+ if storage_autoscaling_max_gb is not None:
371
+ api_params['storageAutoscalingMaxGb'] = self._normalize_value(storage_autoscaling_max_gb)
372
+ if metrics_trace_sample_rate is not None:
373
+ api_params['metricsTraceSampleRate'] = self._normalize_value(metrics_trace_sample_rate)
374
+ if metrics_slow_query_log_threshold_ms is not None:
375
+ api_params['metricsSlowQueryLogThresholdMs'] = self._normalize_value(metrics_slow_query_log_threshold_ms)
376
+ if sql_api_enabled is not None:
377
+ api_params['sqlApiEnabled'] = self._normalize_value(sql_api_enabled)
378
+ if sql_api_allowed_statements is not None:
379
+ api_params['sqlApiAllowedStatements'] = self._normalize_value(sql_api_allowed_statements)
380
+ if sql_api_max_rows is not None:
381
+ api_params['sqlApiMaxRows'] = self._normalize_value(sql_api_max_rows)
382
+ if sql_api_max_bytes is not None:
383
+ api_params['sqlApiMaxBytes'] = self._normalize_value(sql_api_max_bytes)
384
+ if sql_api_timeout_seconds is not None:
385
+ api_params['sqlApiTimeoutSeconds'] = self._normalize_value(sql_api_timeout_seconds)
386
+
387
+ response = self.client.call('patch', api_path, {
388
+ 'X-Appwrite-Project': self.client.get_config('project'),
389
+ 'content-type': 'application/json',
390
+ 'accept': 'application/json',
391
+ }, api_params)
392
+
393
+ return self._parse_response(response, model=DedicatedDatabase)
394
+
395
+
396
+ def delete(
397
+ self,
398
+ database_id: str
399
+ ) -> Dict[str, Any]:
400
+ """
401
+ 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.
402
+
403
+ Parameters
404
+ ----------
405
+ database_id : str
406
+ Database ID.
407
+
408
+ Returns
409
+ -------
410
+ Dict[str, Any]
411
+ API response as a dictionary
412
+
413
+ Raises
414
+ ------
415
+ AppwriteException
416
+ If API request fails
417
+ """
418
+
419
+ api_path = '/postgresql/{databaseId}'
420
+ api_params = {}
421
+ if database_id is None:
422
+ raise AppwriteException('Missing required parameter: "database_id"')
423
+
424
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
425
+
426
+
427
+ response = self.client.call('delete', api_path, {
428
+ 'X-Appwrite-Project': self.client.get_config('project'),
429
+ 'content-type': 'application/json',
430
+ 'accept': 'application/json',
431
+ }, api_params)
432
+
433
+ return response
434
+
435
+
436
+ def list_backups(
437
+ self,
438
+ database_id: str,
439
+ queries: Optional[List[str]] = None
440
+ ) -> DedicatedDatabaseBackupList:
441
+ """
442
+ List all backups for a dedicated database. Results can be filtered by status and type.
443
+
444
+ Parameters
445
+ ----------
446
+ database_id : str
447
+ Database ID.
448
+ queries : Optional[List[str]]
449
+ 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
450
+
451
+ Returns
452
+ -------
453
+ DedicatedDatabaseBackupList
454
+ API response as a typed Pydantic model
455
+
456
+ Raises
457
+ ------
458
+ AppwriteException
459
+ If API request fails
460
+ """
461
+
462
+ api_path = '/postgresql/{databaseId}/backups'
463
+ api_params = {}
464
+ if database_id is None:
465
+ raise AppwriteException('Missing required parameter: "database_id"')
466
+
467
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
468
+
469
+ if queries is not None:
470
+ api_params['queries'] = self._normalize_value(queries)
471
+
472
+ response = self.client.call('get', api_path, {
473
+ 'X-Appwrite-Project': self.client.get_config('project'),
474
+ 'accept': 'application/json',
475
+ }, api_params)
476
+
477
+ return self._parse_response(response, model=DedicatedDatabaseBackupList)
478
+
479
+
480
+ def create_backup(
481
+ self,
482
+ database_id: str,
483
+ type: Optional[str] = None
484
+ ) -> DedicatedDatabaseBackup:
485
+ """
486
+ 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.
487
+
488
+ Parameters
489
+ ----------
490
+ database_id : str
491
+ Database ID.
492
+ type : Optional[str]
493
+ Backup type: full or incremental.
494
+
495
+ Returns
496
+ -------
497
+ DedicatedDatabaseBackup
498
+ API response as a typed Pydantic model
499
+
500
+ Raises
501
+ ------
502
+ AppwriteException
503
+ If API request fails
504
+ """
505
+
506
+ api_path = '/postgresql/{databaseId}/backups'
507
+ api_params = {}
508
+ if database_id is None:
509
+ raise AppwriteException('Missing required parameter: "database_id"')
510
+
511
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
512
+
513
+ if type is not None:
514
+ api_params['type'] = self._normalize_value(type)
515
+
516
+ response = self.client.call('post', api_path, {
517
+ 'X-Appwrite-Project': self.client.get_config('project'),
518
+ 'content-type': 'application/json',
519
+ 'accept': 'application/json',
520
+ }, api_params)
521
+
522
+ return self._parse_response(response, model=DedicatedDatabaseBackup)
523
+
524
+
525
+ def list_backup_policies(
526
+ self,
527
+ database_id: str,
528
+ queries: Optional[List[str]] = None
529
+ ) -> BackupPolicyList:
530
+ """
531
+ List scheduled backup policies for a dedicated database.
532
+
533
+ Parameters
534
+ ----------
535
+ database_id : str
536
+ Database ID.
537
+ queries : Optional[List[str]]
538
+ Array of query strings generated using the Query class provided by the SDK.
539
+
540
+ Returns
541
+ -------
542
+ BackupPolicyList
543
+ API response as a typed Pydantic model
544
+
545
+ Raises
546
+ ------
547
+ AppwriteException
548
+ If API request fails
549
+ """
550
+
551
+ api_path = '/postgresql/{databaseId}/backups/policies'
552
+ api_params = {}
553
+ if database_id is None:
554
+ raise AppwriteException('Missing required parameter: "database_id"')
555
+
556
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
557
+
558
+ if queries is not None:
559
+ api_params['queries'] = self._normalize_value(queries)
560
+
561
+ response = self.client.call('get', api_path, {
562
+ 'X-Appwrite-Project': self.client.get_config('project'),
563
+ 'accept': 'application/json',
564
+ }, api_params)
565
+
566
+ return self._parse_response(response, model=BackupPolicyList)
567
+
568
+
569
+ def create_backup_policy(
570
+ self,
571
+ database_id: str,
572
+ policy_id: str,
573
+ name: str,
574
+ schedule: str,
575
+ retention: float,
576
+ type: Optional[str] = None,
577
+ enabled: Optional[bool] = None
578
+ ) -> BackupPolicy:
579
+ """
580
+ Create a scheduled backup policy for a dedicated database.
581
+
582
+ Parameters
583
+ ----------
584
+ database_id : str
585
+ Database ID.
586
+ policy_id : str
587
+ 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.
588
+ name : str
589
+ Policy name. Max length: 128 chars.
590
+ schedule : str
591
+ Schedule CRON syntax.
592
+ retention : float
593
+ Days to keep backups before deletion.
594
+ type : Optional[str]
595
+ Backup type: full or incremental.
596
+ enabled : Optional[bool]
597
+ Is policy enabled? When disabled, no backups will be taken.
598
+
599
+ Returns
600
+ -------
601
+ BackupPolicy
602
+ API response as a typed Pydantic model
603
+
604
+ Raises
605
+ ------
606
+ AppwriteException
607
+ If API request fails
608
+ """
609
+
610
+ api_path = '/postgresql/{databaseId}/backups/policies'
611
+ api_params = {}
612
+ if database_id is None:
613
+ raise AppwriteException('Missing required parameter: "database_id"')
614
+
615
+ if policy_id is None:
616
+ raise AppwriteException('Missing required parameter: "policy_id"')
617
+
618
+ if name is None:
619
+ raise AppwriteException('Missing required parameter: "name"')
620
+
621
+ if schedule is None:
622
+ raise AppwriteException('Missing required parameter: "schedule"')
623
+
624
+ if retention is None:
625
+ raise AppwriteException('Missing required parameter: "retention"')
626
+
627
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
628
+
629
+ api_params['policyId'] = self._normalize_value(policy_id)
630
+ api_params['name'] = self._normalize_value(name)
631
+ api_params['schedule'] = self._normalize_value(schedule)
632
+ api_params['retention'] = self._normalize_value(retention)
633
+ if type is not None:
634
+ api_params['type'] = self._normalize_value(type)
635
+ if enabled is not None:
636
+ api_params['enabled'] = self._normalize_value(enabled)
637
+
638
+ response = self.client.call('post', api_path, {
639
+ 'X-Appwrite-Project': self.client.get_config('project'),
640
+ 'content-type': 'application/json',
641
+ 'accept': 'application/json',
642
+ }, api_params)
643
+
644
+ return self._parse_response(response, model=BackupPolicy)
645
+
646
+
647
+ def get_backup_policy(
648
+ self,
649
+ database_id: str,
650
+ policy_id: str
651
+ ) -> BackupPolicy:
652
+ """
653
+ Get a scheduled backup policy for a dedicated database.
654
+
655
+ Parameters
656
+ ----------
657
+ database_id : str
658
+ Database ID.
659
+ policy_id : str
660
+ Policy ID.
661
+
662
+ Returns
663
+ -------
664
+ BackupPolicy
665
+ API response as a typed Pydantic model
666
+
667
+ Raises
668
+ ------
669
+ AppwriteException
670
+ If API request fails
671
+ """
672
+
673
+ api_path = '/postgresql/{databaseId}/backups/policies/{policyId}'
674
+ api_params = {}
675
+ if database_id is None:
676
+ raise AppwriteException('Missing required parameter: "database_id"')
677
+
678
+ if policy_id is None:
679
+ raise AppwriteException('Missing required parameter: "policy_id"')
680
+
681
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
682
+ api_path = api_path.replace('{policyId}', str(self._normalize_value(policy_id)))
683
+
684
+
685
+ response = self.client.call('get', api_path, {
686
+ 'X-Appwrite-Project': self.client.get_config('project'),
687
+ 'accept': 'application/json',
688
+ }, api_params)
689
+
690
+ return self._parse_response(response, model=BackupPolicy)
691
+
692
+
693
+ def update_backup_policy(
694
+ self,
695
+ database_id: str,
696
+ policy_id: str,
697
+ name: Optional[str] = None,
698
+ schedule: Optional[str] = None,
699
+ retention: Optional[float] = None,
700
+ enabled: Optional[bool] = None
701
+ ) -> BackupPolicy:
702
+ """
703
+ Update a scheduled backup policy for a dedicated database.
704
+
705
+ Parameters
706
+ ----------
707
+ database_id : str
708
+ Database ID.
709
+ policy_id : str
710
+ Policy ID.
711
+ name : Optional[str]
712
+ Policy name. Max length: 128 chars.
713
+ schedule : Optional[str]
714
+ Schedule CRON syntax.
715
+ retention : Optional[float]
716
+ Days to keep backups before deletion.
717
+ enabled : Optional[bool]
718
+ Is policy enabled? When disabled, no backups will be taken.
719
+
720
+ Returns
721
+ -------
722
+ BackupPolicy
723
+ API response as a typed Pydantic model
724
+
725
+ Raises
726
+ ------
727
+ AppwriteException
728
+ If API request fails
729
+ """
730
+
731
+ api_path = '/postgresql/{databaseId}/backups/policies/{policyId}'
732
+ api_params = {}
733
+ if database_id is None:
734
+ raise AppwriteException('Missing required parameter: "database_id"')
735
+
736
+ if policy_id is None:
737
+ raise AppwriteException('Missing required parameter: "policy_id"')
738
+
739
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
740
+ api_path = api_path.replace('{policyId}', str(self._normalize_value(policy_id)))
741
+
742
+ if name is not None:
743
+ api_params['name'] = self._normalize_value(name)
744
+ if schedule is not None:
745
+ api_params['schedule'] = self._normalize_value(schedule)
746
+ if retention is not None:
747
+ api_params['retention'] = self._normalize_value(retention)
748
+ if enabled is not None:
749
+ api_params['enabled'] = self._normalize_value(enabled)
750
+
751
+ response = self.client.call('patch', api_path, {
752
+ 'X-Appwrite-Project': self.client.get_config('project'),
753
+ 'content-type': 'application/json',
754
+ 'accept': 'application/json',
755
+ }, api_params)
756
+
757
+ return self._parse_response(response, model=BackupPolicy)
758
+
759
+
760
+ def delete_backup_policy(
761
+ self,
762
+ database_id: str,
763
+ policy_id: str
764
+ ) -> Dict[str, Any]:
765
+ """
766
+ Delete a scheduled backup policy for a dedicated database. Backups already taken by the policy are kept until their retention expires.
767
+
768
+ Parameters
769
+ ----------
770
+ database_id : str
771
+ Database ID.
772
+ policy_id : str
773
+ Policy ID.
774
+
775
+ Returns
776
+ -------
777
+ Dict[str, Any]
778
+ API response as a dictionary
779
+
780
+ Raises
781
+ ------
782
+ AppwriteException
783
+ If API request fails
784
+ """
785
+
786
+ api_path = '/postgresql/{databaseId}/backups/policies/{policyId}'
787
+ api_params = {}
788
+ if database_id is None:
789
+ raise AppwriteException('Missing required parameter: "database_id"')
790
+
791
+ if policy_id is None:
792
+ raise AppwriteException('Missing required parameter: "policy_id"')
793
+
794
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
795
+ api_path = api_path.replace('{policyId}', str(self._normalize_value(policy_id)))
796
+
797
+
798
+ response = self.client.call('delete', api_path, {
799
+ 'X-Appwrite-Project': self.client.get_config('project'),
800
+ 'content-type': 'application/json',
801
+ 'accept': 'application/json',
802
+ }, api_params)
803
+
804
+ return response
805
+
806
+
807
+ def update_backup_storage(
808
+ self,
809
+ database_id: str,
810
+ provider: str,
811
+ bucket: str,
812
+ access_key: str,
813
+ secret_key: str,
814
+ region: Optional[str] = None,
815
+ prefix: Optional[str] = None,
816
+ endpoint: Optional[str] = None
817
+ ) -> DedicatedDatabaseBackupStorage:
818
+ """
819
+ 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.
820
+
821
+ Parameters
822
+ ----------
823
+ database_id : str
824
+ Database ID.
825
+ provider : str
826
+ Storage provider for off-cluster backups. Allowed values: s3 (Amazon S3 or S3-compatible), gcs (Google Cloud Storage), azure (Azure Blob Storage).
827
+ bucket : str
828
+ Storage bucket or container name.
829
+ access_key : str
830
+ Access key or client ID for authentication.
831
+ secret_key : str
832
+ Secret key or service account JSON for authentication.
833
+ region : Optional[str]
834
+ Storage region.
835
+ prefix : Optional[str]
836
+ Object key prefix for backups.
837
+ endpoint : Optional[str]
838
+ Custom endpoint for S3-compatible storage (e.g. MinIO).
839
+
840
+ Returns
841
+ -------
842
+ DedicatedDatabaseBackupStorage
843
+ API response as a typed Pydantic model
844
+
845
+ Raises
846
+ ------
847
+ AppwriteException
848
+ If API request fails
849
+ """
850
+
851
+ api_path = '/postgresql/{databaseId}/backups/storage'
852
+ api_params = {}
853
+ if database_id is None:
854
+ raise AppwriteException('Missing required parameter: "database_id"')
855
+
856
+ if provider is None:
857
+ raise AppwriteException('Missing required parameter: "provider"')
858
+
859
+ if bucket is None:
860
+ raise AppwriteException('Missing required parameter: "bucket"')
861
+
862
+ if access_key is None:
863
+ raise AppwriteException('Missing required parameter: "access_key"')
864
+
865
+ if secret_key is None:
866
+ raise AppwriteException('Missing required parameter: "secret_key"')
867
+
868
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
869
+
870
+ api_params['provider'] = self._normalize_value(provider)
871
+ api_params['bucket'] = self._normalize_value(bucket)
872
+ if region is not None:
873
+ api_params['region'] = self._normalize_value(region)
874
+ if prefix is not None:
875
+ api_params['prefix'] = self._normalize_value(prefix)
876
+ if endpoint is not None:
877
+ api_params['endpoint'] = self._normalize_value(endpoint)
878
+ api_params['accessKey'] = self._normalize_value(access_key)
879
+ api_params['secretKey'] = self._normalize_value(secret_key)
880
+
881
+ response = self.client.call('put', api_path, {
882
+ 'X-Appwrite-Project': self.client.get_config('project'),
883
+ 'content-type': 'application/json',
884
+ 'accept': 'application/json',
885
+ }, api_params)
886
+
887
+ return self._parse_response(response, model=DedicatedDatabaseBackupStorage)
888
+
889
+
890
+ def get_backup(
891
+ self,
892
+ database_id: str,
893
+ backup_id: str
894
+ ) -> DedicatedDatabaseBackup:
895
+ """
896
+ Get details of a specific database backup including its status, size, and timestamps.
897
+
898
+ Parameters
899
+ ----------
900
+ database_id : str
901
+ Database ID.
902
+ backup_id : str
903
+ Backup ID.
904
+
905
+ Returns
906
+ -------
907
+ DedicatedDatabaseBackup
908
+ API response as a typed Pydantic model
909
+
910
+ Raises
911
+ ------
912
+ AppwriteException
913
+ If API request fails
914
+ """
915
+
916
+ api_path = '/postgresql/{databaseId}/backups/{backupId}'
917
+ api_params = {}
918
+ if database_id is None:
919
+ raise AppwriteException('Missing required parameter: "database_id"')
920
+
921
+ if backup_id is None:
922
+ raise AppwriteException('Missing required parameter: "backup_id"')
923
+
924
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
925
+ api_path = api_path.replace('{backupId}', str(self._normalize_value(backup_id)))
926
+
927
+
928
+ response = self.client.call('get', api_path, {
929
+ 'X-Appwrite-Project': self.client.get_config('project'),
930
+ 'accept': 'application/json',
931
+ }, api_params)
932
+
933
+ return self._parse_response(response, model=DedicatedDatabaseBackup)
934
+
935
+
936
+ def delete_backup(
937
+ self,
938
+ database_id: str,
939
+ backup_id: str
940
+ ) -> Dict[str, Any]:
941
+ """
942
+ Delete a database backup. This will permanently remove the backup from storage and cannot be undone.
943
+
944
+ Parameters
945
+ ----------
946
+ database_id : str
947
+ Database ID.
948
+ backup_id : str
949
+ Backup ID.
950
+
951
+ Returns
952
+ -------
953
+ Dict[str, Any]
954
+ API response as a dictionary
955
+
956
+ Raises
957
+ ------
958
+ AppwriteException
959
+ If API request fails
960
+ """
961
+
962
+ api_path = '/postgresql/{databaseId}/backups/{backupId}'
963
+ api_params = {}
964
+ if database_id is None:
965
+ raise AppwriteException('Missing required parameter: "database_id"')
966
+
967
+ if backup_id is None:
968
+ raise AppwriteException('Missing required parameter: "backup_id"')
969
+
970
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
971
+ api_path = api_path.replace('{backupId}', str(self._normalize_value(backup_id)))
972
+
973
+
974
+ response = self.client.call('delete', api_path, {
975
+ 'X-Appwrite-Project': self.client.get_config('project'),
976
+ 'content-type': 'application/json',
977
+ 'accept': 'application/json',
978
+ }, api_params)
979
+
980
+ return response
981
+
982
+
983
+ def list_branches(
984
+ self,
985
+ database_id: str
986
+ ) -> DedicatedDatabaseBranchList:
987
+ """
988
+ List all ephemeral branches for a dedicated database. Returns branch metadata including ID, name, namespace, and expiration time.
989
+
990
+ Parameters
991
+ ----------
992
+ database_id : str
993
+ Database ID.
994
+
995
+ Returns
996
+ -------
997
+ DedicatedDatabaseBranchList
998
+ API response as a typed Pydantic model
999
+
1000
+ Raises
1001
+ ------
1002
+ AppwriteException
1003
+ If API request fails
1004
+ """
1005
+
1006
+ api_path = '/postgresql/{databaseId}/branches'
1007
+ api_params = {}
1008
+ if database_id is None:
1009
+ raise AppwriteException('Missing required parameter: "database_id"')
1010
+
1011
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1012
+
1013
+
1014
+ response = self.client.call('get', api_path, {
1015
+ 'X-Appwrite-Project': self.client.get_config('project'),
1016
+ 'accept': 'application/json',
1017
+ }, api_params)
1018
+
1019
+ return self._parse_response(response, model=DedicatedDatabaseBranchList)
1020
+
1021
+
1022
+ def create_branch(
1023
+ self,
1024
+ database_id: str,
1025
+ branch_id: Optional[str] = None,
1026
+ ttl: Optional[float] = None
1027
+ ) -> DedicatedDatabase:
1028
+ """
1029
+ 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.
1030
+
1031
+ Parameters
1032
+ ----------
1033
+ database_id : str
1034
+ Database ID.
1035
+ branch_id : Optional[str]
1036
+ 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.
1037
+ ttl : Optional[float]
1038
+ Time-to-live in seconds before the branch expires. Min 300 (5 min), max 604800 (7 days). Default: 86400 (24h).
1039
+
1040
+ Returns
1041
+ -------
1042
+ DedicatedDatabase
1043
+ API response as a typed Pydantic model
1044
+
1045
+ Raises
1046
+ ------
1047
+ AppwriteException
1048
+ If API request fails
1049
+ """
1050
+
1051
+ api_path = '/postgresql/{databaseId}/branches'
1052
+ api_params = {}
1053
+ if database_id is None:
1054
+ raise AppwriteException('Missing required parameter: "database_id"')
1055
+
1056
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1057
+
1058
+ if branch_id is not None:
1059
+ api_params['branchId'] = self._normalize_value(branch_id)
1060
+ if ttl is not None:
1061
+ api_params['ttl'] = self._normalize_value(ttl)
1062
+
1063
+ response = self.client.call('post', api_path, {
1064
+ 'X-Appwrite-Project': self.client.get_config('project'),
1065
+ 'content-type': 'application/json',
1066
+ 'accept': 'application/json',
1067
+ }, api_params)
1068
+
1069
+ return self._parse_response(response, model=DedicatedDatabase)
1070
+
1071
+
1072
+ def delete_branch(
1073
+ self,
1074
+ database_id: str,
1075
+ branch_id: str
1076
+ ) -> DedicatedDatabase:
1077
+ """
1078
+ Delete an ephemeral database branch. This removes the branch namespace, its PVC, and the associated VolumeSnapshot. The deletion runs asynchronously and is irreversible.
1079
+
1080
+ Parameters
1081
+ ----------
1082
+ database_id : str
1083
+ Database ID.
1084
+ branch_id : str
1085
+ Branch ID.
1086
+
1087
+ Returns
1088
+ -------
1089
+ DedicatedDatabase
1090
+ API response as a typed Pydantic model
1091
+
1092
+ Raises
1093
+ ------
1094
+ AppwriteException
1095
+ If API request fails
1096
+ """
1097
+
1098
+ api_path = '/postgresql/{databaseId}/branches/{branchId}'
1099
+ api_params = {}
1100
+ if database_id is None:
1101
+ raise AppwriteException('Missing required parameter: "database_id"')
1102
+
1103
+ if branch_id is None:
1104
+ raise AppwriteException('Missing required parameter: "branch_id"')
1105
+
1106
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1107
+ api_path = api_path.replace('{branchId}', str(self._normalize_value(branch_id)))
1108
+
1109
+
1110
+ response = self.client.call('delete', api_path, {
1111
+ 'X-Appwrite-Project': self.client.get_config('project'),
1112
+ 'content-type': 'application/json',
1113
+ 'accept': 'application/json',
1114
+ }, api_params)
1115
+
1116
+ return self._parse_response(response, model=DedicatedDatabase)
1117
+
1118
+
1119
+ def update_credentials(
1120
+ self,
1121
+ database_id: str
1122
+ ) -> DedicatedDatabase:
1123
+ """
1124
+ 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.
1125
+
1126
+ Parameters
1127
+ ----------
1128
+ database_id : str
1129
+ Database ID.
1130
+
1131
+ Returns
1132
+ -------
1133
+ DedicatedDatabase
1134
+ API response as a typed Pydantic model
1135
+
1136
+ Raises
1137
+ ------
1138
+ AppwriteException
1139
+ If API request fails
1140
+ """
1141
+
1142
+ api_path = '/postgresql/{databaseId}/credentials'
1143
+ api_params = {}
1144
+ if database_id is None:
1145
+ raise AppwriteException('Missing required parameter: "database_id"')
1146
+
1147
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1148
+
1149
+
1150
+ response = self.client.call('patch', api_path, {
1151
+ 'X-Appwrite-Project': self.client.get_config('project'),
1152
+ 'content-type': 'application/json',
1153
+ 'accept': 'application/json',
1154
+ }, api_params)
1155
+
1156
+ return self._parse_response(response, model=DedicatedDatabase)
1157
+
1158
+
1159
+ def create_execution(
1160
+ self,
1161
+ database_id: str,
1162
+ sql: str,
1163
+ bindings: Optional[Dict[str, Any]] = None,
1164
+ timeout_seconds: Optional[float] = None
1165
+ ) -> DedicatedDatabaseExecution:
1166
+ """
1167
+ 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.
1168
+
1169
+ Parameters
1170
+ ----------
1171
+ database_id : str
1172
+ Database ID.
1173
+ sql : str
1174
+ SQL statement to execute. Exactly one statement per request.
1175
+ bindings : Optional[Dict[str, Any]]
1176
+ Optional bound parameters. Pass either a positional list or a name => value map matching the placeholder style used in the SQL.
1177
+ timeout_seconds : Optional[float]
1178
+ Per-call execution timeout override. Must be less than or equal to the database's configured sqlApiTimeoutSeconds.
1179
+
1180
+ Returns
1181
+ -------
1182
+ DedicatedDatabaseExecution
1183
+ API response as a typed Pydantic model
1184
+
1185
+ Raises
1186
+ ------
1187
+ AppwriteException
1188
+ If API request fails
1189
+ """
1190
+
1191
+ api_path = '/postgresql/{databaseId}/executions'
1192
+ api_params = {}
1193
+ if database_id is None:
1194
+ raise AppwriteException('Missing required parameter: "database_id"')
1195
+
1196
+ if sql is None:
1197
+ raise AppwriteException('Missing required parameter: "sql"')
1198
+
1199
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1200
+
1201
+ api_params['sql'] = self._normalize_value(sql)
1202
+ if bindings is not None:
1203
+ api_params['bindings'] = self._normalize_value(bindings)
1204
+ if timeout_seconds is not None:
1205
+ api_params['timeoutSeconds'] = self._normalize_value(timeout_seconds)
1206
+
1207
+ response = self.client.call('post', api_path, {
1208
+ 'X-Appwrite-Project': self.client.get_config('project'),
1209
+ 'content-type': 'application/json',
1210
+ 'accept': 'application/json',
1211
+ }, api_params)
1212
+
1213
+ return self._parse_response(response, model=DedicatedDatabaseExecution)
1214
+
1215
+
1216
+ def list_extensions(
1217
+ self,
1218
+ database_id: str
1219
+ ) -> DedicatedDatabaseExtensions:
1220
+ """
1221
+ List installed and available extensions for a PostgreSQL database.
1222
+
1223
+ Parameters
1224
+ ----------
1225
+ database_id : str
1226
+ Database ID.
1227
+
1228
+ Returns
1229
+ -------
1230
+ DedicatedDatabaseExtensions
1231
+ API response as a typed Pydantic model
1232
+
1233
+ Raises
1234
+ ------
1235
+ AppwriteException
1236
+ If API request fails
1237
+ """
1238
+
1239
+ api_path = '/postgresql/{databaseId}/extensions'
1240
+ api_params = {}
1241
+ if database_id is None:
1242
+ raise AppwriteException('Missing required parameter: "database_id"')
1243
+
1244
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1245
+
1246
+
1247
+ response = self.client.call('get', api_path, {
1248
+ 'X-Appwrite-Project': self.client.get_config('project'),
1249
+ 'accept': 'application/json',
1250
+ }, api_params)
1251
+
1252
+ return self._parse_response(response, model=DedicatedDatabaseExtensions)
1253
+
1254
+
1255
+ def create_extension(
1256
+ self,
1257
+ database_id: str,
1258
+ name: str
1259
+ ) -> DedicatedDatabase:
1260
+ """
1261
+ Install a database extension. Only available for PostgreSQL databases. The install runs asynchronously; poll the extensions list endpoint for status.
1262
+
1263
+ Parameters
1264
+ ----------
1265
+ database_id : str
1266
+ Database ID.
1267
+ name : str
1268
+ Extension name (e.g., pgvector, postgis, uuid-ossp).
1269
+
1270
+ Returns
1271
+ -------
1272
+ DedicatedDatabase
1273
+ API response as a typed Pydantic model
1274
+
1275
+ Raises
1276
+ ------
1277
+ AppwriteException
1278
+ If API request fails
1279
+ """
1280
+
1281
+ api_path = '/postgresql/{databaseId}/extensions'
1282
+ api_params = {}
1283
+ if database_id is None:
1284
+ raise AppwriteException('Missing required parameter: "database_id"')
1285
+
1286
+ if name is None:
1287
+ raise AppwriteException('Missing required parameter: "name"')
1288
+
1289
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1290
+
1291
+ api_params['name'] = self._normalize_value(name)
1292
+
1293
+ response = self.client.call('post', api_path, {
1294
+ 'X-Appwrite-Project': self.client.get_config('project'),
1295
+ 'content-type': 'application/json',
1296
+ 'accept': 'application/json',
1297
+ }, api_params)
1298
+
1299
+ return self._parse_response(response, model=DedicatedDatabase)
1300
+
1301
+
1302
+ def delete_extension(
1303
+ self,
1304
+ database_id: str,
1305
+ extension_name: str
1306
+ ) -> DedicatedDatabase:
1307
+ """
1308
+ Uninstall a database extension from a PostgreSQL database. The uninstall runs asynchronously; poll the extensions list endpoint for status.
1309
+
1310
+ Parameters
1311
+ ----------
1312
+ database_id : str
1313
+ Database ID.
1314
+ extension_name : str
1315
+ Extension name to uninstall.
1316
+
1317
+ Returns
1318
+ -------
1319
+ DedicatedDatabase
1320
+ API response as a typed Pydantic model
1321
+
1322
+ Raises
1323
+ ------
1324
+ AppwriteException
1325
+ If API request fails
1326
+ """
1327
+
1328
+ api_path = '/postgresql/{databaseId}/extensions/{extensionName}'
1329
+ api_params = {}
1330
+ if database_id is None:
1331
+ raise AppwriteException('Missing required parameter: "database_id"')
1332
+
1333
+ if extension_name is None:
1334
+ raise AppwriteException('Missing required parameter: "extension_name"')
1335
+
1336
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1337
+ api_path = api_path.replace('{extensionName}', str(self._normalize_value(extension_name)))
1338
+
1339
+
1340
+ response = self.client.call('delete', api_path, {
1341
+ 'X-Appwrite-Project': self.client.get_config('project'),
1342
+ 'content-type': 'application/json',
1343
+ 'accept': 'application/json',
1344
+ }, api_params)
1345
+
1346
+ return self._parse_response(response, model=DedicatedDatabase)
1347
+
1348
+
1349
+ def create_failover(
1350
+ self,
1351
+ database_id: str,
1352
+ target_replica_id: Optional[str] = None
1353
+ ) -> DedicatedDatabase:
1354
+ """
1355
+ 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.
1356
+
1357
+ Parameters
1358
+ ----------
1359
+ database_id : str
1360
+ Database ID.
1361
+ target_replica_id : Optional[str]
1362
+ Target replica ID to promote. If not specified, the healthiest replica is selected.
1363
+
1364
+ Returns
1365
+ -------
1366
+ DedicatedDatabase
1367
+ API response as a typed Pydantic model
1368
+
1369
+ Raises
1370
+ ------
1371
+ AppwriteException
1372
+ If API request fails
1373
+ """
1374
+
1375
+ api_path = '/postgresql/{databaseId}/failovers'
1376
+ api_params = {}
1377
+ if database_id is None:
1378
+ raise AppwriteException('Missing required parameter: "database_id"')
1379
+
1380
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1381
+
1382
+ if target_replica_id is not None:
1383
+ api_params['targetReplicaId'] = self._normalize_value(target_replica_id)
1384
+
1385
+ response = self.client.call('post', api_path, {
1386
+ 'X-Appwrite-Project': self.client.get_config('project'),
1387
+ 'content-type': 'application/json',
1388
+ 'accept': 'application/json',
1389
+ }, api_params)
1390
+
1391
+ return self._parse_response(response, model=DedicatedDatabase)
1392
+
1393
+
1394
+ def update_maintenance(
1395
+ self,
1396
+ database_id: str,
1397
+ day: str,
1398
+ hour_utc: float
1399
+ ) -> DedicatedDatabase:
1400
+ """
1401
+ Update the maintenance window for a dedicated database. Maintenance operations like minor version upgrades will be performed during this window.
1402
+
1403
+ Parameters
1404
+ ----------
1405
+ database_id : str
1406
+ Database ID.
1407
+ day : str
1408
+ Day of the week for the maintenance window. Allowed values: sun, mon, tue, wed, thu, fri, sat.
1409
+ hour_utc : float
1410
+ Hour in UTC (0-23) for maintenance window start.
1411
+
1412
+ Returns
1413
+ -------
1414
+ DedicatedDatabase
1415
+ API response as a typed Pydantic model
1416
+
1417
+ Raises
1418
+ ------
1419
+ AppwriteException
1420
+ If API request fails
1421
+ """
1422
+
1423
+ api_path = '/postgresql/{databaseId}/maintenance'
1424
+ api_params = {}
1425
+ if database_id is None:
1426
+ raise AppwriteException('Missing required parameter: "database_id"')
1427
+
1428
+ if day is None:
1429
+ raise AppwriteException('Missing required parameter: "day"')
1430
+
1431
+ if hour_utc is None:
1432
+ raise AppwriteException('Missing required parameter: "hour_utc"')
1433
+
1434
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1435
+
1436
+ api_params['day'] = self._normalize_value(day)
1437
+ api_params['hourUtc'] = self._normalize_value(hour_utc)
1438
+
1439
+ response = self.client.call('patch', api_path, {
1440
+ 'X-Appwrite-Project': self.client.get_config('project'),
1441
+ 'content-type': 'application/json',
1442
+ 'accept': 'application/json',
1443
+ }, api_params)
1444
+
1445
+ return self._parse_response(response, model=DedicatedDatabase)
1446
+
1447
+
1448
+ def create_migration(
1449
+ self,
1450
+ database_id: str,
1451
+ target_type: str,
1452
+ specification: Optional[str] = None
1453
+ ) -> DedicatedDatabase:
1454
+ """
1455
+ 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.
1456
+
1457
+ Parameters
1458
+ ----------
1459
+ database_id : str
1460
+ Database ID.
1461
+ target_type : str
1462
+ Target database type to migrate to. Allowed values: shared (serverless, scales to zero when idle), dedicated (always-on with persistent resources).
1463
+ specification : Optional[str]
1464
+ Target specification to provision when migrating to dedicated. Ignored for shared. Defaults to the database's current specification.
1465
+
1466
+ Returns
1467
+ -------
1468
+ DedicatedDatabase
1469
+ API response as a typed Pydantic model
1470
+
1471
+ Raises
1472
+ ------
1473
+ AppwriteException
1474
+ If API request fails
1475
+ """
1476
+
1477
+ api_path = '/postgresql/{databaseId}/migrations'
1478
+ api_params = {}
1479
+ if database_id is None:
1480
+ raise AppwriteException('Missing required parameter: "database_id"')
1481
+
1482
+ if target_type is None:
1483
+ raise AppwriteException('Missing required parameter: "target_type"')
1484
+
1485
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1486
+
1487
+ api_params['targetType'] = self._normalize_value(target_type)
1488
+ if specification is not None:
1489
+ api_params['specification'] = self._normalize_value(specification)
1490
+
1491
+ response = self.client.call('post', api_path, {
1492
+ 'X-Appwrite-Project': self.client.get_config('project'),
1493
+ 'content-type': 'application/json',
1494
+ 'accept': 'application/json',
1495
+ }, api_params)
1496
+
1497
+ return self._parse_response(response, model=DedicatedDatabase)
1498
+
1499
+
1500
+ def list_operations(
1501
+ self,
1502
+ database_id: str,
1503
+ status: Optional[str] = None,
1504
+ limit: Optional[float] = None,
1505
+ offset: Optional[float] = None
1506
+ ) -> DedicatedDatabaseOperationList:
1507
+ """
1508
+ 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.
1509
+
1510
+ Parameters
1511
+ ----------
1512
+ database_id : str
1513
+ Database ID.
1514
+ status : Optional[str]
1515
+ Filter by operation status.
1516
+ limit : Optional[float]
1517
+ Maximum number of operations to return.
1518
+ offset : Optional[float]
1519
+ Number of operations to skip.
1520
+
1521
+ Returns
1522
+ -------
1523
+ DedicatedDatabaseOperationList
1524
+ API response as a typed Pydantic model
1525
+
1526
+ Raises
1527
+ ------
1528
+ AppwriteException
1529
+ If API request fails
1530
+ """
1531
+
1532
+ api_path = '/postgresql/{databaseId}/operations'
1533
+ api_params = {}
1534
+ if database_id is None:
1535
+ raise AppwriteException('Missing required parameter: "database_id"')
1536
+
1537
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1538
+
1539
+ if status is not None:
1540
+ api_params['status'] = self._normalize_value(status)
1541
+ if limit is not None:
1542
+ api_params['limit'] = self._normalize_value(limit)
1543
+ if offset is not None:
1544
+ api_params['offset'] = self._normalize_value(offset)
1545
+
1546
+ response = self.client.call('get', api_path, {
1547
+ 'X-Appwrite-Project': self.client.get_config('project'),
1548
+ 'accept': 'application/json',
1549
+ }, api_params)
1550
+
1551
+ return self._parse_response(response, model=DedicatedDatabaseOperationList)
1552
+
1553
+
1554
+ def get_pitr(
1555
+ self,
1556
+ database_id: str
1557
+ ) -> DedicatedDatabasePITRWindows:
1558
+ """
1559
+ Get available point-in-time recovery windows for a dedicated database. Returns the earliest and latest recovery points.
1560
+
1561
+ Parameters
1562
+ ----------
1563
+ database_id : str
1564
+ Database ID.
1565
+
1566
+ Returns
1567
+ -------
1568
+ DedicatedDatabasePITRWindows
1569
+ API response as a typed Pydantic model
1570
+
1571
+ Raises
1572
+ ------
1573
+ AppwriteException
1574
+ If API request fails
1575
+ """
1576
+
1577
+ api_path = '/postgresql/{databaseId}/pitr'
1578
+ api_params = {}
1579
+ if database_id is None:
1580
+ raise AppwriteException('Missing required parameter: "database_id"')
1581
+
1582
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1583
+
1584
+
1585
+ response = self.client.call('get', api_path, {
1586
+ 'X-Appwrite-Project': self.client.get_config('project'),
1587
+ 'accept': 'application/json',
1588
+ }, api_params)
1589
+
1590
+ return self._parse_response(response, model=DedicatedDatabasePITRWindows)
1591
+
1592
+
1593
+ def get_pooler(
1594
+ self,
1595
+ database_id: str
1596
+ ) -> DedicatedDatabasePooler:
1597
+ """
1598
+ Get the connection pooler configuration for a dedicated database. Returns pooler mode, max connections, and pool size settings.
1599
+
1600
+ Parameters
1601
+ ----------
1602
+ database_id : str
1603
+ Database ID.
1604
+
1605
+ Returns
1606
+ -------
1607
+ DedicatedDatabasePooler
1608
+ API response as a typed Pydantic model
1609
+
1610
+ Raises
1611
+ ------
1612
+ AppwriteException
1613
+ If API request fails
1614
+ """
1615
+
1616
+ api_path = '/postgresql/{databaseId}/pooler'
1617
+ api_params = {}
1618
+ if database_id is None:
1619
+ raise AppwriteException('Missing required parameter: "database_id"')
1620
+
1621
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1622
+
1623
+
1624
+ response = self.client.call('get', api_path, {
1625
+ 'X-Appwrite-Project': self.client.get_config('project'),
1626
+ 'accept': 'application/json',
1627
+ }, api_params)
1628
+
1629
+ return self._parse_response(response, model=DedicatedDatabasePooler)
1630
+
1631
+
1632
+ def update_pooler(
1633
+ self,
1634
+ database_id: str,
1635
+ mode: Optional[str] = None,
1636
+ max_connections: Optional[float] = None,
1637
+ default_pool_size: Optional[float] = None,
1638
+ read_write_splitting: Optional[bool] = None,
1639
+ pooler_cpu_request: Optional[str] = None,
1640
+ pooler_cpu_limit: Optional[str] = None,
1641
+ pooler_memory_request: Optional[str] = None,
1642
+ pooler_memory_limit: Optional[str] = None
1643
+ ) -> DedicatedDatabasePooler:
1644
+ """
1645
+ Update the connection pooler configuration for a dedicated database. Configure pool mode, max connections, and pool sizes.
1646
+
1647
+ Parameters
1648
+ ----------
1649
+ database_id : str
1650
+ Database ID.
1651
+ mode : Optional[str]
1652
+ 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.
1653
+ max_connections : Optional[float]
1654
+ 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.
1655
+ default_pool_size : Optional[float]
1656
+ Default pool size per user.
1657
+ read_write_splitting : Optional[bool]
1658
+ Route SELECTs to HA replicas, writes and locked reads to the primary. Defaults to true when HA is enabled.
1659
+ pooler_cpu_request : Optional[str]
1660
+ Pooler sidecar CPU request override (Kubernetes quantity, e.g. "250m" or "1"). Leave null for the proportional default (5% of DB CPU, floor 100m).
1661
+ pooler_cpu_limit : Optional[str]
1662
+ 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.
1663
+ pooler_memory_request : Optional[str]
1664
+ 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).
1665
+ pooler_memory_limit : Optional[str]
1666
+ 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.
1667
+
1668
+ Returns
1669
+ -------
1670
+ DedicatedDatabasePooler
1671
+ API response as a typed Pydantic model
1672
+
1673
+ Raises
1674
+ ------
1675
+ AppwriteException
1676
+ If API request fails
1677
+ """
1678
+
1679
+ api_path = '/postgresql/{databaseId}/pooler'
1680
+ api_params = {}
1681
+ if database_id is None:
1682
+ raise AppwriteException('Missing required parameter: "database_id"')
1683
+
1684
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1685
+
1686
+ if mode is not None:
1687
+ api_params['mode'] = self._normalize_value(mode)
1688
+ if max_connections is not None:
1689
+ api_params['maxConnections'] = self._normalize_value(max_connections)
1690
+ if default_pool_size is not None:
1691
+ api_params['defaultPoolSize'] = self._normalize_value(default_pool_size)
1692
+ if read_write_splitting is not None:
1693
+ api_params['readWriteSplitting'] = self._normalize_value(read_write_splitting)
1694
+ if pooler_cpu_request is not None:
1695
+ api_params['poolerCpuRequest'] = self._normalize_value(pooler_cpu_request)
1696
+ if pooler_cpu_limit is not None:
1697
+ api_params['poolerCpuLimit'] = self._normalize_value(pooler_cpu_limit)
1698
+ if pooler_memory_request is not None:
1699
+ api_params['poolerMemoryRequest'] = self._normalize_value(pooler_memory_request)
1700
+ if pooler_memory_limit is not None:
1701
+ api_params['poolerMemoryLimit'] = self._normalize_value(pooler_memory_limit)
1702
+
1703
+ response = self.client.call('patch', api_path, {
1704
+ 'X-Appwrite-Project': self.client.get_config('project'),
1705
+ 'content-type': 'application/json',
1706
+ 'accept': 'application/json',
1707
+ }, api_params)
1708
+
1709
+ return self._parse_response(response, model=DedicatedDatabasePooler)
1710
+
1711
+
1712
+ def get_replicas(
1713
+ self,
1714
+ database_id: str
1715
+ ) -> DedicatedDatabaseReplicas:
1716
+ """
1717
+ Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode.
1718
+
1719
+ Parameters
1720
+ ----------
1721
+ database_id : str
1722
+ Database ID.
1723
+
1724
+ Returns
1725
+ -------
1726
+ DedicatedDatabaseReplicas
1727
+ API response as a typed Pydantic model
1728
+
1729
+ Raises
1730
+ ------
1731
+ AppwriteException
1732
+ If API request fails
1733
+ """
1734
+
1735
+ api_path = '/postgresql/{databaseId}/replicas'
1736
+ api_params = {}
1737
+ if database_id is None:
1738
+ raise AppwriteException('Missing required parameter: "database_id"')
1739
+
1740
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1741
+
1742
+
1743
+ response = self.client.call('get', api_path, {
1744
+ 'X-Appwrite-Project': self.client.get_config('project'),
1745
+ 'accept': 'application/json',
1746
+ }, api_params)
1747
+
1748
+ return self._parse_response(response, model=DedicatedDatabaseReplicas)
1749
+
1750
+
1751
+ def list_restorations(
1752
+ self,
1753
+ database_id: str,
1754
+ status: Optional[str] = None,
1755
+ type: Optional[str] = None,
1756
+ limit: Optional[float] = None,
1757
+ offset: Optional[float] = None
1758
+ ) -> DedicatedDatabaseRestorationList:
1759
+ """
1760
+ List all restorations for a dedicated database. Results can be filtered by status and type.
1761
+
1762
+ Parameters
1763
+ ----------
1764
+ database_id : str
1765
+ Database ID.
1766
+ status : Optional[str]
1767
+ Filter by restoration status.
1768
+ type : Optional[str]
1769
+ Filter by restoration type.
1770
+ limit : Optional[float]
1771
+ Maximum number of restorations to return.
1772
+ offset : Optional[float]
1773
+ Number of restorations to skip.
1774
+
1775
+ Returns
1776
+ -------
1777
+ DedicatedDatabaseRestorationList
1778
+ API response as a typed Pydantic model
1779
+
1780
+ Raises
1781
+ ------
1782
+ AppwriteException
1783
+ If API request fails
1784
+ """
1785
+
1786
+ api_path = '/postgresql/{databaseId}/restorations'
1787
+ api_params = {}
1788
+ if database_id is None:
1789
+ raise AppwriteException('Missing required parameter: "database_id"')
1790
+
1791
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1792
+
1793
+ if status is not None:
1794
+ api_params['status'] = self._normalize_value(status)
1795
+ if type is not None:
1796
+ api_params['type'] = self._normalize_value(type)
1797
+ if limit is not None:
1798
+ api_params['limit'] = self._normalize_value(limit)
1799
+ if offset is not None:
1800
+ api_params['offset'] = self._normalize_value(offset)
1801
+
1802
+ response = self.client.call('get', api_path, {
1803
+ 'X-Appwrite-Project': self.client.get_config('project'),
1804
+ 'accept': 'application/json',
1805
+ }, api_params)
1806
+
1807
+ return self._parse_response(response, model=DedicatedDatabaseRestorationList)
1808
+
1809
+
1810
+ def create_restoration(
1811
+ self,
1812
+ database_id: str,
1813
+ type: Optional[str] = None,
1814
+ backup_id: Optional[str] = None,
1815
+ target_time: Optional[str] = None
1816
+ ) -> DedicatedDatabaseRestoration:
1817
+ """
1818
+ 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.
1819
+
1820
+ Parameters
1821
+ ----------
1822
+ database_id : str
1823
+ Database ID.
1824
+ type : Optional[str]
1825
+ Restoration type. Allowed values: backup, pitr. Use "backup" to restore from a specific backup, or "pitr" for point-in-time recovery.
1826
+ backup_id : Optional[str]
1827
+ Backup ID to restore from (required for backup type).
1828
+ target_time : Optional[str]
1829
+ Target time for PITR (required for pitr type) as an [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) datetime.
1830
+
1831
+ Returns
1832
+ -------
1833
+ DedicatedDatabaseRestoration
1834
+ API response as a typed Pydantic model
1835
+
1836
+ Raises
1837
+ ------
1838
+ AppwriteException
1839
+ If API request fails
1840
+ """
1841
+
1842
+ api_path = '/postgresql/{databaseId}/restorations'
1843
+ api_params = {}
1844
+ if database_id is None:
1845
+ raise AppwriteException('Missing required parameter: "database_id"')
1846
+
1847
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1848
+
1849
+ if type is not None:
1850
+ api_params['type'] = self._normalize_value(type)
1851
+ if backup_id is not None:
1852
+ api_params['backupId'] = self._normalize_value(backup_id)
1853
+ if target_time is not None:
1854
+ api_params['targetTime'] = self._normalize_value(target_time)
1855
+
1856
+ response = self.client.call('post', api_path, {
1857
+ 'X-Appwrite-Project': self.client.get_config('project'),
1858
+ 'content-type': 'application/json',
1859
+ 'accept': 'application/json',
1860
+ }, api_params)
1861
+
1862
+ return self._parse_response(response, model=DedicatedDatabaseRestoration)
1863
+
1864
+
1865
+ def get_restoration(
1866
+ self,
1867
+ database_id: str,
1868
+ restoration_id: str
1869
+ ) -> DedicatedDatabaseRestoration:
1870
+ """
1871
+ Get details of a specific database restoration including its status, type, and timestamps.
1872
+
1873
+ Parameters
1874
+ ----------
1875
+ database_id : str
1876
+ Database ID.
1877
+ restoration_id : str
1878
+ Restoration ID.
1879
+
1880
+ Returns
1881
+ -------
1882
+ DedicatedDatabaseRestoration
1883
+ API response as a typed Pydantic model
1884
+
1885
+ Raises
1886
+ ------
1887
+ AppwriteException
1888
+ If API request fails
1889
+ """
1890
+
1891
+ api_path = '/postgresql/{databaseId}/restorations/{restorationId}'
1892
+ api_params = {}
1893
+ if database_id is None:
1894
+ raise AppwriteException('Missing required parameter: "database_id"')
1895
+
1896
+ if restoration_id is None:
1897
+ raise AppwriteException('Missing required parameter: "restoration_id"')
1898
+
1899
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1900
+ api_path = api_path.replace('{restorationId}', str(self._normalize_value(restoration_id)))
1901
+
1902
+
1903
+ response = self.client.call('get', api_path, {
1904
+ 'X-Appwrite-Project': self.client.get_config('project'),
1905
+ 'accept': 'application/json',
1906
+ }, api_params)
1907
+
1908
+ return self._parse_response(response, model=DedicatedDatabaseRestoration)
1909
+
1910
+
1911
+ def get_status(
1912
+ self,
1913
+ database_id: str
1914
+ ) -> DatabaseStatus:
1915
+ """
1916
+ Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information.
1917
+
1918
+ Parameters
1919
+ ----------
1920
+ database_id : str
1921
+ Database ID.
1922
+
1923
+ Returns
1924
+ -------
1925
+ DatabaseStatus
1926
+ API response as a typed Pydantic model
1927
+
1928
+ Raises
1929
+ ------
1930
+ AppwriteException
1931
+ If API request fails
1932
+ """
1933
+
1934
+ api_path = '/postgresql/{databaseId}/status'
1935
+ api_params = {}
1936
+ if database_id is None:
1937
+ raise AppwriteException('Missing required parameter: "database_id"')
1938
+
1939
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1940
+
1941
+
1942
+ response = self.client.call('get', api_path, {
1943
+ 'X-Appwrite-Project': self.client.get_config('project'),
1944
+ 'accept': 'application/json',
1945
+ }, api_params)
1946
+
1947
+ return self._parse_response(response, model=DatabaseStatus)
1948
+
1949
+
1950
+ def create_upgrade(
1951
+ self,
1952
+ database_id: str,
1953
+ target_version: str
1954
+ ) -> DedicatedDatabase:
1955
+ """
1956
+ Upgrade a dedicated database to a new engine version. Uses blue-green deployment for zero-downtime cutover.
1957
+
1958
+ Parameters
1959
+ ----------
1960
+ database_id : str
1961
+ Database ID.
1962
+ target_version : str
1963
+ Target engine version to upgrade to.
1964
+
1965
+ Returns
1966
+ -------
1967
+ DedicatedDatabase
1968
+ API response as a typed Pydantic model
1969
+
1970
+ Raises
1971
+ ------
1972
+ AppwriteException
1973
+ If API request fails
1974
+ """
1975
+
1976
+ api_path = '/postgresql/{databaseId}/upgrades'
1977
+ api_params = {}
1978
+ if database_id is None:
1979
+ raise AppwriteException('Missing required parameter: "database_id"')
1980
+
1981
+ if target_version is None:
1982
+ raise AppwriteException('Missing required parameter: "target_version"')
1983
+
1984
+ api_path = api_path.replace('{databaseId}', str(self._normalize_value(database_id)))
1985
+
1986
+ api_params['targetVersion'] = self._normalize_value(target_version)
1987
+
1988
+ response = self.client.call('post', api_path, {
1989
+ 'X-Appwrite-Project': self.client.get_config('project'),
1990
+ 'content-type': 'application/json',
1991
+ 'accept': 'application/json',
1992
+ }, api_params)
1993
+
1994
+ return self._parse_response(response, model=DedicatedDatabase)
1995
+