EDB Postgres Enterprise Manager REST APIs v1.0.0 v10.2

EDB Postgres Enterprise Manager uses a token-based authentication mechanism to allow access to exposed REST APIs.

PEM uses tokens for authentication purposes. To generate a token, please refer the section Token. After receiving a token string, you should include the token string in the 'X-Auth-Token' header when calling any resources except https://PEM-SERVER-IP/api/token/.

NOTE:

  • EDB Postgres Enterprise Manager is referred as PEM in this documentation.
  • PEM *uses self-certified SSL certificates, so you may encounter errors such as 'SSL certificate problem: self signed certificate'. You may need to use an 'insecure' connection to connect to the server.

Rest api versions:

Base URLs:

Email: EnterpriseDB Web: EnterpriseDB License: Limited Use Software License Agreement

Token

A string generated and used by PEM REST APIs for authentication purposes

TokenGeneration

Code samples

POST /token/

Generate a token for authentication.

This URL creates a token to be used by the other REST APIs exposed by PEM. You must provide a valid username and password, which will be validated during the process.

The token will be valid for 20 mins.

Body parameter

{
  "username": "string",
  "password": "string"
}

Parameters

NameInTypeRequiredDescription
bodybodyobjecttrueCreates the token using the /token/ URL first.
» usernamebodystringtrueValidates username, which has pem_user role.
» passwordbodystringtruePassword for the username

Example responses

201 Response
{
  "issuedAt": "2019-08-24T14:15:22Z",
  "expiresAt": "2019-08-24T14:15:22Z",
  "schema_version": 0,
  "backend_schema_version": 0,
  "version_long": 0,
  "version": "string",
  "supported_api_versions": [
    "string"
  ],
  "deprecated_api_versions": [
    "string"
  ]
}

Responses

StatusMeaningDescriptionSchema
201CreatedToken was created and can be found as 'X-Subject-Token' in the response header.Inline
401UnauthorizedThe given information is not valid.None
500Internal Server ErrorSomething went wrong.None
503Service UnavailablePEM backend database server is down. Service is not available now.None

Response Schema

Status Code 201

Contains information related to when the token was generated and when it expired.

NameTypeRequiredRestrictionsDescription
» issuedAtstring(date-time)falsenoneToken was generated at this time.
» expiresAtstring(date-time)falsenoneProvides date and time when the token expires.
» schema_versionintegerfalsenoneApplication-supported schema version
» backend_schema_versionintegerfalsenoneBackend database schema version
» version_longintegerfalsenoneVersion represented in long format
» versionstringfalsenoneString reprentation of the PEM version
» supported_api_versions[string]falsenoneList of supported API versions
» deprecated_api_versions[string]falsenoneList of deprecated API versions

Response Headers

StatusHeaderTypeFormatDescription
201X-Subject-TokenstringReturns the new token, which can be used with REST APIs for further operations
Info

This operation does not require authentication

delete__token_

Code samples

DELETE /token/

Release the token.

Invalidates the token. It will no longer be available for further operations.

Parameters

NameInTypeRequiredDescription
X-Auth-TokenheaderstringtrueToken of authorization

Example responses

Responses

StatusMeaningDescriptionSchema
204No ContentSuccessfully released the token from PEM.
This token can not be used for any further operations.None

Response Schema

Info

This operation does not require authentication