Databases
Managed PostgreSQL Databases List
https://api.linode.com/v4/databases/postgresql/instances
Display all accessible Managed PostgreSQL Databases.
Query Parameters
The page of a collection to return.
The number of items to return per page.
Request Samples
- Shell
- CLI
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/databases/postgresql/instances/
Response Samples
- 200
- default
{}
Responses
200: Returns a paginated list of all accessible Managed PostgreSQL Databases on your Account.
default: Error
What happened to cause this error. In most cases, this can be fixed immediately by changing the data you sent in the request, but in some cases you will be instructed to open a Support Ticket or perform some other action before you can complete the request successfully.
The field in the request that caused this error. This may be a path, separated by periods in the case of nested fields. In some cases this may come back as "null" if the error is not specific to any single element of the request.
Managed PostgreSQL Database Create
https://api.linode.com/v4/databases/postgresql/instances
Provision a Managed PostgreSQL Database.
Restricted Users must have the add_databases
grant to use this command.
New instances can take approximately 15 to 30 minutes to provision.
The allow_list
is used to control access to the Managed Database.
IP addresses and ranges in this list can access the Managed Database. All other sources are blocked.
If
0.0.0.0/0
is a value in this list, then all IP addresses can access the Managed Database.Entering an empty array (
[]
) blocks all connections (both public and private) to the Managed Database.
All Managed Databases include automatic, daily backups. Up to seven backups are automatically stored for each Managed Database, providing restore points for each day of the past week.
All Managed Databases include automatic patch updates, which apply security patches and updates to the underlying operating system of the Managed PostgreSQL Database during configurable maintenance windows.
If your database cluster is configured with a single node, you will experience downtime during this maintenance window when any updates occur. It's recommended that you adjust this window to match a time that will be the least disruptive for your application and users. You may also want to consider upgrading to a high availability plan to avoid any downtime due to maintenance.
The database software is not updated automatically. To upgrade to a new database engine version, consider deploying a new Managed Database with your preferred version. You can then migrate your databases from the original Managed Database cluster to the new one.
To modify update the maintenance window for a Database, use the Managed PostgreSQL Database Update (PUT /databases/postgresql/instances/{instanceId}) command.
Request Body Schema
The Managed Database engine in engine/version format.
A unique, user-defined string referring to the Managed Database.
The Region ID for the Managed Database.
The Linode Instance type used by the Managed Database for its nodes.
A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format.
By default, this is an empty array ([]
), which blocks all connections (both public and private) to the Managed Database.
If 0.0.0.0/0
is a value in this list, then all IP addresses can access the Managed Database.
The number of Linode Instance nodes deployed to the Managed Database.
Choosing 3 nodes creates a high availability cluster consisting of 1 primary node and 2 replica nodes.
Whether the Managed Databases is encrypted.
The synchronization level of the replicating server.
Must be local
or off
for the asynch
replication type.
The replication method used for the Managed Database.
Defaults to none
for a single cluster and asynch
for a high availability cluster.
Must be none
for a single node cluster.
Must be asynch
for a high availability cluster.
Whether to require SSL credentials to establish a connection to the Managed Database.
Use the Managed PostgreSQL Database Credentials View (GET /databases/postgresql/instances/{instanceId}/credentials) command for access information.
Request Samples
- Shell
- CLI
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{ "label": "example-db",
"region": "us-east",
"type": "g6-dedicated-2",
"cluster_size": 3,
"engine": "postgresql/13.2",
"encrypted": false,
"ssl_connection": false,
"replication_type": "asynch",
"replication_commit_type": "local",
"allow_list": [
"203.0.113.1",
"192.0.1.0/24"
]
}' \
https://api.linode.com/v4/databases/postgresql/instances
Response Samples
- 200
- default
{
"status": "active",
"created": "2022-01-01T00:01:01",
"updated": "2022-01-01T00:01:01",
"id": 1234,
"label": "example-db",
"type": "g6-dedicated-2",
"engine": "postgresql",
"version": "13.2",
"region": "us-east",
"encrypted": "",
"allow_list": [],
"cluster_size": 3,
"hosts": {
"primary": "lin-0000-000-pgsql-primary.servers.linodedb.net",
"secondary": "lin-0000-000-pgsql-primary-private.servers.linodedb.net"
},
"ssl_connection": true,
"replication_type": "async",
"port": 3306,
"updates": {
"frequency": "weekly",
"duration": 3,
"hour_of_day": 0,
"day_of_week": 1,
"week_of_month": ""
},
"replication_commit_type": "local"
}
Responses
200: A new Managed PostgreSQL Database is provisioning.
The operating status of the Managed Database.
When this Managed Database was created.
When this Managed Database was last updated.
A unique ID that can be used to identify and reference the Managed Database.
A unique, user-defined string referring to the Managed Database.
The Linode Instance type used by the Managed Database for its nodes.
The Managed Database engine type.
The Managed Database engine version.
The Region ID for the Managed Database.
Whether the Managed Databases is encrypted.
A list of IP addresses that can access the Managed Database. Each item can be a single IP address or a range in CIDR format.
By default, this is an empty array ([]
), which blocks all connections (both public and private) to the Managed Database.
If 0.0.0.0/0
is a value in this list, then all IP addresses can access the Managed Database.
The number of Linode Instance nodes deployed to the Managed Database.
Choosing 3 nodes creates a high availability cluster consisting of 1 primary node and 2 replica nodes.
The primary and secondary hosts for the Managed Database. These are assigned after provisioning is complete.
The primary host for the Managed Database.
The secondary/private network host for the Managed Database.
A private network host and a private IP can only be used to access a Database Cluster from Linodes in the same data center and will not incur transfer costs.
Note: The secondary hostname is publicly viewable and accessible.
Whether to require SSL credentials to establish a connection to the Managed Database.
Use the Managed PostgreSQL Database Credentials View (GET /databases/postgresql/instances/{instanceId}/credentials) command for access information.
The replication method used for the Managed Database.
Defaults to none
for a single cluster and asynch
for a high availability cluster.
Must be none
for a single node cluster.
Must be asynch
for a high availability cluster.
The access port for this Managed Database.
Configuration settings for automated patch update maintenance for the Managed Database.
Whether maintenance occurs on a weekly or monthly basis.
The maximum maintenance window time in hours.
The hour to begin maintenance based in UTC time.
The day to perform maintenance. 1=Monday, 2=Tuesday, etc.
The week of the month to perform monthly
frequency updates. Defaults to null
.
Required for
monthly
frequency updates.Must be
null
forweekly
frequency updates.
The synchronization level of the replicating server.
Must be local
or off
for the asynch
replication type.
default: Error
What happened to cause this error. In most cases, this can be fixed immediately by changing the data you sent in the request, but in some cases you will be instructed to open a Support Ticket or perform some other action before you can complete the request successfully.
The field in the request that caused this error. This may be a path, separated by periods in the case of nested fields. In some cases this may come back as "null" if the error is not specific to any single element of the request.