Skip to main content

postgresql_connection_pools

Creates, updates, deletes, gets or lists a postgresql_connection_pools resource.

Overview​

Namepostgresql_connection_pools
TypeResource
Idovh.cloud_database.postgresql_connection_pools

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstring (uuid)ID of the connection pool
namestringName of the connection pool
database_idstring (uuid)Database used for the connection pool (wire: databaseId)
user_idstring (uuid)User authorized to connect to the pool, if none all the users are allowed (wire: userId)
modestringConnection mode to the connection pool (session, statement, transaction)
portintegerPort of the connection pool
sizeintegerSize of the connection pool
ssl_modestringSsl connection mode for the pool (require) (wire: sslMode)
uristringConnection URI to the pool

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcluster_id, connection_pool_id, service_nameGet the connectionPool for the postgresql cluster
listselectcluster_id, service_namex_pagination_mode
createinsertcluster_id, service_name, database_id, mode, name, sizeCreate a new connectionPool on the postgresql cluster
updateupdatecluster_id, connection_pool_id, service_nameUpdate a connectionPool on the postgresql cluster
deletedeletecluster_id, connection_pool_id, service_nameDelete a postgresql connectionPool

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.

NameDatatypeDescription
api_hoststringThe 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"}})
cluster_idstring (uuid)Cluster ID (wire: clusterId)
connection_pool_idstring (uuid)Connection pool ID (wire: connectionPoolId)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get the connectionPool for the postgresql cluster

SELECT
id,
name,
database_id,
user_id,
mode,
port,
size,
ssl_mode,
uri
FROM ovh.cloud_database.postgresql_connection_pools
WHERE cluster_id = '{{ cluster_id }}' -- required
AND connection_pool_id = '{{ connection_pool_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Create a new connectionPool on the postgresql cluster

INSERT INTO ovh.cloud_database.postgresql_connection_pools (
database_id,
mode,
name,
size,
user_id,
cluster_id,
service_name
)
SELECT
'{{ database_id }}' /* required */,
'{{ mode }}' /* required */,
'{{ name }}' /* required */,
{{ size }} /* required */,
'{{ user_id }}',
'{{ cluster_id }}',
'{{ service_name }}'
RETURNING
id,
name,
database_id,
user_id,
mode,
port,
size,
ssl_mode,
uri
;

UPDATE examples​

Update a connectionPool on the postgresql cluster

UPDATE ovh.cloud_database.postgresql_connection_pools
SET
database_id = '{{ database_id }}',
mode = '{{ mode }}',
size = {{ size }},
user_id = '{{ user_id }}'
WHERE
cluster_id = '{{ cluster_id }}' --required
AND connection_pool_id = '{{ connection_pool_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
RETURNING
id,
name,
database_id,
user_id,
mode,
port,
size,
ssl_mode,
uri;

DELETE examples​

Delete a postgresql connectionPool

DELETE FROM ovh.cloud_database.postgresql_connection_pools
WHERE cluster_id = '{{ cluster_id }}' --required
AND connection_pool_id = '{{ connection_pool_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;