postgresql_connection_pools
Creates, updates, deletes, gets or lists a postgresql_connection_pools resource.
Overview​
| Name | postgresql_connection_pools |
| Type | Resource |
| Id | ovh.public_cloud_database.postgresql_connection_pools |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier of the connection pool |
name | string | Name of the connection pool |
database_id | string (uuid) | Identifier of the target database schema (wire: databaseId) |
user_id | string (uuid) | Unique identifier of the database user used to establish server connections. Null when no user is assigned. (wire: userId) |
checksum | string | Hash of the resource used for concurrency control |
created_at | string (date-time) | Date at which the resource was created (wire: createdAt) |
mode | string | PgBouncer pooling mode (SESSION, STATEMENT, TRANSACTION) |
port | integer | TCP port on which the connection pool listens |
size | integer | Maximum number of server connections in the pool |
ssl_mode | string | SSL connection mode for the pool (REQUIRE) (wire: sslMode) |
updated_at | string (date-time) | Date of the last update to the resource (wire: updatedAt) |
uri | string | Connection URI to the pool |
A PgBouncer connection pool on a managed PostgreSQL service
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | Unique identifier of the connection pool |
name | string | Name of the connection pool |
database_id | string (uuid) | Identifier of the target database schema (wire: databaseId) |
user_id | string (uuid) | Unique identifier of the database user used to establish server connections. Null when no user is assigned. (wire: userId) |
checksum | string | Hash of the resource used for concurrency control |
created_at | string (date-time) | Date at which the resource was created (wire: createdAt) |
mode | string | PgBouncer pooling mode (SESSION, STATEMENT, TRANSACTION) |
port | integer | TCP port on which the connection pool listens |
size | integer | Maximum number of server connections in the pool |
ssl_mode | string | SSL connection mode for the pool (REQUIRE) (wire: sslMode) |
updated_at | string (date-time) | Date of the last update to the resource (wire: updatedAt) |
uri | string | Connection URI to the pool |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | connection_pool_id, service_id, project_id | Returns the connection pool settings and its connection URI. (Beta version) | |
list | select | service_id, project_id | x_pagination_cursor, x_pagination_size | Returns the connection pools of the service. (Beta version) |
create | insert | service_id, project_id, database_id, mode, name, size | Creates a connection pool on a database, with a pooling mode and a maximum number of server connections. Without userId, a system user opens the server connections. (Beta version) | |
update | update | connection_pool_id, service_id, project_id | Partially updates the database, pooling mode, size or user of the connection pool. Setting userId to null removes the user assignment. (Beta version) | |
delete | delete | connection_pool_id, service_id, project_id | Deletes the connection pool. (Beta version) | |
replace | exec | connectionPoolId, serviceId, project_id, databaseId, mode, size, userId | Updates the database, pooling mode, size and user of the connection pool. Every field is required. Setting userId to null removes the user assignment. (Beta version) |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
api_host | string | The OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}}) |
connectionPoolId | string (uuid) | Connection pool ID |
connection_pool_id | string (uuid) | Connection pool ID (wire: connectionPoolId) |
project_id | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
serviceId | string (uuid) | Service ID |
service_id | string (uuid) | Service ID (wire: serviceId) |
x_pagination_cursor | string | Pagination cursor (wire: X-Pagination-Cursor) |
x_pagination_size | integer | Pagination size (wire: X-Pagination-Size) |
SELECT examples​
- get
- list
Returns the connection pool settings and its connection URI. (Beta version)
SELECT
id,
name,
database_id,
user_id,
checksum,
created_at,
mode,
port,
size,
ssl_mode,
updated_at,
uri
FROM ovh.public_cloud_database.postgresql_connection_pools
WHERE connection_pool_id = '{{ connection_pool_id }}' -- required
AND service_id = '{{ service_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Returns the connection pools of the service. (Beta version)
SELECT
id,
name,
database_id,
user_id,
checksum,
created_at,
mode,
port,
size,
ssl_mode,
updated_at,
uri
FROM ovh.public_cloud_database.postgresql_connection_pools
WHERE service_id = '{{ service_id }}' -- required
AND project_id = '{{ project_id }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND x_pagination_cursor = '{{ x_pagination_cursor }}'
AND x_pagination_size = '{{ x_pagination_size }}'
;
INSERT examples​
- create
- Manifest
Creates a connection pool on a database, with a pooling mode and a maximum number of server connections. Without userId, a system user opens the server connections. (Beta version)
INSERT INTO ovh.public_cloud_database.postgresql_connection_pools (
database_id,
mode,
name,
size,
user_id,
service_id,
project_id
)
SELECT
'{{ database_id }}' /* required */,
'{{ mode }}' /* required */,
'{{ name }}' /* required */,
{{ size }} /* required */,
'{{ user_id }}',
'{{ service_id }}',
'{{ project_id }}'
RETURNING
id,
name,
database_id,
user_id,
checksum,
created_at,
mode,
port,
size,
ssl_mode,
updated_at,
uri
;
# Description fields are for documentation purposes
- name: postgresql_connection_pools
props:
- name: service_id
value: "{{ service_id }}"
description: Required parameter for the postgresql_connection_pools resource.
- name: project_id
value: "{{ project_id }}"
description: Required parameter for the postgresql_connection_pools resource.
- name: database_id
value: "{{ database_id }}"
description: |
Identifier of the target database schema
- name: mode
value: "{{ mode }}"
description: |
PgBouncer pooling mode
valid_values: ['SESSION', 'STATEMENT', 'TRANSACTION']
- name: name
value: "{{ name }}"
description: |
Name of the connection pool
- name: size
value: {{ size }}
description: |
Maximum number of server connections in the pool
- name: user_id
value: "{{ user_id }}"
description: |
Unique identifier of the database user for server connections. Null to use a system user.
UPDATE examples​
- update
Partially updates the database, pooling mode, size or user of the connection pool. Setting userId to null removes the user assignment. (Beta version)
UPDATE ovh.public_cloud_database.postgresql_connection_pools
SET
database_id = '{{ database_id }}',
mode = '{{ mode }}',
size = {{ size }},
user_id = '{{ user_id }}'
WHERE
connection_pool_id = '{{ connection_pool_id }}' --required
AND service_id = '{{ service_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
RETURNING
id,
name,
database_id,
user_id,
checksum,
created_at,
mode,
port,
size,
ssl_mode,
updated_at,
uri;
DELETE examples​
- delete
Deletes the connection pool. (Beta version)
DELETE FROM ovh.public_cloud_database.postgresql_connection_pools
WHERE connection_pool_id = '{{ connection_pool_id }}' --required
AND service_id = '{{ service_id }}' --required
AND project_id = '{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;
Lifecycle Methods​
EXEC variables use wire (API) names.
- replace
Updates the database, pooling mode, size and user of the connection pool. Every field is required. Setting userId to null removes the user assignment. (Beta version)
EXEC ovh.public_cloud_database.postgresql_connection_pools.replace
@connectionPoolId='{{ connectionPoolId }}' --required,
@serviceId='{{ serviceId }}' --required,
@project_id='{{ project_id }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
@@json=
'{
"databaseId": "{{ databaseId }}",
"mode": "{{ mode }}",
"size": {{ size }},
"userId": "{{ userId }}"
}'
;