postgresql_connection_pools
Creates, updates, deletes, gets or lists a postgresql_connection_pools resource.
Overview​
| Name | postgresql_connection_pools |
| Type | Resource |
| Id | ovh.cloud_database.postgresql_connection_pools |
Fields​
The following fields are returned by SELECT queries:
- get
- list
successful operation
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | ID of the connection pool |
name | string | Name of the connection pool |
database_id | string (uuid) | Database used for the connection pool (wire: databaseId) |
user_id | string (uuid) | User authorized to connect to the pool, if none all the users are allowed (wire: userId) |
mode | string | Connection mode to the connection pool (session, statement, transaction) |
port | integer | Port of the connection pool |
size | integer | Size of the connection pool |
ssl_mode | string | Ssl connection mode for the pool (require) (wire: sslMode) |
uri | string | Connection URI to the pool |
Cloud database postgresql connection pool response body definition
| Name | Datatype | Description |
|---|---|---|
id | string (uuid) | ID of the connection pool |
name | string | Name of the connection pool |
database_id | string (uuid) | Database used for the connection pool (wire: databaseId) |
user_id | string (uuid) | User authorized to connect to the pool, if none all the users are allowed (wire: userId) |
mode | string | Connection mode to the connection pool (session, statement, transaction) |
port | integer | Port of the connection pool |
size | integer | Size of the connection pool |
ssl_mode | string | Ssl connection mode for the pool (require) (wire: sslMode) |
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 | cluster_id, connection_pool_id, service_name | Get the connectionPool for the postgresql cluster | |
list | select | cluster_id, service_name | x_pagination_mode | |
create | insert | cluster_id, service_name, database_id, mode, name, size | Create a new connectionPool on the postgresql cluster | |
update | update | cluster_id, connection_pool_id, service_name | Update a connectionPool on the postgresql cluster | |
delete | delete | cluster_id, connection_pool_id, service_name | Delete 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.
| 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"}}) |
cluster_id | string (uuid) | Cluster ID (wire: clusterId) |
connection_pool_id | string (uuid) | Connection pool ID (wire: connectionPoolId) |
service_name | string | The Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set. |
x_pagination_mode | string | Sent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode) |
SELECT examples​
- get
- list
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
;
Cloud database postgresql connection pool response body definition
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 service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
AND x_pagination_mode = '{{ x_pagination_mode }}'
;
INSERT examples​
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: postgresql_connection_pools
props:
- name: cluster_id
value: "{{ cluster_id }}"
description: Required parameter for the postgresql_connection_pools resource.
- name: service_name
value: "{{ service_name }}"
description: Required parameter for the postgresql_connection_pools resource.
- name: database_id
value: "{{ database_id }}"
description: |
Database used for the connection pool
- name: mode
value: "{{ mode }}"
description: |
Connection mode to the connection pool
valid_values: ['session', 'statement', 'transaction']
- name: name
value: "{{ name }}"
description: |
Name of the connection pool
- name: size
value: {{ size }}
description: |
Size of the connection pool
- name: user_id
value: "{{ user_id }}"
description: |
User authorized to connect to the pool, if none all the users are allowed
UPDATE examples​
- update
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
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
;