Class: Appwrite::Postgresql
- Defined in:
- lib/appwrite/services/postgresql.rb
Instance Method Summary collapse
-
#create(database_id:, name:, version: nil, specification: nil, replicas: nil, sync_mode: nil, network_idle_timeout_seconds: nil, network_ip_allowlist: nil, idle_timeout_minutes: nil, pitr: nil, pitr_retention_days: nil, storage_autoscaling: nil, storage_autoscaling_threshold_percent: nil, storage_autoscaling_max_gb: nil) ⇒ DedicatedDatabase
Create a new dedicated database with the chosen engine and configuration.
-
#create_backup(database_id:, type: nil) ⇒ DedicatedDatabaseBackup
Create a manual backup of a dedicated database.
-
#create_backup_policy(database_id:, policy_id:, name:, schedule:, retention:, type: nil, enabled: nil) ⇒ BackupPolicy
Create a scheduled backup policy for a dedicated database.
-
#create_branch(database_id:, branch_id: nil, ttl: nil) ⇒ DedicatedDatabase
Create an ephemeral database branch from the primary via PVC snapshot.
-
#create_execution(database_id:, sql:, bindings: nil, timeout_seconds: nil) ⇒ DedicatedDatabaseExecution
Execute SQL through the console-facing Cloud endpoint.
-
#create_extension(database_id:, name:) ⇒ DedicatedDatabase
Install a database extension.
-
#create_failover(database_id:, target_replica_id: nil) ⇒ DedicatedDatabase
Trigger a manual failover for a dedicated database with high availability enabled.
-
#create_migration(database_id:, target_type:, specification: nil) ⇒ DedicatedDatabase
Migrate a database between shared and dedicated types.
-
#create_restoration(database_id:, type: nil, backup_id: nil, target_database_id: nil, target_time: nil, restore_mode: nil, target_name: nil, auto_promote: nil) ⇒ DedicatedDatabaseRestoration
Restore a database from a backup or to a specific point in time (PITR).
-
#create_upgrade(database_id:, target_version:) ⇒ DedicatedDatabase
Upgrade a dedicated database to a new engine version.
-
#delete(database_id:) ⇒ Object
Delete a dedicated database.
-
#delete_backup(database_id:, backup_id:) ⇒ Object
Delete a database backup.
-
#delete_backup_policy(database_id:, policy_id:) ⇒ Object
Delete a scheduled backup policy for a dedicated database.
-
#delete_branch(database_id:, branch_id:) ⇒ DedicatedDatabase
Delete an ephemeral database branch.
-
#delete_extension(database_id:, extension_name:) ⇒ DedicatedDatabase
Uninstall a database extension from a PostgreSQL database.
-
#get(database_id:) ⇒ DedicatedDatabase
Get a dedicated database by its unique ID.
-
#get_backup(database_id:, backup_id:) ⇒ DedicatedDatabaseBackup
Get details of a specific database backup including its status, size, and timestamps.
-
#get_backup_policy(database_id:, policy_id:) ⇒ BackupPolicy
Get a scheduled backup policy for a dedicated database.
-
#get_pitr(database_id:) ⇒ DedicatedDatabasePITRWindows
Get available point-in-time recovery windows for a dedicated database.
-
#get_pooler(database_id:) ⇒ DedicatedDatabasePooler
Get the connection pooler configuration for a dedicated database.
-
#get_replicas(database_id:) ⇒ DedicatedDatabaseReplicas
Get high availability status for a dedicated database.
-
#get_restoration(database_id:, restoration_id:) ⇒ DedicatedDatabaseRestoration
Get details of a specific database restoration including its status, type, and timestamps.
-
#get_status(database_id:) ⇒ DatabaseStatus
Get real-time health and status information for a dedicated database.
-
#initialize(client) ⇒ Postgresql
constructor
A new instance of Postgresql.
-
#list(queries: nil, total: nil) ⇒ DedicatedDatabaseList
List all dedicated databases.
-
#list_backup_policies(database_id:, queries: nil, total: nil) ⇒ BackupPolicyList
List scheduled backup policies for a dedicated database.
-
#list_backups(database_id:, queries: nil, total: nil) ⇒ DedicatedDatabaseBackupList
List all backups for a dedicated database.
-
#list_branches(database_id:) ⇒ DedicatedDatabaseBranchList
List all ephemeral branches for a dedicated database.
-
#list_extensions(database_id:) ⇒ DedicatedDatabaseExtensions
List installed and available extensions for a PostgreSQL database.
-
#list_operations(database_id:, status: nil, limit: nil, offset: nil) ⇒ DedicatedDatabaseOperationList
List the lifecycle operations recorded for a dedicated database, newest first.
-
#list_restorations(database_id:, status: nil, type: nil, limit: nil, offset: nil) ⇒ DedicatedDatabaseRestorationList
List all restorations for a dedicated database.
-
#list_specifications ⇒ DedicatedDatabaseSpecificationList
List the dedicated database specifications available on the current plan.
-
#promote_restoration(database_id:, restoration_id:) ⇒ DedicatedDatabaseRestoration
Switch the database over to the clone a restoration recovered.
-
#update(database_id:, name: nil, status: nil, specification: nil, replicas: nil, sync_mode: nil, network_idle_timeout_seconds: nil, network_ip_allowlist: nil, idle_timeout_minutes: nil, pitr: nil, pitr_retention_days: nil, storage_autoscaling: nil, storage_autoscaling_threshold_percent: nil, storage_autoscaling_max_gb: nil, metrics_trace_sample_rate: nil, metrics_slow_query_log_threshold_ms: nil, sql_api_enabled: nil, sql_api_allowed_statements: nil, sql_api_max_rows: nil, sql_api_max_bytes: nil, sql_api_timeout_seconds: nil) ⇒ DedicatedDatabase
Update a dedicated database configuration.
-
#update_backup_policy(database_id:, policy_id:, name: nil, schedule: nil, retention: nil, enabled: nil) ⇒ BackupPolicy
Update a scheduled backup policy for a dedicated database.
-
#update_backup_storage(database_id:, provider:, bucket:, access_key:, secret_key:, region: nil, prefix: nil, endpoint: nil) ⇒ DedicatedDatabaseBackupStorage
Configure off-cluster backup storage for a dedicated database.
-
#update_credentials(database_id:) ⇒ DedicatedDatabaseOperation
Queue a rotation of the primary connection credentials for a dedicated database.
-
#update_maintenance(database_id:, day:, hour_utc:) ⇒ DedicatedDatabase
Update the maintenance window for a dedicated database.
-
#update_pooler(database_id:, mode: nil, max_connections: nil, default_pool_size: nil, read_write_splitting: nil, pooler_cpu_request: nil, pooler_cpu_limit: nil, pooler_memory_request: nil, pooler_memory_limit: nil) ⇒ DedicatedDatabasePooler
Update the connection pooler configuration for a dedicated database.
Constructor Details
#initialize(client) ⇒ Postgresql
Returns a new instance of Postgresql.
5 6 7 |
# File 'lib/appwrite/services/postgresql.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#create(database_id:, name:, version: nil, specification: nil, replicas: nil, sync_mode: nil, network_idle_timeout_seconds: nil, network_ip_allowlist: nil, idle_timeout_minutes: nil, pitr: nil, pitr_retention_days: nil, storage_autoscaling: nil, storage_autoscaling_threshold_percent: nil, storage_autoscaling_max_gb: nil) ⇒ DedicatedDatabase
Create a new dedicated database with the chosen engine and configuration. Status will be 'provisioning' until the database is ready.
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/appwrite/services/postgresql.rb', line 59 def create( database_id:, name:, version: nil, specification: nil, replicas: nil, sync_mode: nil, network_idle_timeout_seconds: nil, network_ip_allowlist: nil, idle_timeout_minutes: nil, pitr: nil, pitr_retention_days: nil, storage_autoscaling: nil, storage_autoscaling_threshold_percent: nil, storage_autoscaling_max_gb: nil ) if database_id.nil? raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if name.nil? raise Appwrite::Exception.new('Missing required parameter: "name"') end api_path = '/postgresql' api_params = { databaseId: database_id, name: name, version: version, specification: specification, replicas: replicas, syncMode: sync_mode, networkIdleTimeoutSeconds: network_idle_timeout_seconds, networkIPAllowlist: network_ip_allowlist, idleTimeoutMinutes: idle_timeout_minutes, pitr: pitr, pitrRetentionDays: pitr_retention_days, storageAutoscaling: storage_autoscaling, storageAutoscalingThresholdPercent: storage_autoscaling_threshold_percent, storageAutoscalingMaxGb: storage_autoscaling_max_gb, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabase ) end |
#create_backup(database_id:, type: nil) ⇒ DedicatedDatabaseBackup
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.
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
# File 'lib/appwrite/services/postgresql.rb', line 350 def create_backup( database_id:, type: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/backups' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { type: type, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseBackup ) end |
#create_backup_policy(database_id:, policy_id:, name:, schedule:, retention:, type: nil, enabled: nil) ⇒ BackupPolicy
Create a scheduled backup policy for a dedicated database.
429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 |
# File 'lib/appwrite/services/postgresql.rb', line 429 def create_backup_policy( database_id:, policy_id:, name:, schedule:, retention:, type: nil, enabled: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if policy_id.nil? raise Appwrite::Exception.new('Missing required parameter: "policyId"') end if name.nil? raise Appwrite::Exception.new('Missing required parameter: "name"') end if schedule.nil? raise Appwrite::Exception.new('Missing required parameter: "schedule"') end if retention.nil? raise Appwrite::Exception.new('Missing required parameter: "retention"') end api_path = '/postgresql/{databaseId}/backups/policies' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { policyId: policy_id, name: name, schedule: schedule, retention: retention, type: type, enabled: enabled, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::BackupPolicy ) end |
#create_branch(database_id:, branch_id: nil, ttl: nil) ⇒ DedicatedDatabase
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.
807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 |
# File 'lib/appwrite/services/postgresql.rb', line 807 def create_branch( database_id:, branch_id: nil, ttl: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/branches' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { branchId: branch_id, ttl: ttl, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabase ) end |
#create_execution(database_id:, sql:, bindings: nil, timeout_seconds: nil) ⇒ DedicatedDatabaseExecution
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.
Long-running statements (for example CREATE INDEX) can outlive the HTTP
request: if the request ends before a result is returned, check the
database before retrying, and prefer a direct connection for work that may
take minutes.
935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 |
# File 'lib/appwrite/services/postgresql.rb', line 935 def create_execution( database_id:, sql:, bindings: nil, timeout_seconds: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if sql.nil? raise Appwrite::Exception.new('Missing required parameter: "sql"') end api_path = '/postgresql/{databaseId}/executions' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { sql: sql, bindings: bindings, timeoutSeconds: timeout_seconds, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseExecution ) end |
#create_extension(database_id:, name:) ⇒ DedicatedDatabase
Install a database extension. Only available for PostgreSQL databases. The install runs asynchronously; poll the extensions list endpoint for status.
1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 |
# File 'lib/appwrite/services/postgresql.rb', line 1011 def create_extension( database_id:, name: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if name.nil? raise Appwrite::Exception.new('Missing required parameter: "name"') end api_path = '/postgresql/{databaseId}/extensions' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { name: name, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabase ) end |
#create_failover(database_id:, target_replica_id: nil) ⇒ DedicatedDatabase
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 also accepts this call as a repair once nothing is driving
the operation it is stuck in. Repairing a failover that did not finish, a
failed database, a stranded upgrade or migrate, or a stranded compute
resize additionally requires targetReplicaId to name the member to
promote, because the default target may be the member that operation
already promoted.
1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 |
# File 'lib/appwrite/services/postgresql.rb', line 1099 def create_failover( database_id:, target_replica_id: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/failovers' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { targetReplicaId: target_replica_id, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabase ) end |
#create_migration(database_id:, target_type:, specification: nil) ⇒ DedicatedDatabase
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.
1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 |
# File 'lib/appwrite/services/postgresql.rb', line 1188 def create_migration( database_id:, target_type:, specification: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if target_type.nil? raise Appwrite::Exception.new('Missing required parameter: "targetType"') end api_path = '/postgresql/{databaseId}/migrations' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { targetType: target_type, specification: specification, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabase ) end |
#create_restoration(database_id:, type: nil, backup_id: nil, target_database_id: nil, target_time: nil, restore_mode: nil, target_name: nil, auto_promote: nil) ⇒ DedicatedDatabaseRestoration
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.
By default the backup is replayed over the database it was taken from. Pass
restoreMode as clone to recover it onto a second workload beside this
database instead: this database keeps serving its own data while the clone
is filled, and the switch happens as soon as the clone is ready, on the
endpoint and credentials it already had. Pass autoPromote as false to
hold the clone until you promote it yourself. Pass restoreMode as copy
to recover onto a separate database with its own endpoint, either one you
name with targetDatabaseId or one provisioned as a copy of this
database's engine, version, specification and replicas. Neither mode is
available for a point-in-time recovery or an incremental backup.
1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 |
# File 'lib/appwrite/services/postgresql.rb', line 1493 def create_restoration( database_id:, type: nil, backup_id: nil, target_database_id: nil, target_time: nil, restore_mode: nil, target_name: nil, auto_promote: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/restorations' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { type: type, backupId: backup_id, targetDatabaseId: target_database_id, targetTime: target_time, restoreMode: restore_mode, targetName: target_name, autoPromote: auto_promote, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseRestoration ) end |
#create_upgrade(database_id:, target_version:) ⇒ DedicatedDatabase
Upgrade a dedicated database to a new engine version. Uses blue-green deployment for zero-downtime cutover.
1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 |
# File 'lib/appwrite/services/postgresql.rb', line 1658 def create_upgrade( database_id:, target_version: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if target_version.nil? raise Appwrite::Exception.new('Missing required parameter: "targetVersion"') end api_path = '/postgresql/{databaseId}/upgrades' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { targetVersion: target_version, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabase ) end |
#delete(database_id:) ⇒ Object
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.
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
# File 'lib/appwrite/services/postgresql.rb', line 278 def delete( database_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, ) end |
#delete_backup(database_id:, backup_id:) ⇒ Object
Delete a database backup. This will permanently remove the backup from storage and cannot be undone.
732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 |
# File 'lib/appwrite/services/postgresql.rb', line 732 def delete_backup( database_id:, backup_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if backup_id.nil? || backup_id == '' raise Appwrite::Exception.new('Missing required parameter: "backupId"') end api_path = '/postgresql/{databaseId}/backups/{backupId}' .gsub('{databaseId}', @client.encode_path(database_id)) .gsub('{backupId}', @client.encode_path(backup_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, ) end |
#delete_backup_policy(database_id:, policy_id:) ⇒ Object
Delete a scheduled backup policy for a dedicated database. Backups already taken by the policy are kept until their retention expires.
582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 |
# File 'lib/appwrite/services/postgresql.rb', line 582 def delete_backup_policy( database_id:, policy_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if policy_id.nil? || policy_id == '' raise Appwrite::Exception.new('Missing required parameter: "policyId"') end api_path = '/postgresql/{databaseId}/backups/policies/{policyId}' .gsub('{databaseId}', @client.encode_path(database_id)) .gsub('{policyId}', @client.encode_path(policy_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, ) end |
#delete_branch(database_id:, branch_id:) ⇒ DedicatedDatabase
Delete an ephemeral database branch. This removes the branch namespace, its PVC, and the associated VolumeSnapshot. The deletion runs asynchronously and is irreversible.
847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 |
# File 'lib/appwrite/services/postgresql.rb', line 847 def delete_branch( database_id:, branch_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if branch_id.nil? || branch_id == '' raise Appwrite::Exception.new('Missing required parameter: "branchId"') end api_path = '/postgresql/{databaseId}/branches/{branchId}' .gsub('{databaseId}', @client.encode_path(database_id)) .gsub('{branchId}', @client.encode_path(branch_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabase ) end |
#delete_extension(database_id:, extension_name:) ⇒ DedicatedDatabase
Uninstall a database extension from a PostgreSQL database. The uninstall runs asynchronously; poll the extensions list endpoint for status.
1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 |
# File 'lib/appwrite/services/postgresql.rb', line 1052 def delete_extension( database_id:, extension_name: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if extension_name.nil? || extension_name == '' raise Appwrite::Exception.new('Missing required parameter: "extensionName"') end api_path = '/postgresql/{databaseId}/extensions/{extensionName}' .gsub('{databaseId}', @client.encode_path(database_id)) .gsub('{extensionName}', @client.encode_path(extension_name)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'DELETE', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabase ) end |
#get(database_id:) ⇒ DedicatedDatabase
Get a dedicated database by its unique ID. Returns the database configuration and current status.
148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/appwrite/services/postgresql.rb', line 148 def get( database_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabase ) end |
#get_backup(database_id:, backup_id:) ⇒ DedicatedDatabaseBackup
Get details of a specific database backup including its status, size, and timestamps.
693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 |
# File 'lib/appwrite/services/postgresql.rb', line 693 def get_backup( database_id:, backup_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if backup_id.nil? || backup_id == '' raise Appwrite::Exception.new('Missing required parameter: "backupId"') end api_path = '/postgresql/{databaseId}/backups/{backupId}' .gsub('{databaseId}', @client.encode_path(database_id)) .gsub('{backupId}', @client.encode_path(backup_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseBackup ) end |
#get_backup_policy(database_id:, policy_id:) ⇒ BackupPolicy
Get a scheduled backup policy for a dedicated database.
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 |
# File 'lib/appwrite/services/postgresql.rb', line 491 def get_backup_policy( database_id:, policy_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if policy_id.nil? || policy_id == '' raise Appwrite::Exception.new('Missing required parameter: "policyId"') end api_path = '/postgresql/{databaseId}/backups/policies/{policyId}' .gsub('{databaseId}', @client.encode_path(database_id)) .gsub('{policyId}', @client.encode_path(policy_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::BackupPolicy ) end |
#get_pitr(database_id:) ⇒ DedicatedDatabasePITRWindows
Get available point-in-time recovery windows for a dedicated database. Returns the earliest and latest recovery points.
1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 |
# File 'lib/appwrite/services/postgresql.rb', line 1274 def get_pitr( database_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/pitr' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabasePITRWindows ) end |
#get_pooler(database_id:) ⇒ DedicatedDatabasePooler
Get the connection pooler configuration for a dedicated database. Returns pooler mode, max connections, and pool size settings.
1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 |
# File 'lib/appwrite/services/postgresql.rb', line 1306 def get_pooler( database_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/pooler' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabasePooler ) end |
#get_replicas(database_id:) ⇒ DedicatedDatabaseReplicas
Get high availability status for a dedicated database. Returns replica statuses, replication lag, and sync mode.
1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 |
# File 'lib/appwrite/services/postgresql.rb', line 1396 def get_replicas( database_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/replicas' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseReplicas ) end |
#get_restoration(database_id:, restoration_id:) ⇒ DedicatedDatabaseRestoration
Get details of a specific database restoration including its status, type, and timestamps.
1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 |
# File 'lib/appwrite/services/postgresql.rb', line 1542 def get_restoration( database_id:, restoration_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if restoration_id.nil? || restoration_id == '' raise Appwrite::Exception.new('Missing required parameter: "restorationId"') end api_path = '/postgresql/{databaseId}/restorations/{restorationId}' .gsub('{databaseId}', @client.encode_path(database_id)) .gsub('{restorationId}', @client.encode_path(restoration_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseRestoration ) end |
#get_status(database_id:) ⇒ DatabaseStatus
Get real-time health and status information for a dedicated database. Returns health status, readiness, uptime, connection info, replica status, and volume information.
1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 |
# File 'lib/appwrite/services/postgresql.rb', line 1625 def get_status( database_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/status' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DatabaseStatus ) end |
#list(queries: nil, total: nil) ⇒ DedicatedDatabaseList
List all dedicated databases. Results support pagination.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/appwrite/services/postgresql.rb', line 15 def list( queries: nil, total: nil ) api_path = '/postgresql' api_params = { queries: queries, total: total, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseList ) end |
#list_backup_policies(database_id:, queries: nil, total: nil) ⇒ BackupPolicyList
List scheduled backup policies for a dedicated database.
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 |
# File 'lib/appwrite/services/postgresql.rb', line 387 def list_backup_policies( database_id:, queries: nil, total: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/backups/policies' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { queries: queries, total: total, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::BackupPolicyList ) end |
#list_backups(database_id:, queries: nil, total: nil) ⇒ DedicatedDatabaseBackupList
List all backups for a dedicated database. Results can be filtered by status and type.
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 |
# File 'lib/appwrite/services/postgresql.rb', line 312 def list_backups( database_id:, queries: nil, total: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/backups' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { queries: queries, total: total, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseBackupList ) end |
#list_branches(database_id:) ⇒ DedicatedDatabaseBranchList
List all ephemeral branches for a dedicated database. Returns branch metadata including ID, name, namespace, and expiration time.
770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 |
# File 'lib/appwrite/services/postgresql.rb', line 770 def list_branches( database_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/branches' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseBranchList ) end |
#list_extensions(database_id:) ⇒ DedicatedDatabaseExtensions
List installed and available extensions for a PostgreSQL database.
978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 |
# File 'lib/appwrite/services/postgresql.rb', line 978 def list_extensions( database_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/extensions' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseExtensions ) end |
#list_operations(database_id:, status: nil, limit: nil, offset: nil) ⇒ DedicatedDatabaseOperationList
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.
1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 |
# File 'lib/appwrite/services/postgresql.rb', line 1235 def list_operations( database_id:, status: nil, limit: nil, offset: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/operations' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { status: status, limit: limit, offset: offset, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseOperationList ) end |
#list_restorations(database_id:, status: nil, type: nil, limit: nil, offset: nil) ⇒ DedicatedDatabaseRestorationList
List all restorations for a dedicated database. Results can be filtered by status and type.
1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 |
# File 'lib/appwrite/services/postgresql.rb', line 1432 def list_restorations( database_id:, status: nil, type: nil, limit: nil, offset: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/restorations' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { status: status, type: type, limit: limit, offset: offset, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseRestorationList ) end |
#list_specifications ⇒ DedicatedDatabaseSpecificationList
List the dedicated database specifications available on the current plan. Each specification reports its resource limits, its own prices and overage rates, and whether it is enabled for the organization.
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/appwrite/services/postgresql.rb', line 123 def list_specifications() api_path = '/postgresql/specifications' api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "accept": 'application/json', } @client.call( method: 'GET', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseSpecificationList ) end |
#promote_restoration(database_id:, restoration_id:) ⇒ DedicatedDatabaseRestoration
Switch the database over to the clone a restoration recovered. The database keeps its endpoint and credentials; clients reconnect once. Writes made after the recovery point are discarded, and the side being replaced is retained briefly so the switch can be reversed.
1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 |
# File 'lib/appwrite/services/postgresql.rb', line 1585 def promote_restoration( database_id:, restoration_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if restoration_id.nil? || restoration_id == '' raise Appwrite::Exception.new('Missing required parameter: "restorationId"') end api_path = '/postgresql/{databaseId}/restorations/{restorationId}/promotions' .gsub('{databaseId}', @client.encode_path(database_id)) .gsub('{restorationId}', @client.encode_path(restoration_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'POST', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseRestoration ) end |
#update(database_id:, name: nil, status: nil, specification: nil, replicas: nil, sync_mode: nil, network_idle_timeout_seconds: nil, network_ip_allowlist: nil, idle_timeout_minutes: nil, pitr: nil, pitr_retention_days: nil, storage_autoscaling: nil, storage_autoscaling_threshold_percent: nil, storage_autoscaling_max_gb: nil, metrics_trace_sample_rate: nil, metrics_slow_query_log_threshold_ms: nil, sql_api_enabled: nil, sql_api_allowed_statements: nil, sql_api_max_rows: nil, sql_api_max_bytes: nil, sql_api_timeout_seconds: nil) ⇒ DedicatedDatabase
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.
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/appwrite/services/postgresql.rb', line 202 def update( database_id:, name: nil, status: nil, specification: nil, replicas: nil, sync_mode: nil, network_idle_timeout_seconds: nil, network_ip_allowlist: nil, idle_timeout_minutes: nil, pitr: nil, pitr_retention_days: nil, storage_autoscaling: nil, storage_autoscaling_threshold_percent: nil, storage_autoscaling_max_gb: nil, metrics_trace_sample_rate: nil, metrics_slow_query_log_threshold_ms: nil, sql_api_enabled: nil, sql_api_allowed_statements: nil, sql_api_max_rows: nil, sql_api_max_bytes: nil, sql_api_timeout_seconds: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { name: name, status: status, specification: specification, replicas: replicas, syncMode: sync_mode, networkIdleTimeoutSeconds: network_idle_timeout_seconds, networkIPAllowlist: network_ip_allowlist, idleTimeoutMinutes: idle_timeout_minutes, pitr: pitr, pitrRetentionDays: pitr_retention_days, storageAutoscaling: storage_autoscaling, storageAutoscalingThresholdPercent: storage_autoscaling_threshold_percent, storageAutoscalingMaxGb: storage_autoscaling_max_gb, metricsTraceSampleRate: metrics_trace_sample_rate, metricsSlowQueryLogThresholdMs: metrics_slow_query_log_threshold_ms, sqlApiEnabled: sql_api_enabled, sqlApiAllowedStatements: sql_api_allowed_statements, sqlApiMaxRows: sql_api_max_rows, sqlApiMaxBytes: sql_api_max_bytes, sqlApiTimeoutSeconds: sql_api_timeout_seconds, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabase ) end |
#update_backup_policy(database_id:, policy_id:, name: nil, schedule: nil, retention: nil, enabled: nil) ⇒ BackupPolicy
Update a scheduled backup policy for a dedicated database.
533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 |
# File 'lib/appwrite/services/postgresql.rb', line 533 def update_backup_policy( database_id:, policy_id:, name: nil, schedule: nil, retention: nil, enabled: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if policy_id.nil? || policy_id == '' raise Appwrite::Exception.new('Missing required parameter: "policyId"') end api_path = '/postgresql/{databaseId}/backups/policies/{policyId}' .gsub('{databaseId}', @client.encode_path(database_id)) .gsub('{policyId}', @client.encode_path(policy_id)) api_params = { name: name, schedule: schedule, retention: retention, enabled: enabled, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::BackupPolicy ) end |
#update_backup_storage(database_id:, provider:, bucket:, access_key:, secret_key:, region: nil, prefix: nil, endpoint: nil) ⇒ DedicatedDatabaseBackupStorage
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.
628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 |
# File 'lib/appwrite/services/postgresql.rb', line 628 def update_backup_storage( database_id:, provider:, bucket:, access_key:, secret_key:, region: nil, prefix: nil, endpoint: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if provider.nil? raise Appwrite::Exception.new('Missing required parameter: "provider"') end if bucket.nil? raise Appwrite::Exception.new('Missing required parameter: "bucket"') end if access_key.nil? raise Appwrite::Exception.new('Missing required parameter: "accessKey"') end if secret_key.nil? raise Appwrite::Exception.new('Missing required parameter: "secretKey"') end api_path = '/postgresql/{databaseId}/backups/storage' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { provider: provider, bucket: bucket, region: region, prefix: prefix, endpoint: endpoint, accessKey: access_key, secretKey: secret_key, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PUT', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseBackupStorage ) end |
#update_credentials(database_id:) ⇒ DedicatedDatabaseOperation
Queue a rotation of the primary connection credentials for a dedicated database. A hibernated database is woken by the worker before rotation. List database operations until the returned operation reaches a terminal status, then fetch the database again for the refreshed connection string.
888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 |
# File 'lib/appwrite/services/postgresql.rb', line 888 def update_credentials( database_id: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/credentials' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = {} api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabaseOperation ) end |
#update_maintenance(database_id:, day:, hour_utc:) ⇒ DedicatedDatabase
Update the maintenance window for a dedicated database. Maintenance operations like minor version upgrades will be performed during this window.
1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 |
# File 'lib/appwrite/services/postgresql.rb', line 1138 def update_maintenance( database_id:, day:, hour_utc: ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end if day.nil? raise Appwrite::Exception.new('Missing required parameter: "day"') end if hour_utc.nil? raise Appwrite::Exception.new('Missing required parameter: "hourUtc"') end api_path = '/postgresql/{databaseId}/maintenance' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { day: day, hourUtc: hour_utc, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabase ) end |
#update_pooler(database_id:, mode: nil, max_connections: nil, default_pool_size: nil, read_write_splitting: nil, pooler_cpu_request: nil, pooler_cpu_limit: nil, pooler_memory_request: nil, pooler_memory_limit: nil) ⇒ DedicatedDatabasePooler
Update the connection pooler configuration for a dedicated database. Configure pool mode, max connections, and pool sizes.
1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 |
# File 'lib/appwrite/services/postgresql.rb', line 1346 def update_pooler( database_id:, mode: nil, max_connections: nil, default_pool_size: nil, read_write_splitting: nil, pooler_cpu_request: nil, pooler_cpu_limit: nil, pooler_memory_request: nil, pooler_memory_limit: nil ) if database_id.nil? || database_id == '' raise Appwrite::Exception.new('Missing required parameter: "databaseId"') end api_path = '/postgresql/{databaseId}/pooler' .gsub('{databaseId}', @client.encode_path(database_id)) api_params = { mode: mode, maxConnections: max_connections, defaultPoolSize: default_pool_size, readWriteSplitting: read_write_splitting, poolerCpuRequest: pooler_cpu_request, poolerCpuLimit: pooler_cpu_limit, poolerMemoryRequest: pooler_memory_request, poolerMemoryLimit: pooler_memory_limit, } api_headers = { "X-Appwrite-Project": @client.get_config('project'), "content-type": 'application/json', "accept": 'application/json', } @client.call( method: 'PATCH', path: api_path, headers: api_headers, params: api_params, response_type: Models::DedicatedDatabasePooler ) end |