PostgreSQL

Create a PostgreSQL instance

post

This method allows to create a postgre SQL instance.

You will have to know at the minimum :

  • the area or availability zone of the region where you want to host your cluster (area & az attributes). Areas can be available in List Regions method.
  • the product code (productCode attribute).
  • name of postgre SQL cluster (name attribute). The name can contain any lowercase characters or numbers (5-60). It must not be the keyword 'cluster'.
  • Size of nodes in the postgre SQL cluster (nodeSizing attribute). Ex: 2cpu2gb
  • storage needed on each data node of the postgre SQL cluster (diskSize attribute). The possible values are at least 40 and maximum 1024 (representing GB).
  • how to connect to the instance (admPassword attribute). The password must be At least one lowercase, one uppercase, one digit, one special character, minimum length must be 12.
  • On which service the postgre SQL instance belongs to (serviceId attribute).
  • network ID of the cluster (networkId attribute).
  • Topology of the postgre SQL cluster (topology attribute). Either standalone / HA
  • trigram of the postgre SQL cluster (trigram attribute).
  • Allowed replication Lag of the postgre SQL (allowedReplicationLag attribute). The minimum size is 1 MB and maximum is 10240 MB

HA topology extra fields: These fields are required for HA clusters:

  • prefix of the node names for postgre cluster (nodePrefix attribute). The prefix should be from 5 to 12 characters and can contain any uppercase character.
  • Availability zone of the postgre cluster (az attribute).
  • Trigram of the postgre cluster (trigram attribute).
  • TLS enabled boolean for the postgre cluster (tls attribute).

This method is asynchronous (status code 202) and you'll have to wait for async action to be completed by checking its status.

POST /postgresql
{
   "productCode": "deb12pg16",
  "serviceId" : 123,
  "nodeSizing" : "2cpu4gb",
  "networkId" : 132,
  "area" : "EB-QA",
  "diskSize" : 40,
  "admPassword" : "Test123@2022",
  "allowedReplicationLag" : 10,
  "az" : "az",
  "topology" : "STANDALONE",
  "trigram" : "tri",
  "tls" : true,
  "name" : "NEWPOSTGRE01"
}
Authorizations
OAuth2implicitRequired

OAuth2 flow

Authorization URL:
Body
or
Responses
chevron-right
200

OK

application/vnd.cegedim-it.v1+json

An action gives status about processing of a task previously launched by an API call and asynchronously processed.

familystringOptional
idinteger · int32Optional
internalIdinteger · int64Optional
lastUpdatedAtstring · date-timeOptional
messagestringOptional

Human readable message of status

processstringOptional

Code of action performed

resourceNamestringOptional
resourceTypestringOptional
statusstring · enumOptional

Status label of action

Possible values:
post
/databases/postgresql

Delete PostgreSQL instance

delete

This method allows to delete a postgre SQL instance.

This method is asynchronous (status code 202) and you'll have to wait for async action to be completed by checking its status.

DELETE /postgresql/123

Authorizations
OAuth2implicitRequired

OAuth2 flow

Authorization URL:
Path parameters
idinteger · int64Required

id, example: 123

Responses
chevron-right
200

OK

application/vnd.cegedim-it.v1+json

An action gives status about processing of a task previously launched by an API call and asynchronously processed.

familystringOptional
idinteger · int32Optional
internalIdinteger · int64Optional
lastUpdatedAtstring · date-timeOptional
messagestringOptional

Human readable message of status

processstringOptional

Code of action performed

resourceNamestringOptional
resourceTypestringOptional
statusstring · enumOptional

Status label of action

Possible values:
delete
/databases/postgresql/{id}

Get a PostgreSQL instance

get
Authorizations
OAuth2implicitRequired

OAuth2 flow

Authorization URL:
Path parameters
idinteger · int64Required

id, example: 500061854

Responses
chevron-right
200

OK

application/vnd.cegedim-it.v1+json

PostgreCluster

allowMonitoringDisplaybooleanOptional
allowedReplicationLaginteger · int32Optional

Allowed replication Lag

areastringOptional

Area. Refer to an Area of a Region, that is a low-latency network area, available in List Regions method. If absent, default Area of Region will be used.

backupStatusbooleanOptional
categorystringOptional
cloudIdinteger · int64Optional
cloudNamestringOptional
commentstringOptional
cpuinteger · int64Optional
creationTimestringOptional
creationUserstringOptional
endOfSalesAtstring · date-timeOptional
endOfSupportAtstring · date-timeOptional
environmentstringOptional
extendedSupportAtstring · date-timeOptional
familystringOptional
idinteger · int64Optional
instanceCountinteger · int32Required

Number of instances to create in Postgre cluster

internalResourceIdinteger · int64Optional
internalTypestringOptional
ipAddressstringOptional

IP Address of the resource

labelstringOptional
labelAreastringOptional

Area pretty name

labelAvailabilityZonestringOptional

Availability Zone pretty name

labelDataCenterstringOptional

DataCenter pretty name

labelRegionstringOptional

Region pretty name

metrologyUrlstringOptional
monitoringRequestedbooleanOptional
namestringOptional
networkIdinteger · int32Required

Network Id

nodeCountinteger · int64Optional
nodeSizingstringRequired

Node sizing for Postgre cluster

pathstringOptional
prettyLabelstringOptional
productCodestringOptional
productNamestringOptional
productVersionstringOptional
raminteger · int64Optional
releasedAtstring · date-timeOptional
replicationStatusbooleanOptional
resourceTypestringOptional
serviceIdinteger · int64Optional
serviceKeystringOptional
serviceNamestringOptional
sizingstringOptional
statusstringOptional
storageinteger · int32Required

The storage needed on each data node of the Postgre cluster

supportLevelstring · enumOptionalPossible values:
supportPhasestringOptional
technologystringOptional
tlsEnabledbooleanOptional
topologystringOptional
trigramstringOptional
typestringOptional
urlstringOptional
versionstringOptional
get
/databases/postgresql/{id}

Update PostgreSQL

patch

This method allows to update a PostgreSQL instance.

Structure of payload is generic and describes :

  • operation you want to be performed
  • options data relative to the operation performed - see details - optional.

Below are different operations currently implemented.

Start PostgreSQL instance

Use the start operation to start a PostgreSQL instance.

Starts PostgreSQL instance.

This method is asynchronous (status code 202).

Example :

PATCH /postgresql/1234
{
    "operation": "start"
}

Stop PostgreSQL instance

Use the stop operation to stop the nodes of the PostgreSQL instance and the instance itself.

This operation cannot be undone afterwards.

This method is asynchronous (status code 202).

PATCH /postgresql/1234
{
	"operation":"stop"
}

Resize PostgreSQL instance

Use the resize operation to resize the nodes of the PostgreSQL instance and the instance itself.

This operation cannot be undone afterwards.

This method is asynchronous (status code 202).

PATCH /postgresql/1234
{
	"operation":"resize",
	"options": {
        "sizing": "2cpu4gb"
    }
}

Restore PostgreSQL instance

Use the restore operation to restore a PostgreSQL instance to another PostgreSQL instance with the same farm version.

  • the source instance must be backed up.
  • the source instance and destination farm must be ACTIVE
  • the timestamp must be between now and now - 14 days for production service and now - 7 days for non production service→ raise exception
  • timestamp should respect the format described in Json Schema (date-time) The following is correct : 2022-11-02T09:32:02.000+00:00

The available stop options are BEFORE and AFTER.

This method is asynchronous (status code 202).

PATCH /postgresql/5678
{
	"operation": "restore",
	"options": {
	    "sourceId": 1234,
	    "stop": "BEFORE",
	    "timestamp": "2022-11-02T09:32:02.000+00:00"
	}
}

Convert from Standalone to HA PostgreSQL instance

Use the enable_ha operation to convert a PostgreSQL instance from Standalone to HA mode.

  • the replicationLag must be between 1 and 500.
  • The standalone instance must have a version greater or egal to 12.
  • changeReference is optional

This method is asynchronous (status code 202).

PATCH /postgresql/5678
{
	"operation": "enable_ha",
	"options": {
	    "replicationLag": 50,
	    "changeReference": "000"
	}
}

Update Patch Party

Use the update_patch_party operation to update the patch party scheduled plan of the cluster.

  • Use the excluded option to turn on/off patch party.
  • Use the patchGroup option to select the patching group, the patchGroup is optional, and is only allowed when the farm has one member.
  • Use the exclusionReason option to explain the reason of excluding the resource from patch part.

This method is synchronous (status code 202).

  • Include from patch party body:
PATCH /postgresql/1234
{
  "operation": "update_patch_party",
  "options": {
    "patchParty": {
        "excluded": false,
        "patchGroup": "3"
    }
 }
}
  • Exclude from patch party body:
PATCH /postgresql/1234
{
  "operation": "update_patch_party",
  "options": {
    "patchParty": {
        "excluded": true,
        "exclusionReason": "I want to handle this by myself"
    }
 }
}

Install PostgreSQL extension

Use the install_extension operation to install an extension in the PostgreSQL.

This method is asynchronous (status code 202).

PATCH /postgresql/1234
{
	"operation":"install_extension",
	"options": {
        "dbname": "mydb",
        "extensions_list": [
        		{"name": "ext1"},
        		{"name": "ext2"}
        ]
    }
}

Upgrade PostgreSQL version

Use the upgrade operation to upgrade the PostgreSQL version.

This method is asynchronous (status code 202).

PATCH /postgresql/1234
{
	"operation":"upgrade",
	"options": {
        "targetVersion": "12",
        "changeReference": "RFC 1234"
    }
}
Authorizations
OAuth2implicitRequired

OAuth2 flow

Authorization URL:
Path parameters
idinteger · int64Required

id, example: 123

Body
operationstringOptional
Responses
chevron-right
200

OK

application/vnd.cegedim-it.v1+json

An action gives status about processing of a task previously launched by an API call and asynchronously processed.

familystringOptional
idinteger · int32Optional
internalIdinteger · int64Optional
lastUpdatedAtstring · date-timeOptional
messagestringOptional

Human readable message of status

processstringOptional

Code of action performed

resourceNamestringOptional
resourceTypestringOptional
statusstring · enumOptional

Status label of action

Possible values:
patch
/databases/postgresql/{id}

Get databases

get
Authorizations
OAuth2implicitRequired

OAuth2 flow

Authorization URL:
Path parameters
idinteger · int64Required

id, example: 500061854

Responses
chevron-right
200

OK

application/vnd.cegedim-it.v1+json
namestringOptional
get
/databases/postgresql/{id}/databases

Get extensions

get
Authorizations
OAuth2implicitRequired

OAuth2 flow

Authorization URL:
Path parameters
idinteger · int64Required

id, example: 500061854

Responses
chevron-right
200

OK

application/vnd.cegedim-it.v1+json
commentstringOptional
linkstringOptional
namestringOptional
requiresRestartingbooleanOptional
versionstringOptional
get
/databases/postgresql/{id}/extensions

Get network informations

get
Authorizations
OAuth2implicitRequired

OAuth2 flow

Authorization URL:
Path parameters
idinteger · int64Required
Responses
chevron-right
200

OK

application/vnd.cegedim-it.v1+json
areastringOptional
cidrstringOptional
cloudstringOptional
defaultNetworkbooleanOptional
descriptionstringOptional
environmentstringOptional
gatewaystringOptional
idinteger · int64Optional
ipAddressstringOptional
ipFreeNumberinteger · int32Optional
isIpRangePublicbooleanOptional
maskstringOptional
networkShortDescriptionstringOptional
regionstringOptional
scopestringOptional
shortDescriptionstringOptional
technicalIdstringOptional
usedPercentinteger · int32Optional
get
/databases/postgresql/{id}/networks

Get node information

get
Authorizations
OAuth2implicitRequired

OAuth2 flow

Authorization URL:
Path parameters
idinteger · int64Required
Responses
chevron-right
200

OK

application/vnd.cegedim-it.v1+json
authenticationDomainstringOptional
backupStatusbooleanOptional
categorystringOptional
cloudIdinteger · int64Optional
cloudNamestringOptional
commentstringOptional
cpuinteger · int64Optional

CPU of the resource

creationTimestringOptional
creationUserstringOptional
enableProfileBaseNtpbooleanOptional
enableProfileBaseResolvebooleanOptional
endOfSalesAtstring · date-timeOptional
endOfSupportAtstring · date-timeOptional
environmentstringOptional
extendedSupportAtstring · date-timeOptional
familystringOptional
firewallBlockIntraSubnetTrafficbooleanOptional
firewallEnablebooleanOptional
firewallPurgebooleanOptional
idinteger · int64Optional
imageCodestringOptional

Internal Image linked to this instance

internalResourceIdinteger · int64Optional
internalTypestringOptional
ipAddressstringOptional
isExternalIngressNodebooleanOptional

This instance is ingress external node

isInternalIngressNodebooleanOptional

This instance is ingress internal node

isMemberOFLoadBalancerbooleanOptional

Instance is member of load balancer

labelstringOptional
labelAreastringOptional

Area pretty name

labelAvailabilityZonestringOptional

Availability Zone pretty name

labelDataCenterstringOptional

DataCenter pretty name

labelRegionstringOptional

Region pretty name

manageSentinelOnebooleanOptional
metrologyUrlstringOptional
monitoringRequestedbooleanOptional
namestringOptional
ntpServersstring[]Optional
osNamestringOptional

OS name of this instance

osTypestringOptional

OS type of this instance

parentResourceTypestringOptional
pathstringOptional
prettyLabelstringOptional
productCodestringOptional
productNamestringOptional
productVersionstringOptional
raminteger · int64Optional

RAM of the resource

relayHoststringOptional
releasedAtstring · date-timeOptional
replicationStatusbooleanOptional
resourceTypestringOptional
serviceIdinteger · int64Optional
serviceKeystringOptional
serviceNamestringOptional
statusstringOptional
storagenumberOptional

Storage after disks format in GB of the resource

storageMoveInProgressbooleanOptional

Information about storage replication in Progress

supportLevelstring · enumOptionalPossible values:
supportPhasestringOptional
technologystringOptional
totalSizeDisksstringOptionalDeprecated

Total Disk size of the resource

typestringOptional
get
/databases/postgresql/{id}/nodes

Get versions

get
Authorizations
OAuth2implicitRequired

OAuth2 flow

Authorization URL:
Path parameters
idinteger · int64Required

id, example: 500061854

Responses
chevron-right
200

OK

application/vnd.cegedim-it.v1+json
integer · int64[]Optional
get
/databases/postgresql/{id}/versions

Last updated