Create a DBaaS PostgreSQL service

POST /dbaas-postgres/{name}

Path parameters

  • name string Required

    Minimum length is 0, maximum length is 63.

application/json

Body Required

  • pgbouncer-settings object

    System-wide settings for pgbouncer.

    Hide pgbouncer-settings attributes Show pgbouncer-settings attributes object
    • min_pool_size integer

      Minimum value is 0, maximum value is 10000. Default value is 0.

    • ignore_startup_parameters array[string]

      Not more than 32 elements. Values are extra_float_digits or search_path.

    • server_lifetime integer

      Minimum value is 60, maximum value is 86400. Default value is 3600.

    • autodb_pool_mode string

      Values are transaction, session, or statement. Default value is transaction.

    • server_idle_timeout integer

      Minimum value is 0, maximum value is 86400. Default value is 600.

    • autodb_max_db_connections integer

      Minimum value is 0, maximum value is 2147483647.

    • max_prepared_statements integer

      Minimum value is 0, maximum value is 3000. Default value is 100.

    • server_reset_query_always boolean

      Default value is false.

    • autodb_pool_size integer

      Minimum value is 0, maximum value is 10000. Default value is 0.

    • autodb_idle_timeout integer

      Minimum value is 0, maximum value is 86400. Default value is 3600.

  • backup-schedule object
    Hide backup-schedule attributes Show backup-schedule attributes object
    • backup-hour integer(int64)

      The hour of day (in UTC) when backup for the service is started. New backup is only started if previous backup has already completed.

      Minimum value is 0, maximum value is 23.

    • backup-minute integer(int64)

      The minute of an hour when backup for the service is started. New backup is only started if previous backup has already completed.

      Minimum value is 0, maximum value is 59.

  • variant string

    Values are timescale or aiven.

  • integrations array[object]

    Service integrations to be enabled when creating the service.

    Hide integrations attributes Show integrations attributes object
    • type string Required

      Integration type

      Value is read_replica.

    • source-service string

      Minimum length is 0, maximum length is 63.

    • dest-service string

      Minimum length is 0, maximum length is 63.

    • settings object

      Integration settings

  • timescaledb-settings object

    System-wide settings for the timescaledb extension

    Hide timescaledb-settings attribute Show timescaledb-settings attribute object
    • max_background_workers integer

      The number of background workers for timescaledb operations. You should configure this setting to the sum of your number of databases and the total number of concurrent background workers you want running at any given point in time.

      Minimum value is 1, maximum value is 4096. Default value is 16.

  • ip-filter array[string]

    Allow incoming connections from CIDR address block, e.g. '10.20.0.0/16'

  • termination-protection boolean

    Service is protected against termination and powering off

  • fork-from-service string

    Minimum length is 0, maximum length is 63.

  • synchronous-replication string

    Values are quorum or off.

  • recovery-backup-time string

    ISO time of a backup to recover from for services that support arbitrary times

    Minimum length is 1.

  • pglookout-settings object

    System-wide settings for pglookout.

    Hide pglookout-settings attribute Show pglookout-settings attribute object
    • max_failover_replication_time_lag integer

      Number of seconds of master unavailability before triggering database failover to standby

      Minimum value is 10, maximum value is 9223372036854775807. Default value is 60.

  • maintenance object

    Automatic maintenance settings

    Hide maintenance attributes Show maintenance attributes object
    • dow string Required

      Day of week for installing updates

      Values are saturday, tuesday, never, wednesday, sunday, friday, monday, or thursday.

    • time string Required

      Time for installing updates, UTC

      Minimum length is 8, maximum length is 8.

  • admin-username string

    Custom username for admin user. This must be set only when a new service is being created.

    Minimum length is 1, maximum length is 64. Format should match the following pattern: ^[_A-Za-z0-9][-._A-Za-z0-9]{0,63}$.

  • version string

    Values are 14, 17, 15, 13, or 16.

  • plan string Required

    Subscription plan

    Minimum length is 1, maximum length is 128.

  • work-mem integer(int64)

    Sets the maximum amount of memory to be used by a query operation (such as a sort or hash table) before writing to temporary disk files, in MB. Default is 1MB + 0.075% of total RAM (up to 32MB).

    Minimum value is 1, maximum value is 1024.

  • shared-buffers-percentage integer(int64)

    Percentage of total RAM that the database server uses for shared memory buffers. Valid range is 20-60 (float), which corresponds to 20% - 60%. This setting adjusts the shared_buffers configuration value.

    Minimum value is 20, maximum value is 60.

  • pg-settings object

    Additional properties are NOT allowed.

    Hide pg-settings attributes Show pg-settings attributes object
    • track_activity_query_size integer

      Specifies the number of bytes reserved to track the currently executing command for each active session.

      Minimum value is 1024, maximum value is 10240.

    • timezone string

      PostgreSQL service timezone

      Maximum length is 64. Format should match the following pattern: ^[\w/]*$.

    • track_io_timing string

      Enables timing of database I/O calls. This parameter is off by default, because it will repeatedly query the operating system for the current time, which may cause significant overhead on some platforms.

      Values are off or on.

    • pg_stat_monitor.pgsm_enable_query_plan boolean

      Enables or disables query plan monitoring

    • max_files_per_process integer

      PostgreSQL maximum number of files that can be open per process

      Minimum value is 1000, maximum value is 4096.

    • pg_stat_monitor.pgsm_max_buckets integer

      Sets the maximum number of buckets

      Minimum value is 1, maximum value is 10.

    • wal object
      Hide wal attributes Show wal attributes object
      • max_slot_wal_keep_size integer

        PostgreSQL maximum WAL size (MB) reserved for replication slots. Default is -1 (unlimited). wal_keep_size minimum WAL size setting takes precedence over this.

        Minimum value is -1, maximum value is 2147483647.

      • max_wal_senders integer

        PostgreSQL maximum WAL senders

        Minimum value is 20, maximum value is 64.

      • wal_sender_timeout integer

        Terminate replication connections that are inactive for longer than this amount of time, in milliseconds.

        Minimum value is 0, maximum value is 10800000.

      • wal_writer_delay integer

        WAL flush interval in milliseconds. Note that setting this value to lower than the default 200ms may negatively impact performance

        Minimum value is 10, maximum value is 200.

    • default_toast_compression string

      Specifies the default TOAST compression method for values of compressible columns (the default is lz4).

      Values are lz4 or pglz.

    • deadlock_timeout integer

      This is the amount of time, in milliseconds, to wait on a lock before checking to see if there is a deadlock condition.

      Minimum value is 500, maximum value is 1800000.

    • idle_in_transaction_session_timeout integer

      Time out sessions with open transactions after this number of milliseconds

      Minimum value is 0, maximum value is 604800000.

    • max_pred_locks_per_transaction integer

      PostgreSQL maximum predicate locks per transaction

      Minimum value is 64, maximum value is 5120.

    • max_replication_slots integer

      PostgreSQL maximum replication slots

      Minimum value is 8, maximum value is 64.

    • autovacuum object
      Hide autovacuum attributes Show autovacuum attributes object
      • log_autovacuum_min_duration integer

        Causes each action executed by autovacuum to be logged if it ran for at least the specified number of milliseconds. Setting this to zero logs all autovacuum actions. Minus-one (the default) disables logging autovacuum actions.

        Minimum value is -1, maximum value is 2147483647.

      • autovacuum_vacuum_cost_limit integer

        Specifies the cost limit value that will be used in automatic VACUUM operations. If -1 is specified (which is the default), the regular vacuum_cost_limit value will be used.

        Minimum value is -1, maximum value is 10000.

      • autovacuum_max_workers integer

        Specifies the maximum number of autovacuum processes (other than the autovacuum launcher) that may be running at any one time. The default is three. This parameter can only be set at server start.

        Minimum value is 1, maximum value is 20.

      • autovacuum_vacuum_threshold integer

        Specifies the minimum number of updated or deleted tuples needed to trigger a VACUUM in any one table. The default is 50 tuples

        Minimum value is 0, maximum value is 2147483647.

      • autovacuum_naptime integer

        Specifies the minimum delay between autovacuum runs on any given database. The delay is measured in seconds, and the default is one minute

        Minimum value is 1, maximum value is 86400.

      • autovacuum_vacuum_scale_factor number

        Specifies a fraction of the table size to add to autovacuum_vacuum_threshold when deciding whether to trigger a VACUUM. The default is 0.2 (20% of table size)

        Minimum value is 0.0, maximum value is 1.0.

      • autovacuum_vacuum_cost_delay integer

        Specifies the cost delay value that will be used in automatic VACUUM operations. If -1 is specified, the regular vacuum_cost_delay value will be used. The default value is 20 milliseconds

        Minimum value is -1, maximum value is 100.

      • autovacuum_analyze_scale_factor number

        Specifies a fraction of the table size to add to autovacuum_analyze_threshold when deciding whether to trigger an ANALYZE. The default is 0.2 (20% of table size)

        Minimum value is 0.0, maximum value is 1.0.

      • autovacuum_analyze_threshold integer

        Specifies the minimum number of inserted, updated or deleted tuples needed to trigger an ANALYZE in any one table. The default is 50 tuples.

        Minimum value is 0, maximum value is 2147483647.

      • autovacuum_freeze_max_age integer

        Specifies the maximum age (in transactions) that a table's pg_class.relfrozenxid field can attain before a VACUUM operation is forced to prevent transaction ID wraparound within the table. Note that the system will launch autovacuum processes to prevent wraparound even when autovacuum is otherwise disabled. This parameter will cause the server to be restarted.

        Minimum value is 200000000, maximum value is 1500000000.

    • max_parallel_workers_per_gather integer

      Sets the maximum number of workers that can be started by a single Gather or Gather Merge node

      Minimum value is 0, maximum value is 96.

    • pg_partman_bgw.interval integer

      Sets the time interval to run pg_partman's scheduled tasks

      Minimum value is 3600, maximum value is 604800.

    • log_line_prefix string

      Choose from one of the available log-formats. These can support popular log analyzers like pgbadger, pganalyze etc.

      Values are 'pid=%p,user=%u,db=%d,app=%a,client=%h ', '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h ', or '%m [%p] %q[user=%u,db=%d,app=%a] '.

    • log_temp_files integer

      Log statements for each temporary file created larger than this number of kilobytes, -1 disables

      Minimum value is -1, maximum value is 2147483647.

    • max_locks_per_transaction integer

      PostgreSQL maximum locks per transaction

      Minimum value is 64, maximum value is 6400.

    • track_commit_timestamp string

      Record commit time of transactions.

      Values are off or on.

    • track_functions string

      Enables tracking of function call counts and time used.

      Values are all, pl, or none.

    • max_stack_depth integer

      Maximum depth of the stack in bytes

      Minimum value is 2097152, maximum value is 6291456.

    • max_parallel_workers integer

      Sets the maximum number of workers that the system can support for parallel queries

      Minimum value is 0, maximum value is 96.

    • pg_partman_bgw.role string

      Controls which role to use for pg_partman's scheduled background tasks.

      Maximum length is 64. Format should match the following pattern: ^[_A-Za-z0-9][-._A-Za-z0-9]{0,63}$.

    • max_logical_replication_workers integer

      PostgreSQL maximum logical replication workers (taken from the pool of max_parallel_workers)

      Minimum value is 4, maximum value is 64.

    • max_prepared_transactions integer

      PostgreSQL maximum prepared transactions

      Minimum value is 0, maximum value is 10000.

    • max_worker_processes integer

      Sets the maximum number of background processes that the system can support

      Minimum value is 8, maximum value is 96.

    • pg_stat_statements.track string

      Controls which statements are counted. Specify top to track top-level statements (those issued directly by clients), all to also track nested statements (such as statements invoked within functions), or none to disable statement statistics collection. The default value is top.

      Values are all, top, or none.

    • temp_file_limit integer

      PostgreSQL temporary file limit in KiB, -1 for unlimited

      Minimum value is -1, maximum value is 2147483647.

    • log_error_verbosity string

      Controls the amount of detail written in the server log for each message that is logged.

      Values are TERSE, DEFAULT, or VERBOSE.

    • log_min_duration_statement integer

      Log statements that take more than this number of milliseconds to run, -1 disables

      Minimum value is -1, maximum value is 86400000.

    • max_standby_streaming_delay integer

      Max standby streaming delay in milliseconds

      Minimum value is 1, maximum value is 43200000.

    • jit boolean

      Controls system-wide use of Just-in-Time Compilation (JIT).

    • max_standby_archive_delay integer

      Max standby archive delay in milliseconds

      Minimum value is 1, maximum value is 43200000.

    • bg-writer object
      Hide bg-writer attributes Show bg-writer attributes object
      • bgwriter_delay integer

        Specifies the delay between activity rounds for the background writer in milliseconds. Default is 200.

        Minimum value is 10, maximum value is 10000.

      • bgwriter_flush_after integer

        Whenever more than bgwriter_flush_after bytes have been written by the background writer, attempt to force the OS to issue these writes to the underlying storage. Specified in kilobytes, default is 512. Setting of 0 disables forced writeback.

        Minimum value is 0, maximum value is 2048.

      • bgwriter_lru_maxpages integer

        In each round, no more than this many buffers will be written by the background writer. Setting this to zero disables background writing. Default is 100.

        Minimum value is 0, maximum value is 1073741823.

      • bgwriter_lru_multiplier number

        The average recent need for new buffers is multiplied by bgwriter_lru_multiplier to arrive at an estimate of the number that will be needed during the next round, (up to bgwriter_lru_maxpages). 1.0 represents a “just in time” policy of writing exactly the number of buffers predicted to be needed. Larger values provide some cushion against spikes in demand, while smaller values intentionally leave writes to be done by server processes. The default is 2.0.

        Minimum value is 0, maximum value is 10.

  • admin-password string

    Custom password for admin user. Defaults to random string. This must be set only when a new service is being created.

    Minimum length is 8, maximum length is 256. Format should match the following pattern: ^[a-zA-Z0-9-_]+$.

  • migration object

    Migrate data from existing server

    Hide migration attributes Show migration attributes object
    • host string Required

      Hostname or IP address of the server where to migrate data from

      Minimum length is 1, maximum length is 255.

    • port integer(int64) Required

      Port number of the server where to migrate data from

      Minimum value is 1, maximum value is 65535.

    • password string

      Password for authentication with the server where to migrate data from

      Minimum length is 1, maximum length is 255.

    • ssl boolean

      The server where to migrate data from is secured with SSL

    • username string

      User name for authentication with the server where to migrate data from

      Minimum length is 1, maximum length is 255.

    • dbname string

      Database name for bootstrapping the initial connection

      Minimum length is 1, maximum length is 63.

    • ignore-dbs string

      Comma-separated list of databases, which should be ignored during migration (supported by MySQL only at the moment)

      Minimum length is 1, maximum length is 2048.

    • method string

      Values are dump or replication.

Responses

  • 200 application/json

    200

    Hide response attributes Show response attributes object
    • id string(uuid)

      Operation ID

    • reason string

      Operation failure reason

      Values are incorrect, unknown, unavailable, forbidden, busy, fault, partial, not-found, interrupted, unsupported, or conflict.

    • reference object

      Related resource reference

      Hide reference attributes Show reference attributes object
      • id string(uuid)

        Reference ID

      • command string

        Command name

    • message string

      Operation message

    • state string

      Operation status

      Values are failure, pending, success, or timeout.

POST /dbaas-postgres/{name}
curl \
 --request POST 'https://api-ch-gva-2.exoscale.com/v2/dbaas-postgres/{name}' \
 --header "Content-Type: application/json" \
 --data '{"pgbouncer-settings":{"min_pool_size":0,"ignore_startup_parameters":["extra_float_digits","search_path"],"server_lifetime":3600,"autodb_pool_mode":"session","server_idle_timeout":600,"autodb_max_db_connections":0,"max_prepared_statements":100,"server_reset_query_always":false,"autodb_pool_size":0,"autodb_idle_timeout":3600},"backup-schedule":{"backup-hour":42,"backup-minute":42},"variant":"timescale","integrations":[{"type":"read_replica","source-service":"string","dest-service":"string","settings":{}}],"timescaledb-settings":{"max_background_workers":8},"ip-filter":["string"],"termination-protection":true,"fork-from-service":"string","synchronous-replication":"quorum","recovery-backup-time":"string","pglookout-settings":{"max_failover_replication_time_lag":60},"maintenance":{"dow":"saturday","time":"string"},"admin-username":"string","version":"14","plan":"string","work-mem":42,"shared-buffers-percentage":42,"pg-settings":{"track_activity_query_size":1024,"timezone":"Europe/Helsinki","track_io_timing":"off","pg_stat_monitor.pgsm_enable_query_plan":false,"max_files_per_process":42,"pg_stat_monitor.pgsm_max_buckets":10,"wal":{"max_slot_wal_keep_size":42,"max_wal_senders":42,"wal_sender_timeout":42,"wal_writer_delay":50},"default_toast_compression":"lz4","deadlock_timeout":1000,"idle_in_transaction_session_timeout":42,"max_pred_locks_per_transaction":42,"max_replication_slots":42,"autovacuum":{"log_autovacuum_min_duration":42,"autovacuum_vacuum_cost_limit":42,"autovacuum_max_workers":42,"autovacuum_vacuum_threshold":42,"autovacuum_naptime":42,"autovacuum_vacuum_scale_factor":42.0,"autovacuum_vacuum_cost_delay":42,"autovacuum_analyze_scale_factor":42.0,"autovacuum_analyze_threshold":42,"autovacuum_freeze_max_age":200000000},"max_parallel_workers_per_gather":42,"pg_partman_bgw.interval":3600,"log_line_prefix":"'pid=%p,user=%u,db=%d,app=%a,client=%h '","log_temp_files":42,"max_locks_per_transaction":42,"track_commit_timestamp":"off","track_functions":"all","max_stack_depth":42,"max_parallel_workers":42,"pg_partman_bgw.role":"myrolename","max_logical_replication_workers":42,"max_prepared_transactions":42,"max_worker_processes":42,"pg_stat_statements.track":"all","temp_file_limit":5000000,"log_error_verbosity":"TERSE","log_min_duration_statement":42,"max_standby_streaming_delay":42,"jit":true,"max_standby_archive_delay":42,"bg-writer":{"bgwriter_delay":200,"bgwriter_flush_after":512,"bgwriter_lru_maxpages":100,"bgwriter_lru_multiplier":2.0}},"admin-password":"string","migration":{"host":"string","port":42,"password":"string","ssl":true,"username":"string","dbname":"string","ignore-dbs":"string","method":"dump"}}'
Request examples
{
  "pgbouncer-settings": {
    "min_pool_size": 0,
    "ignore_startup_parameters": [
      "extra_float_digits",
      "search_path"
    ],
    "server_lifetime": 3600,
    "autodb_pool_mode": "session",
    "server_idle_timeout": 600,
    "autodb_max_db_connections": 0,
    "max_prepared_statements": 100,
    "server_reset_query_always": false,
    "autodb_pool_size": 0,
    "autodb_idle_timeout": 3600
  },
  "backup-schedule": {
    "backup-hour": 42,
    "backup-minute": 42
  },
  "variant": "timescale",
  "integrations": [
    {
      "type": "read_replica",
      "source-service": "string",
      "dest-service": "string",
      "settings": {}
    }
  ],
  "timescaledb-settings": {
    "max_background_workers": 8
  },
  "ip-filter": [
    "string"
  ],
  "termination-protection": true,
  "fork-from-service": "string",
  "synchronous-replication": "quorum",
  "recovery-backup-time": "string",
  "pglookout-settings": {
    "max_failover_replication_time_lag": 60
  },
  "maintenance": {
    "dow": "saturday",
    "time": "string"
  },
  "admin-username": "string",
  "version": "14",
  "plan": "string",
  "work-mem": 42,
  "shared-buffers-percentage": 42,
  "pg-settings": {
    "track_activity_query_size": 1024,
    "timezone": "Europe/Helsinki",
    "track_io_timing": "off",
    "pg_stat_monitor.pgsm_enable_query_plan": false,
    "max_files_per_process": 42,
    "pg_stat_monitor.pgsm_max_buckets": 10,
    "wal": {
      "max_slot_wal_keep_size": 42,
      "max_wal_senders": 42,
      "wal_sender_timeout": 42,
      "wal_writer_delay": 50
    },
    "default_toast_compression": "lz4",
    "deadlock_timeout": 1000,
    "idle_in_transaction_session_timeout": 42,
    "max_pred_locks_per_transaction": 42,
    "max_replication_slots": 42,
    "autovacuum": {
      "log_autovacuum_min_duration": 42,
      "autovacuum_vacuum_cost_limit": 42,
      "autovacuum_max_workers": 42,
      "autovacuum_vacuum_threshold": 42,
      "autovacuum_naptime": 42,
      "autovacuum_vacuum_scale_factor": 42.0,
      "autovacuum_vacuum_cost_delay": 42,
      "autovacuum_analyze_scale_factor": 42.0,
      "autovacuum_analyze_threshold": 42,
      "autovacuum_freeze_max_age": 200000000
    },
    "max_parallel_workers_per_gather": 42,
    "pg_partman_bgw.interval": 3600,
    "log_line_prefix": "'pid=%p,user=%u,db=%d,app=%a,client=%h '",
    "log_temp_files": 42,
    "max_locks_per_transaction": 42,
    "track_commit_timestamp": "off",
    "track_functions": "all",
    "max_stack_depth": 42,
    "max_parallel_workers": 42,
    "pg_partman_bgw.role": "myrolename",
    "max_logical_replication_workers": 42,
    "max_prepared_transactions": 42,
    "max_worker_processes": 42,
    "pg_stat_statements.track": "all",
    "temp_file_limit": 5000000,
    "log_error_verbosity": "TERSE",
    "log_min_duration_statement": 42,
    "max_standby_streaming_delay": 42,
    "jit": true,
    "max_standby_archive_delay": 42,
    "bg-writer": {
      "bgwriter_delay": 200,
      "bgwriter_flush_after": 512,
      "bgwriter_lru_maxpages": 100,
      "bgwriter_lru_multiplier": 2.0
    }
  },
  "admin-password": "string",
  "migration": {
    "host": "string",
    "port": 42,
    "password": "string",
    "ssl": true,
    "username": "string",
    "dbname": "string",
    "ignore-dbs": "string",
    "method": "dump"
  }
}
Response examples (200)
{
  "id": "string",
  "reason": "incorrect",
  "reference": {
    "id": "string",
    "link": "string",
    "command": "string"
  },
  "message": "string",
  "state": "failure"
}