Pular para o conteúdo principal
POST
/
v1
/
management
/
connections
Create a connection
curl --request POST \
  --url https://reporter.sandbox.lerian.net/v1/management/connections \
  --header 'Content-Type: application/json' \
  --header 'X-Product-Name: <x-product-name>' \
  --data '
{
  "configName": "production-db",
  "type": "POSTGRESQL",
  "host": "db.example.com",
  "port": 5432,
  "databaseName": "mydatabase",
  "userName": "dbuser",
  "password": "secretpassword",
  "schema": "public",
  "ssl": {
    "mode": "require",
    "ca": "-----BEGIN CERTIFICATE-----\nMIIDdzCCAl+gAwIBAgIEbV...\n-----END CERTIFICATE-----\n"
  },
  "metadata": {
    "environment": "production",
    "team": "data-engineering"
  }
}
'
{
  "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "configName": "production-db",
  "productName": "my-product",
  "type": "POSTGRESQL",
  "host": "db.example.com",
  "port": 5432,
  "databaseName": "mydatabase",
  "userName": "dbuser",
  "schema": "public",
  "ssl": {
    "mode": "require"
  },
  "metadata": {
    "environment": "production",
    "team": "data-engineering"
  },
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T10:30:00Z"
}

Cabeçalhos

Authorization
string

The authorization token in the Bearer <token> format.

Important: This header is required if your environment has Access Manager enabled. For more information, refer to the Access Manager documentation.

Exemplo:

"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

X-Product-Name
string
obrigatório

The product name to associate with this connection. Must contain only alphanumeric characters, underscores, and hyphens (max 100 characters). The value is normalized to lowercase.

Maximum string length: 100
Pattern: ^[a-zA-Z0-9_-]+$
Exemplo:

"my-product"

Corpo

application/json

Request body for creating a new database connection.

configName
string
obrigatório

Unique identifier name for this connection configuration. Must be between 3 and 100 characters. Must be unique within the organization.

Required string length: 3 - 100
Exemplo:

"production-db"

type
enum<string>
obrigatório

Database engine type. Supported values: ORACLE, SQL_SERVER, POSTGRESQL, MONGODB, MYSQL. Note that the data source type field in the List Data Sources endpoint returns lowercase identifiers (postgresql, mongodb).

Opções disponíveis:
ORACLE,
SQL_SERVER,
POSTGRESQL,
MONGODB,
MYSQL
Exemplo:

"POSTGRESQL"

host
string
obrigatório

Hostname or IP address of the database server.

Exemplo:

"db.example.com"

port
integer
obrigatório

Network port number for the database connection.

Intervalo obrigatório: 1 <= x <= 65535
Exemplo:

5432

databaseName
string
obrigatório

Name of the database to connect to on the target server.

Exemplo:

"mydatabase"

userName
string
obrigatório

Username credential for database authentication.

Exemplo:

"dbuser"

password
string<password>
obrigatório

Password credential for database authentication. This value is encrypted upon storage.

Exemplo:

"secretpassword"

schema
string

Database schema name (for example, public, my_schema). Useful for PostgreSQL databases with custom schemas. If omitted, Reporter defaults to the public schema.

Exemplo:

"public"

ssl
object

SSL configuration object containing certificate and security options.

metadata
object

An object containing key-value pairs for storing additional connection-related information. Keys (max 100 characters) and values (max 2000 characters) must be strings. Nested objects are not allowed.

Exemplo:
{
"environment": "production",
"team": "data-engineering"
}

Resposta

Indicates that the connection was successfully created.

Response object containing connection details.

id
string<uuid>
obrigatório

Unique identifier of the connection (UUID format).

Exemplo:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

configName
string
obrigatório

Unique identifier name for this connection configuration.

Exemplo:

"production-db"

type
enum<string>
obrigatório

Database engine type. Supported values: ORACLE, SQL_SERVER, POSTGRESQL, MONGODB, MYSQL. Note that the data source type field in the List Data Sources endpoint returns lowercase identifiers (postgresql, mongodb).

Opções disponíveis:
ORACLE,
SQL_SERVER,
POSTGRESQL,
MONGODB,
MYSQL
Exemplo:

"POSTGRESQL"

host
string
obrigatório

Hostname or IP address of the database server.

Exemplo:

"db.example.com"

port
integer
obrigatório

Network port number for the database connection.

Exemplo:

5432

databaseName
string
obrigatório

Name of the database to connect to on the target server.

Exemplo:

"mydatabase"

userName
string
obrigatório

Username credential for database authentication.

Exemplo:

"dbuser"

createdAt
string<date-time>
obrigatório

ISO 8601 timestamp indicating when the connection was created.

Exemplo:

"2024-01-15T10:30:00Z"

productName
string

The product name associated with this connection. May be empty if the connection has not been assigned to a product.

Exemplo:

"my-product"

schema
string

Database schema name, when set.

Exemplo:

"public"

ssl
object

SSL configuration object containing certificate and security options.

metadata
object

An object containing key-value pairs for storing additional connection-related information. Keys (max 100 characters) and values (max 2000 characters) must be strings. Nested objects are not allowed.

Exemplo:
{
"environment": "production",
"team": "data-engineering"
}
updatedAt
string<date-time>

ISO 8601 timestamp indicating when the connection was last updated.

Exemplo:

"2024-01-15T10:30:00Z"