mirror of
https://github.com/kennethreitz/neon-api-python.git
synced 2026-06-05 14:50:16 +00:00
5475 lines
258 KiB
JSON
5475 lines
258 KiB
JSON
{
|
|
"openapi": "3.0.3",
|
|
"servers": [
|
|
{
|
|
"url": "https://console.neon.tech/api/v2"
|
|
}
|
|
],
|
|
"info": {
|
|
"title": "Neon API",
|
|
"description": "The Neon API allows you to access and manage Neon programmatically. You can use the Neon API to manage API keys, projects, branches, endpoints, databases, roles, and operations. For information about these features, refer to the [Neon documentation](https://neon.tech/docs/manage/overview/).\n\nYou can run Neon API requests from this API reference using the **Try It** feature provided for each method. Enter your API key as a **Bearer** token in the **Authoization** section of the page.\n\nYou can create and manage API keys in the Neon Console. See [Manage API keys](https://neon.tech/docs/manage/api-keys/) for instructions.",
|
|
"version": "v2",
|
|
"contact": {
|
|
"email": "support@neon.tech"
|
|
},
|
|
"license": {
|
|
"name": "Proprietary"
|
|
}
|
|
},
|
|
"security": [
|
|
{
|
|
"BearerAuth": []
|
|
},
|
|
{
|
|
"CookieAuth": []
|
|
}
|
|
],
|
|
"tags": [
|
|
{
|
|
"name": "API Key",
|
|
"description": "These methods allow you to create and manage API keys for your Neon account. For related information, see [Manage API keys](https://neon.tech/docs/manage/api-keys)."
|
|
},
|
|
{
|
|
"name": "Operation",
|
|
"description": "These methods allow you to view operation details for your Neon project. For related information, see [Operations](https://neon.tech/docs/manage/operations)."
|
|
},
|
|
{
|
|
"name": "Project",
|
|
"description": "These methods allow you to create and manage Neon projects. For related information, see [Manage projects](https://neon.tech/docs/manage/projects)."
|
|
},
|
|
{
|
|
"name": "Branch",
|
|
"description": "These methods allow you to create and manage branches in your Neon project. For related information, see [Manage branches](https://neon.tech/docs/manage/branches)."
|
|
},
|
|
{
|
|
"name": "Endpoint",
|
|
"description": "These methods allow you to create and manage compute endpoints in your Neon project. For related information, see [Manage compute endpoints](https://neon.tech/docs/manage/endpoints)."
|
|
},
|
|
{
|
|
"name": "Preview",
|
|
"description": "New API methods that are in a Preview state and may be subject to changes."
|
|
},
|
|
{
|
|
"name": "Users",
|
|
"description": "These methods allow you to manage your Neon user account."
|
|
}
|
|
],
|
|
"paths": {
|
|
"/projects/{project_id}/applications/vercel": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"description": "Neon project ID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"/projects/{project_id}/applications/vercel/vars": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"description": "Neon project ID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"/projects/{project_id}/applications/polyscale/auth": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"description": "Neon project ID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"/projects/applications/polyscale/auth/callback": {
|
|
"parameters": [
|
|
{
|
|
"in": "query",
|
|
"name": "code",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "code for token request in oauth"
|
|
},
|
|
{
|
|
"in": "query",
|
|
"name": "state",
|
|
"schema": {
|
|
"type": "string"
|
|
},
|
|
"description": "state parameter from oauth"
|
|
}
|
|
]
|
|
},
|
|
"/projects/{project_id}/applications/polyscale/caches": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"description": "Neon project ID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"/projects/{project_id}/applications/polyscale/caches/{cache_id}": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"description": "Neon project ID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "cache_id",
|
|
"description": "Polyscale cache ID, from getProjectPolyscaleCaches",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"/projects/{project_id}/applications/polyscale/caches/{cache_id}/purge": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"description": "Neon project ID",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "cache_id",
|
|
"description": "Polyscale cache ID, from getProjectPolyscaleCaches",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"/applications/oauth/{client_id}": {
|
|
"parameters": [
|
|
{
|
|
"name": "client_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"/api_keys": {
|
|
"get": {
|
|
"summary": "Get a list of API keys",
|
|
"description": "Retrieves the API keys for your Neon account.\nThe response does not include API key tokens. A token is only provided when creating an API key.\nAPI keys can also be managed in the Neon Console.\nFor more information, see [Manage API keys](https://neon.tech/docs/manage/api-keys/).\n",
|
|
"tags": [
|
|
"API Key"
|
|
],
|
|
"operationId": "listApiKeys",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned the API keys for the Neon account",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ApiKeysListResponseItem"
|
|
},
|
|
"example": [
|
|
{
|
|
"id": 165432,
|
|
"name": "mykey_1",
|
|
"created_at": "2022-11-15T20:13:35Z",
|
|
"last_used_at": "2022-11-15T20:22:51Z",
|
|
"last_used_from_addr": "192.0.2.255"
|
|
},
|
|
{
|
|
"id": 165433,
|
|
"name": "mykey_2",
|
|
"created_at": "2022-11-15T20:12:36Z",
|
|
"last_used_at": "2022-11-15T20:15:04Z",
|
|
"last_used_from_addr": "192.0.2.255"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Create an API key",
|
|
"description": "Creates an API key.\nThe `key_name` is a user-specified name for the key.\nThis method returns an `id` and `key`. The `key` is a randomly generated, 64-bit token required to access the Neon API.\nAPI keys can also be managed in the Neon Console.\nSee [Manage API keys](https://neon.tech/docs/manage/api-keys/).\n",
|
|
"tags": [
|
|
"API Key"
|
|
],
|
|
"operationId": "createApiKey",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ApiKeyCreateRequest"
|
|
},
|
|
"example": {
|
|
"key_name": "mykey"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Created an API key",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ApiKeyCreateResponse"
|
|
},
|
|
"example": {
|
|
"id": 165434,
|
|
"key": "9v1faketcjbl4sn1013keyd43n2a8qlfakeog8yvp40hx16keyjo1bpds4y2dfms3",
|
|
"name": "mykey_1",
|
|
"created_at": "2022-11-15T20:13:35Z"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/api_keys/{key_id}": {
|
|
"delete": {
|
|
"summary": "Revoke an API key",
|
|
"description": "Revokes the specified API key.\nAn API key that is no longer needed can be revoked.\nThis action cannot be reversed.\nYou can obtain `key_id` values by listing the API keys for your Neon account.\nAPI keys can also be managed in the Neon Console.\nSee [Manage API keys](https://neon.tech/docs/manage/api-keys/).\n",
|
|
"tags": [
|
|
"API Key"
|
|
],
|
|
"operationId": "revokeApiKey",
|
|
"parameters": [
|
|
{
|
|
"name": "key_id",
|
|
"in": "path",
|
|
"description": "The API key ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Revoked the specified API key",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ApiKeyRevokeResponse"
|
|
},
|
|
"example": {
|
|
"id": 165435,
|
|
"name": "mykey",
|
|
"revoked": true,
|
|
"last_used_at": "2022-11-15T20:15:04Z",
|
|
"last_used_from_addr": "192.0.2.255"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/operations/{operation_id}": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "operation_id",
|
|
"in": "path",
|
|
"description": "The operation ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
}
|
|
}
|
|
],
|
|
"get": {
|
|
"summary": "Get operation details",
|
|
"description": "Retrieves details for the specified operation.\nAn operation is an action performed on a Neon project resource.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain a `operation_id` by listing operations for the project.\n",
|
|
"tags": [
|
|
"Operation"
|
|
],
|
|
"operationId": "getProjectOperation",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned details for the specified operation",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/OperationResponse"
|
|
},
|
|
"example": {
|
|
"operation": {
|
|
"id": "a07f8772-1877-4da9-a939-3a3ae62d1d8d",
|
|
"project_id": "floral-king-961888",
|
|
"branch_id": "br-bitter-sound-247814",
|
|
"endpoint_id": "ep-dark-snowflake-942567",
|
|
"action": "create_timeline",
|
|
"status": "finished",
|
|
"failures_count": 0,
|
|
"created_at": "2022-10-04T18:20:17Z",
|
|
"updated_at": "2022-10-04T18:20:18Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects": {
|
|
"get": {
|
|
"summary": "Get a list of projects",
|
|
"description": "Retrieves a list of projects for the Neon account.\nA project is the top-level object in the Neon object hierarchy.\nFor more information, see [Manage projects](https://neon.tech/docs/manage/projects/).\n",
|
|
"tags": [
|
|
"Project"
|
|
],
|
|
"operationId": "listProjects",
|
|
"parameters": [
|
|
{
|
|
"name": "cursor",
|
|
"description": "Specify the cursor value from the previous response to get the next batch of projects.",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"description": "Specify a value from 1 to 400 to limit number of projects in the response.",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"default": 10,
|
|
"maximum": 400
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned a list of projects for the Neon account",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/ProjectsResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/PaginationResponse"
|
|
}
|
|
]
|
|
},
|
|
"example": {
|
|
"projects": [
|
|
{
|
|
"id": "shiny-wind-028834",
|
|
"platform_id": "aws",
|
|
"region_id": "aws-us-east-2",
|
|
"name": "shiny-wind-028834",
|
|
"provisioner": "k8s-pod",
|
|
"pg_version": 15,
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-23T17:42:25Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"cpu_used_sec": 0,
|
|
"branch_logical_size_limit": 0,
|
|
"owner_id": "1232111",
|
|
"creation_source": "console",
|
|
"store_passwords": true,
|
|
"branch_logical_size_limit_bytes": 10800,
|
|
"active_time": 100
|
|
},
|
|
{
|
|
"id": "winter-boat-259881",
|
|
"platform_id": "aws",
|
|
"region_id": "aws-us-east-2",
|
|
"name": "winter-boat-259881",
|
|
"provisioner": "k8s-pod",
|
|
"pg_version": 15,
|
|
"created_at": "2022-11-23T17:52:25Z",
|
|
"updated_at": "2022-11-23T17:52:25Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"cpu_used_sec": 0,
|
|
"branch_logical_size_limit": 0,
|
|
"owner_id": "1232111",
|
|
"creation_source": "console",
|
|
"store_passwords": true,
|
|
"branch_logical_size_limit_bytes": 10800,
|
|
"active_time": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Create a project",
|
|
"description": "Creates a Neon project.\nA project is the top-level object in the Neon object hierarchy.\nPlan limits define how many projects you can create.\nNeon's Free plan permits one project per Neon account.\nFor more information, see [Manage projects](https://neon.tech/docs/manage/projects/).\n\nYou can specify a region and PostgreSQL version in the request body.\nNeon currently supports PostgreSQL 14 and 15.\nFor supported regions and `region_id` values, see [Regions](https://neon.tech/docs/introduction/regions/).\n",
|
|
"tags": [
|
|
"Project"
|
|
],
|
|
"operationId": "createProject",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProjectCreateRequest"
|
|
},
|
|
"examples": {
|
|
"required_attributes_only": {
|
|
"summary": "Required attributes only",
|
|
"value": {
|
|
"project": {
|
|
"name": "myproject"
|
|
}
|
|
}
|
|
},
|
|
"commonly_specified_attributes": {
|
|
"summary": "Commonly-specified attributes",
|
|
"value": {
|
|
"project": {
|
|
"name": "myproject",
|
|
"region_id": "aws-us-east-2",
|
|
"pg_version": 15
|
|
}
|
|
}
|
|
},
|
|
"with_autoscaling": {
|
|
"summary": "With autoscaling attributes",
|
|
"value": {
|
|
"project": {
|
|
"name": "myproject",
|
|
"region_id": "aws-us-east-2",
|
|
"pg_version": 15,
|
|
"autoscaling_limit_min_cu": 0.25,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"provisioner": "k8s-neonvm"
|
|
}
|
|
}
|
|
},
|
|
"with_branch_attributes": {
|
|
"summary": "With branch attributes",
|
|
"value": {
|
|
"project": {
|
|
"name": "myproject",
|
|
"region_id": "aws-us-east-2",
|
|
"pg_version": 15,
|
|
"branch": {
|
|
"name": "mybranch",
|
|
"role_name": "sally",
|
|
"database_name": "mydb"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"$ref": "#/components/responses/CreatedProject"
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/shared": {
|
|
"get": {
|
|
"summary": "Get a list of shared projects",
|
|
"description": "Retrieves a list of shared projects for the Neon account.\nA project is the top-level object in the Neon object hierarchy.\nFor more information, see [Manage projects](https://neon.tech/docs/manage/projects/).\n",
|
|
"tags": [
|
|
"Project"
|
|
],
|
|
"operationId": "listSharedProjects",
|
|
"parameters": [
|
|
{
|
|
"name": "cursor",
|
|
"description": "Specify the cursor value from the previous response to get the next batch of projects.",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"description": "Specify a value from 1 to 400 to limit number of projects in the response.",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"default": 10,
|
|
"maximum": 400
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned a list of shared projects for the Neon account",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/ProjectsResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/PaginationResponse"
|
|
}
|
|
]
|
|
},
|
|
"example": {
|
|
"projects": [
|
|
{
|
|
"id": "shiny-wind-028834",
|
|
"platform_id": "aws",
|
|
"region_id": "aws-us-east-2",
|
|
"name": "shiny-wind-028834",
|
|
"provisioner": "k8s-pod",
|
|
"pg_version": 15,
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-23T17:42:25Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"cpu_used_sec": 0,
|
|
"branch_logical_size_limit": 0,
|
|
"owner_id": "1232111",
|
|
"creation_source": "console",
|
|
"store_passwords": true,
|
|
"branch_logical_size_limit_bytes": 10800,
|
|
"active_time": 100
|
|
},
|
|
{
|
|
"id": "winter-boat-259881",
|
|
"platform_id": "aws",
|
|
"region_id": "aws-us-east-2",
|
|
"name": "winter-boat-259881",
|
|
"provisioner": "k8s-pod",
|
|
"pg_version": 15,
|
|
"created_at": "2022-11-23T17:52:25Z",
|
|
"updated_at": "2022-11-23T17:52:25Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"cpu_used_sec": 0,
|
|
"branch_logical_size_limit": 0,
|
|
"owner_id": "1232111",
|
|
"creation_source": "console",
|
|
"store_passwords": true,
|
|
"branch_logical_size_limit_bytes": 10800,
|
|
"active_time": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"get": {
|
|
"summary": "Get project details",
|
|
"description": "Retrieves information about the specified project.\nA project is the top-level object in the Neon object hierarchy.\nYou can obtain a `project_id` by listing the projects for your Neon account.\n",
|
|
"tags": [
|
|
"Project"
|
|
],
|
|
"operationId": "getProject",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned information about the specified project",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProjectResponse"
|
|
},
|
|
"example": {
|
|
"project": {
|
|
"id": "shiny-wind-028834",
|
|
"platform_id": "aws",
|
|
"region_id": "aws-us-east-2",
|
|
"name": "shiny-wind-028834",
|
|
"provisioner": "k8s-pod",
|
|
"pg_version": 15,
|
|
"history_retention_seconds": 604800,
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-23T17:42:25Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"branch_logical_size_limit": 0,
|
|
"cpu_used_sec": 10,
|
|
"owner_id": "1232111",
|
|
"owner": {
|
|
"email": "some@email.com",
|
|
"branches_limit": 10,
|
|
"subscription_type": "pro"
|
|
},
|
|
"creation_source": "console",
|
|
"store_passwords": true,
|
|
"branch_logical_size_limit_bytes": 10500,
|
|
"data_storage_bytes_hour": 1040,
|
|
"data_transfer_bytes": 1000000,
|
|
"written_data_bytes": 100800,
|
|
"compute_time_seconds": 100,
|
|
"active_time_seconds": 100,
|
|
"consumption_period_start": "2023-02-01T00:00:00Z",
|
|
"consumption_period_end": "2023-03-01T00:00:00Z"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"summary": "Update a project",
|
|
"description": "Updates the specified project.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nNeon permits updating the project name only.\n",
|
|
"tags": [
|
|
"Project"
|
|
],
|
|
"operationId": "updateProject",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProjectUpdateRequest"
|
|
},
|
|
"example": {
|
|
"project": {
|
|
"name": "myproject"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Updated the specified project",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/ProjectResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/OperationsResponse"
|
|
}
|
|
]
|
|
},
|
|
"example": {
|
|
"operations": [],
|
|
"project": {
|
|
"id": "shiny-wind-028834",
|
|
"platform_id": "aws",
|
|
"region_id": "aws-us-east-2",
|
|
"name": "myproject",
|
|
"provisioner": "k8s-pod",
|
|
"pg_version": 15,
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-12-04T02:39:25Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"branch_logical_size_limit": 0,
|
|
"cpu_used_sec": 213230,
|
|
"owner_id": "1232111",
|
|
"creation_source": "console",
|
|
"store_passwords": true,
|
|
"branch_logical_size_limit_bytes": 10500,
|
|
"data_storage_bytes_hour": 1040,
|
|
"data_transfer_bytes": 1000000,
|
|
"written_data_bytes": 100800,
|
|
"compute_time_seconds": 100,
|
|
"active_time_seconds": 100,
|
|
"history_retention_seconds": 604800,
|
|
"consumption_period_start": "2023-02-01T00:00:00Z",
|
|
"consumption_period_end": "2023-03-01T00:00:00Z"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "Delete a project",
|
|
"description": "Deletes the specified project.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nDeleting a project is a permanent action.\nDeleting a project also deletes endpoints, branches, databases, and users that belong to the project.\n",
|
|
"tags": [
|
|
"Project"
|
|
],
|
|
"operationId": "deleteProject",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted the specified project",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProjectResponse"
|
|
},
|
|
"example": {
|
|
"project": {
|
|
"id": "bold-cloud-468218",
|
|
"platform_id": "aws",
|
|
"region_id": "aws-us-east-2",
|
|
"name": "bold-cloud-468218",
|
|
"provisioner": "k8s-pod",
|
|
"pg_version": 15,
|
|
"created_at": "2022-11-30T18:41:29Z",
|
|
"updated_at": "2022-11-30T18:41:29Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"cpu_used_sec": 23004200,
|
|
"branch_logical_size_limit": 0,
|
|
"owner_id": "1232111",
|
|
"creation_source": "console",
|
|
"store_passwords": true,
|
|
"branch_logical_size_limit_bytes": 10500,
|
|
"data_storage_bytes_hour": 1040,
|
|
"data_transfer_bytes": 1000000,
|
|
"written_data_bytes": 100800,
|
|
"compute_time_seconds": 100,
|
|
"active_time_seconds": 100,
|
|
"history_retention_seconds": 604800,
|
|
"consumption_period_start": "2023-02-01T00:00:00Z",
|
|
"consumption_period_end": "2023-03-01T00:00:00Z"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/operations": {
|
|
"get": {
|
|
"summary": "Get a list of operations",
|
|
"description": "Retrieves a list of operations for the specified Neon project.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nThe number of operations returned can be large.\nTo paginate the response, issue an initial request with a `limit` value.\nThen, add the `cursor` value that was returned in the response to the next request.\n",
|
|
"tags": [
|
|
"Operation"
|
|
],
|
|
"operationId": "listProjectOperations",
|
|
"parameters": [
|
|
{
|
|
"name": "cursor",
|
|
"description": "Specify the cursor value from the previous response to get the next batch of operations",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"description": "Specify a value from 1 to 1000 to limit number of operations in the response",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 1000
|
|
}
|
|
},
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"$ref": "#/components/responses/ListOperations"
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/saved_queries": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"/projects/{project_id}/permissions": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"get": {
|
|
"summary": "Return project's permissions",
|
|
"description": "Return project's permissions",
|
|
"tags": [
|
|
"Project"
|
|
],
|
|
"operationId": "listProjectPermissions",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully returned permissions",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProjectPermissions"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Grant project permission to the user",
|
|
"description": "Grant project permission to the user",
|
|
"tags": [
|
|
"Project"
|
|
],
|
|
"operationId": "grantPermissionToProject",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/GrantPermissionToProjectRequest"
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully granted permission to the user",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProjectPermission"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/permissions/{permission_id}": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "permission_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"delete": {
|
|
"summary": "Revoke permission from the user",
|
|
"description": "Revoke permission from the user",
|
|
"tags": [
|
|
"Project"
|
|
],
|
|
"operationId": "revokePermissionFromProject",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully revoked permission from the user",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/ProjectPermission"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/saved_queries/{saved_query_id}": {
|
|
"parameters": [
|
|
{
|
|
"name": "saved_query_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"/projects/{project_id}/query/history": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"/projects/{project_id}/branches": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"post": {
|
|
"summary": "Create a branch",
|
|
"description": "Creates a branch in the specified project.\nYou can obtain a `project_id` by listing the projects for your Neon account.\n\nThis method does not require a request body, but you can specify one to create an endpoint for the branch or to select a non-default parent branch.\nThe default behavior is to create a branch from the project's root branch (`main`) with no endpoint, and the branch name is auto-generated.\nFor related information, see [Manage branches](https://neon.tech/docs/manage/branches/).\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "createProjectBranch",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/BranchCreateRequest"
|
|
},
|
|
"examples": {
|
|
"branch_only": {
|
|
"summary": "Branch only",
|
|
"value": {
|
|
"branch": {
|
|
"parent_id": "br-aged-salad-637688",
|
|
"name": "mybranch"
|
|
}
|
|
}
|
|
},
|
|
"branch_with_endpoint": {
|
|
"summary": "Branch with endpoint",
|
|
"value": {
|
|
"endpoints": [
|
|
{
|
|
"type": "read_write"
|
|
}
|
|
],
|
|
"branch": {
|
|
"parent_id": "br-aged-salad-637688",
|
|
"name": "mybranch"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": false
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"$ref": "#/components/responses/CreatedBranch"
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"get": {
|
|
"summary": "Get a list of branches",
|
|
"description": "Retrieves a list of branches for the specified project.\nYou can obtain a `project_id` by listing the projects for your Neon account.\n\nEach Neon project has a root branch named `main`.\nA `branch_id` value has a `br-` prefix.\nA project may contain child branches that were branched from `main` or from another branch.\nA parent branch is identified by the `parent_id` value, which is the `id` of the parent branch.\nFor related information, see [Manage branches](https://neon.tech/docs/manage/branches/).\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "listProjectBranches",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned a list of branches for the specified project",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/BranchesResponse"
|
|
},
|
|
"example": {
|
|
"branches": [
|
|
{
|
|
"id": "br-aged-salad-637688",
|
|
"project_id": "shiny-wind-028834",
|
|
"name": "main",
|
|
"current_state": "ready",
|
|
"logical_size": 28,
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-23T17:42:26Z",
|
|
"data_transfer_bytes": 1000000,
|
|
"written_data_bytes": 100800,
|
|
"compute_time_seconds": 100,
|
|
"active_time_seconds": 100,
|
|
"cpu_used_sec": 100,
|
|
"primary": true,
|
|
"creation_source": "console"
|
|
},
|
|
{
|
|
"id": "br-sweet-breeze-497520",
|
|
"project_id": "shiny-wind-028834",
|
|
"parent_id": "br-aged-salad-637688",
|
|
"parent_lsn": "0/1DE2850",
|
|
"name": "dev2",
|
|
"current_state": "ready",
|
|
"logical_size": 28,
|
|
"created_at": "2022-11-30T19:09:48Z",
|
|
"updated_at": "2022-11-30T19:09:49Z",
|
|
"data_transfer_bytes": 1000000,
|
|
"written_data_bytes": 100800,
|
|
"compute_time_seconds": 100,
|
|
"active_time_seconds": 100,
|
|
"cpu_used_sec": 100,
|
|
"primary": true,
|
|
"creation_source": "console"
|
|
},
|
|
{
|
|
"id": "br-raspy-hill-832856",
|
|
"project_id": "shiny-wind-028834",
|
|
"parent_id": "br-aged-salad-637688",
|
|
"parent_lsn": "0/19623D8",
|
|
"name": "dev1",
|
|
"current_state": "ready",
|
|
"logical_size": 21,
|
|
"created_at": "2022-11-30T17:36:57Z",
|
|
"updated_at": "2022-11-30T17:36:57Z",
|
|
"data_transfer_bytes": 1000000,
|
|
"written_data_bytes": 100800,
|
|
"compute_time_seconds": 100,
|
|
"active_time_seconds": 100,
|
|
"cpu_used_sec": 100,
|
|
"primary": true,
|
|
"creation_source": "console"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/branches/{branch_id}": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "branch_id",
|
|
"in": "path",
|
|
"description": "The branch ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"get": {
|
|
"summary": "Get branch details",
|
|
"description": "Retrieves information about the specified branch.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain a `branch_id` by listing the project's branches.\nA `branch_id` value has a `br-` prefix.\n\nEach Neon project has a root branch named `main`.\nA project may contain child branches that were branched from `main` or from another branch.\nA parent branch is identified by a `parent_id` value, which is the `id` of the parent branch.\nFor related information, see [Manage branches](https://neon.tech/docs/manage/branches/).\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "getProjectBranch",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned information about the specified branch",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/BranchResponse"
|
|
},
|
|
"example": {
|
|
"branch": {
|
|
"id": "br-aged-salad-637688",
|
|
"project_id": "shiny-wind-028834",
|
|
"name": "main",
|
|
"current_state": "ready",
|
|
"logical_size": 28,
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-23T17:42:26Z",
|
|
"data_transfer_bytes": 1000000,
|
|
"written_data_bytes": 100800,
|
|
"compute_time_seconds": 100,
|
|
"active_time_seconds": 100,
|
|
"cpu_used_sec": 100,
|
|
"primary": true,
|
|
"creation_source": "console"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "Delete a branch",
|
|
"description": "Deletes the specified branch from a project, and places\nall endpoints into an idle state, breaking existing client connections.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain a `branch_id` by listing the project's branches.\nFor related information, see [Manage branches](https://neon.tech/docs/manage/branches/).\n\nWhen a successful response status is received, the endpoints are still active,\nand the branch is not yet deleted from storage.\nThe deletion occurs after all operations finish.\nYou cannot delete a branch if it is the only remaining branch in the project.\nA project must have at least one branch.\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "deleteProjectBranch",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted the specified branch",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/BranchOperations"
|
|
},
|
|
"example": {
|
|
"branch": {
|
|
"id": "br-aged-salad-637688",
|
|
"project_id": "shiny-wind-028834",
|
|
"name": "main",
|
|
"current_state": "ready",
|
|
"logical_size": 28,
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-23T17:42:26Z",
|
|
"data_transfer_bytes": 1000000,
|
|
"written_data_bytes": 100800,
|
|
"compute_time_seconds": 100,
|
|
"active_time_seconds": 100,
|
|
"cpu_used_sec": 100,
|
|
"primary": true,
|
|
"creation_source": "console"
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "b6afbc21-2990-4a76-980b-b57d8c2948f2",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-sweet-breeze-497520",
|
|
"endpoint_id": "ep-soft-violet-752733",
|
|
"action": "suspend_compute",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-01T19:53:05Z",
|
|
"updated_at": "2022-12-01T19:53:05Z",
|
|
"total_duration_ms": 100
|
|
},
|
|
{
|
|
"id": "b6afbc21-2990-4a76-980b-b57d8c2948f2",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-sweet-breeze-497520",
|
|
"action": "delete_timeline",
|
|
"status": "scheduling",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-01T19:53:05Z",
|
|
"updated_at": "2022-12-01T19:53:05Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"summary": "Update a branch",
|
|
"description": "Updates the specified branch. Only changing the branch name is supported.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` by listing the project's branches.\nFor more information, see [Manage branches](https://neon.tech/docs/manage/branches/).\n",
|
|
"operationId": "updateProjectBranch",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/BranchUpdateRequest"
|
|
},
|
|
"example": {
|
|
"branch": {
|
|
"name": "mybranch"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Updated the specified branch",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/BranchOperations"
|
|
},
|
|
"example": {
|
|
"branch": {
|
|
"id": "br-icy-dream-250089",
|
|
"project_id": "shiny-wind-028834",
|
|
"parent_id": "br-aged-salad-637688",
|
|
"parent_lsn": "0/1E19478",
|
|
"name": "mybranch",
|
|
"current_state": "ready",
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-23T17:42:26Z",
|
|
"data_transfer_bytes": 1000000,
|
|
"written_data_bytes": 100800,
|
|
"compute_time_seconds": 100,
|
|
"active_time_seconds": 100,
|
|
"cpu_used_sec": 100,
|
|
"primary": true,
|
|
"creation_source": "console"
|
|
},
|
|
"operations": []
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/branches/{branch_id}/set_as_primary": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "branch_id",
|
|
"in": "path",
|
|
"description": "The branch ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"post": {
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"summary": "Set the branch as the primary branch of a project",
|
|
"description": "The primary mark is automatically removed from the previous primary branch.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` by listing the project's branches.\nFor more information, see [Manage branches](https://neon.tech/docs/manage/branches/).\n",
|
|
"operationId": "setPrimaryProjectBranch",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Updated the specified branch",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/BranchOperations"
|
|
},
|
|
"example": {
|
|
"branch": {
|
|
"cpu_used_sec": 1,
|
|
"active_time_seconds": 1,
|
|
"compute_time_seconds": 1,
|
|
"written_data_bytes": 100,
|
|
"data_transfer_bytes": 100,
|
|
"id": "br-icy-dream-250089",
|
|
"project_id": "shiny-wind-028834",
|
|
"parent_id": "br-aged-salad-637688",
|
|
"parent_lsn": "0/1E19478",
|
|
"name": "mybranch",
|
|
"current_state": "ready",
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-23T17:42:26Z",
|
|
"primary": true,
|
|
"creation_source": "console"
|
|
},
|
|
"operations": []
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/branches/{branch_id}/endpoints": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "branch_id",
|
|
"in": "path",
|
|
"description": "The branch ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"get": {
|
|
"summary": "Get a list of branch endpoints",
|
|
"description": "Retrieves a list of endpoints for the specified branch.\nCurrently, Neon permits only one endpoint per branch.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` by listing the project's branches.\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "listProjectBranchEndpoints",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned a list of endpoints for the specified branch",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EndpointsResponse"
|
|
},
|
|
"example": {
|
|
"endpoints": [
|
|
{
|
|
"host": "ep-little-smoke-851426.us-east-2.aws.neon.tech",
|
|
"id": "ep-little-smoke-851426",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-aged-salad-637688",
|
|
"autoscaling_limit_min_cu": 1,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"region_id": "aws-us-east-2",
|
|
"type": "read_write",
|
|
"current_state": "idle",
|
|
"settings": {
|
|
"pg_settings": {}
|
|
},
|
|
"pooler_enabled": false,
|
|
"pooler_mode": "transaction",
|
|
"disabled": false,
|
|
"passwordless_access": true,
|
|
"last_active": "2022-11-23T17:00:00Z",
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-30T18:25:21Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"creation_source": "console",
|
|
"provisioner": "k8s-pod",
|
|
"suspend_timeout_seconds": 10800
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/branches/{branch_id}/databases": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "branch_id",
|
|
"in": "path",
|
|
"description": "The branch ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"get": {
|
|
"summary": "Get a list of databases",
|
|
"description": "Retrieves a list of databases for the specified branch.\nA branch can have multiple databases.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` by listing the project's branches.\nFor related information, see [Manage databases](https://neon.tech/docs/manage/databases/).\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "listProjectBranchDatabases",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned a list of databases of the specified branch",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DatabasesResponse"
|
|
},
|
|
"example": {
|
|
"databases": [
|
|
{
|
|
"id": 834686,
|
|
"branch_id": "br-aged-salad-637688",
|
|
"name": "main",
|
|
"owner_name": "casey",
|
|
"created_at": "2022-11-30T18:25:15Z",
|
|
"updated_at": "2022-11-30T18:25:15Z"
|
|
},
|
|
{
|
|
"id": 834686,
|
|
"branch_id": "br-aged-salad-637688",
|
|
"name": "mydb",
|
|
"owner_name": "casey",
|
|
"created_at": "2022-10-30T17:14:13Z",
|
|
"updated_at": "2022-10-30T17:14:13Z"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"summary": "Create a database",
|
|
"description": "Creates a database in the specified branch.\nA branch can have multiple databases.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` by listing the project's branches.\nFor related information, see [Manage databases](https://neon.tech/docs/manage/databases/).\n",
|
|
"operationId": "createProjectBranchDatabase",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DatabaseCreateRequest"
|
|
},
|
|
"example": {
|
|
"database": {
|
|
"name": "mydb",
|
|
"owner_name": "casey"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created a database in the specified branch",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DatabaseOperations"
|
|
},
|
|
"example": {
|
|
"database": {
|
|
"id": 876692,
|
|
"branch_id": "br-aged-salad-637688",
|
|
"name": "mydb",
|
|
"owner_name": "casey",
|
|
"created_at": "2022-12-04T00:15:04Z",
|
|
"updated_at": "2022-12-04T00:15:04Z"
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "39426015-db00-40fa-85c5-1c7072df46d0",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-aged-salad-637688",
|
|
"endpoint_id": "ep-little-smoke-851426",
|
|
"action": "apply_config",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-04T00:15:04Z",
|
|
"updated_at": "2022-12-04T00:15:04Z",
|
|
"total_duration_ms": 100
|
|
},
|
|
{
|
|
"id": "b7483d4e-33da-4d40-b319-ac858d4d3e69",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-aged-salad-637688",
|
|
"endpoint_id": "ep-little-smoke-851426",
|
|
"action": "suspend_compute",
|
|
"status": "scheduling",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-04T00:15:04Z",
|
|
"updated_at": "2022-12-04T00:15:04Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/branches/{branch_id}/databases/{database_name}": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "branch_id",
|
|
"in": "path",
|
|
"description": "The branch ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "database_name",
|
|
"in": "path",
|
|
"description": "The database name",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"get": {
|
|
"summary": "Get database details",
|
|
"description": "Retrieves information about the specified database.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` and `database_name` by listing branch's databases.\nFor related information, see [Manage databases](https://neon.tech/docs/manage/databases/).\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "getProjectBranchDatabase",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned the database details",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DatabaseResponse"
|
|
},
|
|
"example": {
|
|
"database": {
|
|
"id": 834686,
|
|
"branch_id": "br-aged-salad-637688",
|
|
"name": "main",
|
|
"owner_name": "casey",
|
|
"created_at": "2022-11-30T18:25:15Z",
|
|
"updated_at": "2022-11-30T18:25:15Z"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"summary": "Update a database",
|
|
"description": "Updates the specified database in the branch.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` and `database_name` by listing the branch's databases.\nFor related information, see [Manage databases](https://neon.tech/docs/manage/databases/).\n",
|
|
"operationId": "updateProjectBranchDatabase",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DatabaseUpdateRequest"
|
|
},
|
|
"example": {
|
|
"database": {
|
|
"name": "mydb",
|
|
"owner_name": "sally"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Updated the database",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DatabaseOperations"
|
|
},
|
|
"example": {
|
|
"database": {
|
|
"id": 876692,
|
|
"branch_id": "br-aged-salad-637688",
|
|
"name": "mydb",
|
|
"owner_name": "sally",
|
|
"created_at": "2022-12-04T00:15:04Z",
|
|
"updated_at": "2022-12-04T00:15:04Z"
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "9ef1c2ed-dce4-43aa-bae8-78aea636bf8a",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-aged-salad-637688",
|
|
"endpoint_id": "ep-little-smoke-851426",
|
|
"action": "apply_config",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-04T00:21:01Z",
|
|
"updated_at": "2022-12-04T00:21:01Z",
|
|
"total_duration_ms": 100
|
|
},
|
|
{
|
|
"id": "42dafb46-f861-497b-ae89-f2bec54f4966",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-aged-salad-637688",
|
|
"endpoint_id": "ep-little-smoke-851426",
|
|
"action": "suspend_compute",
|
|
"status": "scheduling",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-04T00:21:01Z",
|
|
"updated_at": "2022-12-04T00:21:01Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "Delete a database",
|
|
"description": "Deletes the specified database from the branch.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` and `database_name` by listing branch's databases.\nFor related information, see [Manage databases](https://neon.tech/docs/manage/databases/).\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "deleteProjectBranchDatabase",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted the specified database",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/DatabaseOperations"
|
|
},
|
|
"example": {
|
|
"database": {
|
|
"id": 851537,
|
|
"branch_id": "br-raspy-hill-832856",
|
|
"name": "mydb",
|
|
"owner_name": "casey",
|
|
"created_at": "2022-12-01T19:41:46Z",
|
|
"updated_at": "2022-12-01T19:41:46Z"
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "9ef1c2ed-dce4-43aa-bae8-78aea636bf8a",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-raspy-hill-832856",
|
|
"endpoint_id": "ep-steep-bush-777093",
|
|
"action": "apply_config",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-01T19:51:41Z",
|
|
"updated_at": "2022-12-01T19:51:41Z",
|
|
"total_duration_ms": 100
|
|
},
|
|
{
|
|
"id": "42dafb46-f861-497b-ae89-f2bec54f4966",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-raspy-hill-832856",
|
|
"endpoint_id": "ep-steep-bush-777093",
|
|
"action": "suspend_compute",
|
|
"status": "scheduling",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-01T19:51:41Z",
|
|
"updated_at": "2022-12-01T19:51:41Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/branches/{branch_id}/roles": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "branch_id",
|
|
"in": "path",
|
|
"description": "The branch ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"get": {
|
|
"summary": "Get a list of roles",
|
|
"description": "Retrieves a list of roles from the specified branch.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` by listing the project's branches.\nIn Neon, the terms \"role\" and \"user\" are synonymous.\nFor related information, see [Manage roles](https://neon.tech/docs/manage/roles/).\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "listProjectBranchRoles",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned a list of roles from the specified branch.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/RolesResponse"
|
|
},
|
|
"example": {
|
|
"roles": [
|
|
{
|
|
"branch_id": "br-aged-salad-637688",
|
|
"name": "casey",
|
|
"protected": false,
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-23T17:42:25Z"
|
|
},
|
|
{
|
|
"branch_id": "br-aged-salad-637688",
|
|
"name": "thomas",
|
|
"protected": false,
|
|
"created_at": "2022-10-22T17:38:21Z",
|
|
"updated_at": "2022-10-22T17:38:21Z"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"summary": "Create a role",
|
|
"description": "Creates a role in the specified branch.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` by listing the project's branches.\nIn Neon, the terms \"role\" and \"user\" are synonymous.\nFor related information, see [Manage roles](https://neon.tech/docs/manage/roles/).\n\nConnections established to the active compute endpoint will be dropped.\nIf the compute endpoint is idle, the endpoint becomes active for a short period of time and is suspended afterward.\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "createProjectBranchRole",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/RoleCreateRequest"
|
|
},
|
|
"example": {
|
|
"role": {
|
|
"name": "sally"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created a role in the specified branch",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/RoleOperations"
|
|
},
|
|
"example": {
|
|
"role": {
|
|
"branch_id": "br-noisy-sunset-458773",
|
|
"name": "sally",
|
|
"password": "Onf1AjayKwe0",
|
|
"protected": false,
|
|
"created_at": "2022-12-03T11:58:29Z",
|
|
"updated_at": "2022-12-03T11:58:29Z"
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "2c2be371-d5ac-4db5-8b68-79f05e8bc287",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-noisy-sunset-458773",
|
|
"endpoint_id": "ep-small-pine-767857",
|
|
"action": "apply_config",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-03T11:58:29Z",
|
|
"updated_at": "2022-12-03T11:58:29Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/branches/{branch_id}/roles/{role_name}": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "branch_id",
|
|
"in": "path",
|
|
"description": "The branch ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "role_name",
|
|
"in": "path",
|
|
"description": "The role name",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"get": {
|
|
"summary": "Get role details",
|
|
"description": "Retrieves details about the specified role.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` by listing the project's branches.\nYou can obtain the `role_name` by listing the roles for a branch.\nIn Neon, the terms \"role\" and \"user\" are synonymous.\nFor related information, see [Manage roles](https://neon.tech/docs/manage/roles/).\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "getProjectBranchRole",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully returned details for the specified role",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/RoleResponse"
|
|
},
|
|
"example": {
|
|
"role": {
|
|
"branch_id": "br-noisy-sunset-458773",
|
|
"name": "casey",
|
|
"protected": false,
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-23T17:42:25Z"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "Delete a role",
|
|
"description": "Deletes the specified role from the branch.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` by listing the project's branches.\nYou can obtain the `role_name` by listing the roles for a branch.\nIn Neon, the terms \"role\" and \"user\" are synonymous.\nFor related information, see [Manage roles](https://neon.tech/docs/manage/roles/).\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "deleteProjectBranchRole",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted the specified role from the branch",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/RoleOperations"
|
|
},
|
|
"example": {
|
|
"role": {
|
|
"branch_id": "br-raspy-hill-832856",
|
|
"name": "thomas",
|
|
"protected": false,
|
|
"created_at": "2022-12-01T14:36:23Z",
|
|
"updated_at": "2022-12-01T14:36:23Z"
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "db646be3-eace-4910-9f60-8150823c5cb8",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-raspy-hill-832856",
|
|
"endpoint_id": "ep-steep-bush-777093",
|
|
"action": "apply_config",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-01T19:48:11Z",
|
|
"updated_at": "2022-12-01T19:48:11Z",
|
|
"total_duration_ms": 100
|
|
},
|
|
{
|
|
"id": "ab94cdad-7630-4943-a55e-5a0952d2e598",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-raspy-hill-832856",
|
|
"endpoint_id": "ep-steep-bush-777093",
|
|
"action": "suspend_compute",
|
|
"status": "scheduling",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-01T19:48:11Z",
|
|
"updated_at": "2022-12-01T19:48:11Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/branches/{branch_id}/roles/{role_name}/reveal_password": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "branch_id",
|
|
"in": "path",
|
|
"description": "The branch ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "role_name",
|
|
"in": "path",
|
|
"description": "The role name",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"get": {
|
|
"summary": "Get role password",
|
|
"description": "Retrieves the password for the specified role, if possible.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` by listing the project's branches.\nYou can obtain the `role_name` by listing the roles for a branch.\nIn Neon, the terms \"role\" and \"user\" are synonymous.\nFor related information, see [Manage roles](https://neon.tech/docs/manage/roles/).\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "getProjectBranchRolePassword",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Successfully returned password for the specified role",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/RolePasswordResponse"
|
|
},
|
|
"example": {
|
|
"password": "mypass"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Role not found",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"412": {
|
|
"description": "Storing passwords is disabled",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/branches/{branch_id}/roles/{role_name}/reset_password": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "branch_id",
|
|
"in": "path",
|
|
"description": "The branch ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "role_name",
|
|
"in": "path",
|
|
"description": "The role nam",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"post": {
|
|
"summary": "Reset the role password",
|
|
"description": "Resets the password for the specified role.\nReturns a new password and operations. The new password is ready to use when the last operation finishes.\nThe old password remains valid until last operation finishes.\nConnections to the compute endpoint are dropped. If idle,\nthe compute endpoint becomes active for a short period of time.\n\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain the `branch_id` by listing the project's branches.\nYou can obtain the `role_name` by listing the roles for a branch.\nIn Neon, the terms \"role\" and \"user\" are synonymous.\nFor related information, see [Manage roles](https://neon.tech/docs/manage/roles/).\n",
|
|
"tags": [
|
|
"Branch"
|
|
],
|
|
"operationId": "resetProjectBranchRolePassword",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Reset the passsword for the specified role",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/RoleOperations"
|
|
},
|
|
"example": {
|
|
"role": {
|
|
"branch_id": "br-noisy-sunset-458773",
|
|
"name": "sally",
|
|
"password": "ClfD0aVuK3eK",
|
|
"protected": false,
|
|
"created_at": "2022-12-03T12:39:39Z",
|
|
"updated_at": "2022-12-03T12:58:18Z"
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "6bef07a0-ebca-40cd-9100-7324036cfff2",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-noisy-sunset-458773",
|
|
"endpoint_id": "ep-small-pine-767857",
|
|
"action": "apply_config",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-03T12:58:18Z",
|
|
"updated_at": "2022-12-03T12:58:18Z",
|
|
"total_duration_ms": 100
|
|
},
|
|
{
|
|
"id": "16b5bfca-4697-4194-a338-d2cdc9aca2af",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-noisy-sunset-458773",
|
|
"endpoint_id": "ep-small-pine-767857",
|
|
"action": "suspend_compute",
|
|
"status": "scheduling",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-03T12:58:18Z",
|
|
"updated_at": "2022-12-03T12:58:18Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/endpoints": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"post": {
|
|
"summary": "Create an endpoint",
|
|
"description": "Creates an endpoint for the specified branch.\nAn endpoint is a Neon compute instance.\nThere is a maximum of one read-write endpoint per branch.\nIf the specified branch already has a read-write endpoint, the operation fails.\nA branch can have multiple read-only endpoints.\n\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain `branch_id` by listing the project's branches.\nA `branch_id` has a `br-` prefix.\nFor supported regions and `region_id` values, see [Regions](https://neon.tech/docs/introduction/regions/).\nFor more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).\n",
|
|
"tags": [
|
|
"Endpoint"
|
|
],
|
|
"operationId": "createProjectEndpoint",
|
|
"requestBody": {
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EndpointCreateRequest"
|
|
},
|
|
"examples": {
|
|
"required_attributes_only": {
|
|
"summary": "Required attributes only",
|
|
"value": {
|
|
"endpoint": {
|
|
"branch_id": "br-floral-mountain-251143",
|
|
"type": "read_write"
|
|
}
|
|
}
|
|
},
|
|
"with_region_attribute": {
|
|
"summary": "With region attribute",
|
|
"value": {
|
|
"endpoint": {
|
|
"branch_id": "br-floral-mountain-251143",
|
|
"type": "read_write",
|
|
"region_id": "aws-us-east-2"
|
|
}
|
|
}
|
|
},
|
|
"with_pooler_attribute": {
|
|
"summary": "With pooler attribute",
|
|
"value": {
|
|
"endpoint": {
|
|
"branch_id": "br-floral-mountain-251143",
|
|
"type": "read_write",
|
|
"pooler_enabled": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"required": true
|
|
},
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created an endpoint",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EndpointOperations"
|
|
},
|
|
"example": {
|
|
"endpoint": {
|
|
"host": "ep-shrill-thunder-454069.us-east-2.aws.neon.tech",
|
|
"id": "ep-shrill-thunder-454069",
|
|
"project_id": "bitter-meadow-966132",
|
|
"branch_id": "br-proud-paper-090813",
|
|
"autoscaling_limit_min_cu": 1,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"region_id": "aws-us-east-2",
|
|
"type": "read_write",
|
|
"current_state": "init",
|
|
"pending_state": "active",
|
|
"settings": {
|
|
"pg_settings": {}
|
|
},
|
|
"pooler_enabled": false,
|
|
"pooler_mode": "transaction",
|
|
"disabled": false,
|
|
"passwordless_access": true,
|
|
"created_at": "2022-12-03T15:37:07Z",
|
|
"updated_at": "2022-12-03T15:37:07Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"creation_source": "console",
|
|
"suspend_timeout_seconds": 10800,
|
|
"provisioner": "k8s-pod"
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "874f8bfe-f51d-4c61-85af-a29bea73e0e2",
|
|
"project_id": "bitter-meadow-966132",
|
|
"branch_id": "br-proud-paper-090813",
|
|
"endpoint_id": "ep-shrill-thunder-454069",
|
|
"action": "start_compute",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-03T15:37:07Z",
|
|
"updated_at": "2022-12-03T15:37:07Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"get": {
|
|
"summary": "Get a list of endpoints",
|
|
"description": "Retrieves a list of endpoints for the specified project.\nAn endpoint is a Neon compute instance.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nFor more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).\n",
|
|
"tags": [
|
|
"Endpoint"
|
|
],
|
|
"operationId": "listProjectEndpoints",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned a list of endpoints for the specified project",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EndpointsResponse"
|
|
},
|
|
"example": {
|
|
"endpoints": [
|
|
{
|
|
"host": "ep-little-smoke-851426.us-east-2.aws.neon.tech",
|
|
"creation_source": "console",
|
|
"suspend_timeout_seconds": 10800,
|
|
"provisioner": "k8s-pod",
|
|
"id": "ep-little-smoke-851426",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-aged-salad-637688",
|
|
"autoscaling_limit_min_cu": 1,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"region_id": "aws-us-east-2",
|
|
"type": "read_write",
|
|
"current_state": "idle",
|
|
"settings": {
|
|
"pg_settings": {}
|
|
},
|
|
"pooler_enabled": false,
|
|
"pooler_mode": "transaction",
|
|
"disabled": false,
|
|
"passwordless_access": true,
|
|
"last_active": "2022-11-23T17:00:00Z",
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-30T18:25:21Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech"
|
|
},
|
|
{
|
|
"host": "ep-steep-bush-777093.us-east-2.aws.neon.tech",
|
|
"creation_source": "console",
|
|
"suspend_timeout_seconds": 10800,
|
|
"provisioner": "k8s-pod",
|
|
"id": "ep-steep-bush-777093",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-raspy-hill-832856",
|
|
"autoscaling_limit_min_cu": 1,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"region_id": "aws-us-east-2",
|
|
"type": "read_write",
|
|
"current_state": "idle",
|
|
"settings": {
|
|
"pg_settings": {}
|
|
},
|
|
"pooler_enabled": false,
|
|
"pooler_mode": "transaction",
|
|
"disabled": false,
|
|
"passwordless_access": true,
|
|
"last_active": "2022-11-30T17:00:00Z",
|
|
"created_at": "2022-11-30T17:36:57Z",
|
|
"updated_at": "2022-11-30T18:42:58Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech"
|
|
},
|
|
{
|
|
"host": "ep-soft-violet-752733.us-east-2.aws.neon.tech",
|
|
"creation_source": "console",
|
|
"suspend_timeout_seconds": 10800,
|
|
"provisioner": "k8s-pod",
|
|
"id": "ep-soft-violet-752733",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-sweet-breeze-497520",
|
|
"autoscaling_limit_min_cu": 1,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"region_id": "aws-us-east-2",
|
|
"type": "read_write",
|
|
"current_state": "idle",
|
|
"settings": {
|
|
"pg_settings": {}
|
|
},
|
|
"pooler_enabled": false,
|
|
"pooler_mode": "transaction",
|
|
"disabled": false,
|
|
"passwordless_access": true,
|
|
"last_active": "2022-11-30T19:00:00Z",
|
|
"created_at": "2022-11-30T19:09:48Z",
|
|
"updated_at": "2022-11-30T19:14:51Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/endpoints/{endpoint_id}": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "endpoint_id",
|
|
"in": "path",
|
|
"description": "The endpoint ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"get": {
|
|
"summary": "Get an endpoint",
|
|
"description": "Retrieves information about the specified endpoint.\nAn endpoint is a Neon compute instance.\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain an `endpoint_id` by listing your project's endpoints.\nAn `endpoint_id` has an `ep-` prefix.\nFor more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).\n",
|
|
"tags": [
|
|
"Endpoint"
|
|
],
|
|
"operationId": "getProjectEndpoint",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned information about the specified endpoint",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EndpointResponse"
|
|
},
|
|
"example": {
|
|
"endpoint": {
|
|
"host": "ep-little-smoke-851426.us-east-2.aws.neon.tech",
|
|
"id": "ep-little-smoke-851426",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-aged-salad-637688",
|
|
"autoscaling_limit_min_cu": 1,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"region_id": "aws-us-east-2",
|
|
"type": "read_write",
|
|
"current_state": "idle",
|
|
"settings": {
|
|
"pg_settings": {}
|
|
},
|
|
"pooler_enabled": false,
|
|
"pooler_mode": "transaction",
|
|
"disabled": false,
|
|
"passwordless_access": true,
|
|
"last_active": "2022-11-23T17:00:00Z",
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-30T18:25:21Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"creation_source": "console",
|
|
"provisioner": "k8s-pod",
|
|
"suspend_timeout_seconds": 10800
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"summary": "Delete an endpoint",
|
|
"description": "Delete the specified endpoint.\nAn endpoint is a Neon compute instance.\nDeleting an endpoint drops existing network connections to the endpoint.\nThe deletion is completed when last operation in the chain finishes successfully.\n\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain an `endpoint_id` by listing your project's endpoints.\nAn `endpoint_id` has an `ep-` prefix.\nFor more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).\n",
|
|
"tags": [
|
|
"Endpoint"
|
|
],
|
|
"operationId": "deleteProjectEndpoint",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Deleted the specified endpoint",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EndpointOperations"
|
|
},
|
|
"example": {
|
|
"endpoint": {
|
|
"host": "ep-steep-bush-777093.us-east-2.aws.neon.tech",
|
|
"id": "ep-steep-bush-777093",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-raspy-hill-832856",
|
|
"autoscaling_limit_min_cu": 1,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"region_id": "aws-us-east-2",
|
|
"type": "read_write",
|
|
"current_state": "idle",
|
|
"settings": {
|
|
"pg_settings": {}
|
|
},
|
|
"pooler_enabled": false,
|
|
"pooler_mode": "transaction",
|
|
"disabled": false,
|
|
"passwordless_access": true,
|
|
"last_active": "2022-12-03T15:00:00Z",
|
|
"created_at": "2022-12-03T15:37:07Z",
|
|
"updated_at": "2022-12-03T15:49:10Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"creation_source": "console",
|
|
"provisioner": "k8s-pod",
|
|
"suspend_timeout_seconds": 10800
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "fd11748e-3c68-458f-b9e3-66d409e3eef0",
|
|
"project_id": "bitter-meadow-966132",
|
|
"branch_id": "br-proud-paper-090813",
|
|
"endpoint_id": "ep-shrill-thunder-454069",
|
|
"action": "suspend_compute",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-03T15:51:06Z",
|
|
"updated_at": "2022-12-03T15:51:06Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"tags": [
|
|
"Endpoint"
|
|
],
|
|
"summary": "Update an endpoint",
|
|
"description": "Updates the specified endpoint. Currently, only changing the associated branch is supported.\nThe branch that you specify cannot have an existing endpoint.\n\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain an `endpoint_id` and `branch_id` by listing your project's endpoints.\nAn `endpoint_id` has an `ep-` prefix. A `branch_id` has a `br-` prefix.\nFor more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).\n\nIf the returned list of operations is not empty, the endpoint is not ready to use.\nThe client must wait for the last operation to finish before using the endpoint.\nIf the endpoint was idle before the update, the endpoint becomes active for a short period of time,\nand the control plane suspends it again after the update.\n",
|
|
"operationId": "updateProjectEndpoint",
|
|
"requestBody": {
|
|
"required": true,
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EndpointUpdateRequest"
|
|
},
|
|
"example": {
|
|
"endpoint": {
|
|
"branch_id": "br-tiny-grass-283160"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"responses": {
|
|
"200": {
|
|
"description": "Updated the specified endpoint",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EndpointOperations"
|
|
},
|
|
"example": {
|
|
"endpoint": {
|
|
"host": "ep-steep-bush-777093.us-east-2.aws.neon.tech",
|
|
"id": "ep-steep-bush-777093",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-raspy-hill-832856",
|
|
"autoscaling_limit_min_cu": 1,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"region_id": "aws-us-east-2",
|
|
"type": "read_write",
|
|
"current_state": "idle",
|
|
"settings": {
|
|
"pg_settings": {}
|
|
},
|
|
"pooler_enabled": false,
|
|
"pooler_mode": "transaction",
|
|
"disabled": false,
|
|
"passwordless_access": true,
|
|
"last_active": "2022-12-03T15:00:00Z",
|
|
"created_at": "2022-12-03T15:37:07Z",
|
|
"updated_at": "2022-12-03T15:49:10Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"creation_source": "console",
|
|
"provisioner": "k8s-pod",
|
|
"suspend_timeout_seconds": 10800
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "3fc98ab8-f191-47b8-a427-5eb668ccc5b9",
|
|
"project_id": "bitter-meadow-966132",
|
|
"branch_id": "br-proud-paper-090813",
|
|
"endpoint_id": "ep-shrill-thunder-454069",
|
|
"action": "apply_config",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-03T15:51:06Z",
|
|
"updated_at": "2022-12-03T15:51:06Z",
|
|
"total_duration_ms": 100
|
|
},
|
|
{
|
|
"id": "9ffda74b-a582-4cff-b0f0-aaa8d14b8e6a",
|
|
"project_id": "bitter-meadow-966132",
|
|
"branch_id": "br-proud-paper-090813",
|
|
"endpoint_id": "ep-shrill-thunder-454069",
|
|
"action": "suspend_compute",
|
|
"status": "scheduling",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-03T15:51:06Z",
|
|
"updated_at": "2022-12-03T15:51:06Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/endpoints/{endpoint_id}/start": {
|
|
"post": {
|
|
"summary": "Start an endpoint",
|
|
"description": "Starts an endpoint. The endpoint is ready to use\nafter the last operation in chain finishes successfully.\n\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain an `endpoint_id` by listing your project's endpoints.\nAn `endpoint_id` has an `ep-` prefix.\nFor more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).\n",
|
|
"tags": [
|
|
"Endpoint"
|
|
],
|
|
"operationId": "startProjectEndpoint",
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "endpoint_id",
|
|
"in": "path",
|
|
"description": "The endpoint ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Started the specified endpoint",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EndpointOperations"
|
|
},
|
|
"example": {
|
|
"endpoint": {
|
|
"host": "ep-steep-bush-777093.us-east-2.aws.neon.tech",
|
|
"id": "ep-steep-bush-777093",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-raspy-hill-832856",
|
|
"autoscaling_limit_min_cu": 1,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"region_id": "aws-us-east-2",
|
|
"type": "read_write",
|
|
"current_state": "idle",
|
|
"settings": {
|
|
"pg_settings": {}
|
|
},
|
|
"pooler_enabled": false,
|
|
"pooler_mode": "transaction",
|
|
"disabled": false,
|
|
"passwordless_access": true,
|
|
"last_active": "2022-12-03T15:00:00Z",
|
|
"created_at": "2022-12-03T15:37:07Z",
|
|
"updated_at": "2022-12-03T15:49:10Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"creation_source": "console",
|
|
"provisioner": "k8s-pod",
|
|
"suspend_timeout_seconds": 10800
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "e061087e-3c99-4856-b9c8-6b7751a253af",
|
|
"project_id": "bitter-meadow-966132",
|
|
"branch_id": "br-proud-paper-090813",
|
|
"endpoint_id": "ep-shrill-thunder-454069",
|
|
"action": "start_compute",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-03T15:51:06Z",
|
|
"updated_at": "2022-12-03T15:51:06Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/endpoints/{endpoint_id}/suspend": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"description": "The Neon project ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "endpoint_id",
|
|
"in": "path",
|
|
"description": "The endpoint ID",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
],
|
|
"post": {
|
|
"summary": "Suspend an endpoint",
|
|
"description": "Suspend the specified endpoint\nYou can obtain a `project_id` by listing the projects for your Neon account.\nYou can obtain an `endpoint_id` by listing your project's endpoints.\nAn `endpoint_id` has an `ep-` prefix.\nFor more information about endpoints, see [Manage endpoints](https://neon.tech/docs/manage/endpoints/).\n",
|
|
"tags": [
|
|
"Endpoint"
|
|
],
|
|
"operationId": "suspendProjectEndpoint",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Suspended the specified endpoint",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/EndpointOperations"
|
|
},
|
|
"example": {
|
|
"endpoint": {
|
|
"host": "ep-steep-bush-777093.us-east-2.aws.neon.tech",
|
|
"id": "ep-steep-bush-777093",
|
|
"project_id": "shiny-wind-028834",
|
|
"branch_id": "br-raspy-hill-832856",
|
|
"autoscaling_limit_min_cu": 1,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"region_id": "aws-us-east-2",
|
|
"type": "read_write",
|
|
"current_state": "idle",
|
|
"settings": {
|
|
"pg_settings": {}
|
|
},
|
|
"pooler_enabled": false,
|
|
"pooler_mode": "transaction",
|
|
"disabled": false,
|
|
"passwordless_access": true,
|
|
"last_active": "2022-12-03T15:00:00Z",
|
|
"created_at": "2022-12-03T15:37:07Z",
|
|
"updated_at": "2022-12-03T15:49:10Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"creation_source": "console",
|
|
"provisioner": "k8s-pod",
|
|
"suspend_timeout_seconds": 10800
|
|
},
|
|
"operations": [
|
|
{
|
|
"id": "e061087e-3c99-4856-b9c8-6b7751a253af",
|
|
"project_id": "bitter-meadow-966132",
|
|
"branch_id": "br-proud-paper-090813",
|
|
"endpoint_id": "ep-shrill-thunder-454069",
|
|
"action": "suspend_compute",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-12-03T15:51:06Z",
|
|
"updated_at": "2022-12-03T15:51:06Z",
|
|
"total_duration_ms": 100
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/projects/{project_id}/endpoints/{endpoint_id}/passwordless_auth": {
|
|
"parameters": [
|
|
{
|
|
"name": "project_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "endpoint_id",
|
|
"in": "path",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"/consumption/projects": {
|
|
"get": {
|
|
"summary": "Retrieves a list consumption metrics for each project",
|
|
"description": "Retrieves a list consumption metrics for each project for the current billing period.\n**Important:** This is a preview API and may be subject to changes.\n",
|
|
"tags": [
|
|
"Preview"
|
|
],
|
|
"operationId": "listProjectsConsumption",
|
|
"parameters": [
|
|
{
|
|
"name": "cursor",
|
|
"description": "Specify the cursor value from the previous response to get the next batch of projects.",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"description": "Specify a value from 1 to 1000 to limit number of projects in the response.",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"default": 10,
|
|
"maximum": 1000
|
|
}
|
|
},
|
|
{
|
|
"name": "from",
|
|
"description": "Specify the start date-time for the consumption period.\nIf `from` or `to` is not specified, we return only current consumption period.\n",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
},
|
|
{
|
|
"name": "to",
|
|
"description": "Specify the end date-time period for the consumption period.\nIf `from` or `to` is not specified, only the current consumption period is returned.\n",
|
|
"in": "query",
|
|
"schema": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned a list of project consumption metrics for the Neon account",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/ProjectsConsumptionResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/PaginationResponse"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/users/me": {
|
|
"get": {
|
|
"summary": "Get current user details",
|
|
"description": "Retrieves information about the current Neon user account.\n",
|
|
"tags": [
|
|
"Users"
|
|
],
|
|
"operationId": "getCurrentUserInfo",
|
|
"responses": {
|
|
"200": {
|
|
"description": "Returned information about the current user\n",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/CurrentUserInfoResponse"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"default": {
|
|
"$ref": "#/components/responses/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"components": {
|
|
"responses": {
|
|
"ListOperations": {
|
|
"description": "Returned a list of operations\n",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/OperationsResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/PaginationResponse"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"CreatedProject": {
|
|
"description": "Created a project.\nThe project includes a connection URI with a database, password, and role.\nAt least one non-protected role is created with a password.\nWait until the operations are finished before attempting to connect to a project database.\n",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/ProjectResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/ConnectionURIsResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/RolesResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/DatabasesResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/OperationsResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/BranchResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/EndpointsResponse"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"CreatedBranch": {
|
|
"description": "Created a branch. An endpoint is only created if it was specified in the request.",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/BranchResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/EndpointsResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/OperationsResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/RolesResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/DatabasesResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/ConnectionURIsOptionalResponse"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"GeneralError": {
|
|
"description": "General Error",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/GeneralError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"HealthCheck": {
|
|
"description": "Service is running",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"$ref": "#/components/schemas/HealthCheck"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"securitySchemes": {
|
|
"BearerAuth": {
|
|
"type": "http",
|
|
"scheme": "bearer",
|
|
"description": "The Neon API requires an API key to authorize your requests, which you can enter below.\nRefer to our documentation to find out how to generate and use [API keys](https://neon.tech/docs/manage/api-keys).\n"
|
|
},
|
|
"CookieAuth": {
|
|
"type": "apiKey",
|
|
"in": "cookie",
|
|
"name": "zenith"
|
|
}
|
|
},
|
|
"schemas": {
|
|
"ComputeUnit": {
|
|
"type": "number",
|
|
"minimum": 0.25
|
|
},
|
|
"Provisioner": {
|
|
"type": "string",
|
|
"description": "The Neon compute provisioner.\nSpecify the `k8s-neonvm` provisioner to create a compute endpoint that supports Autoscaling.\n",
|
|
"enum": [
|
|
"k8s-pod",
|
|
"k8s-neonvm"
|
|
]
|
|
},
|
|
"PaginationResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"pagination": {
|
|
"$ref": "#/components/schemas/Pagination"
|
|
}
|
|
}
|
|
},
|
|
"Pagination": {
|
|
"description": "Cursor based pagination is used. The user must pass the cursor as is to the backend.\nFor more information about cursor based pagination, see\nhttps://learn.microsoft.com/en-us/ef/core/querying/pagination#keyset-pagination\n",
|
|
"type": "object",
|
|
"required": [
|
|
"cursor",
|
|
"limit"
|
|
],
|
|
"properties": {
|
|
"cursor": {
|
|
"type": "string",
|
|
"minLength": 1
|
|
}
|
|
},
|
|
"example": {
|
|
"cursor": "2022-12-07T00:45:05.262011Z"
|
|
}
|
|
},
|
|
"EmptyResponse": {
|
|
"type": "object",
|
|
"description": "Empty response.",
|
|
"properties": {}
|
|
},
|
|
"ApiKeyCreateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"key_name"
|
|
],
|
|
"properties": {
|
|
"key_name": {
|
|
"type": "string",
|
|
"description": "A user-specified API key name. This value is required when creating an API key."
|
|
}
|
|
}
|
|
},
|
|
"ApiKeyCreateResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"key",
|
|
"id",
|
|
"name",
|
|
"created_at"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"description": "The API key ID",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"key": {
|
|
"description": "The generated 64-bit token required to access the Neon API",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "The user-specified API key name",
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"description": "A timestamp indicating when the API key was created",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"ApiKeyRevokeResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"revoked",
|
|
"last_used_from_addr"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"description": "The API key ID",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"name": {
|
|
"description": "The user-specified API key name",
|
|
"type": "string"
|
|
},
|
|
"revoked": {
|
|
"description": "A `true` or `false` value indicating whether the API key is revoked",
|
|
"type": "boolean"
|
|
},
|
|
"last_used_at": {
|
|
"description": "A timestamp indicating when the API was last used",
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"nullable": true
|
|
},
|
|
"last_used_from_addr": {
|
|
"description": "The IP address from which the API key was last used",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"ApiKeysListResponseItem": {
|
|
"type": "object",
|
|
"required": [
|
|
"last_used_from_addr",
|
|
"id",
|
|
"name",
|
|
"created_at"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"description": "The API key ID",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"name": {
|
|
"description": "The user-specified API key name",
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"description": "A timestamp indicating when the API key was created",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"last_used_at": {
|
|
"description": "A timestamp indicating when the API was last used",
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"nullable": true
|
|
},
|
|
"last_used_from_addr": {
|
|
"description": "The IP address from which the API key was last used",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Operation": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"project_id",
|
|
"action",
|
|
"status",
|
|
"failures_count",
|
|
"created_at",
|
|
"updated_at",
|
|
"total_duration_ms"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"description": "The operation ID",
|
|
"type": "string",
|
|
"format": "uuid"
|
|
},
|
|
"project_id": {
|
|
"description": "The Neon project ID",
|
|
"type": "string"
|
|
},
|
|
"branch_id": {
|
|
"description": "The branch ID",
|
|
"type": "string"
|
|
},
|
|
"endpoint_id": {
|
|
"description": "The endpoint ID",
|
|
"type": "string"
|
|
},
|
|
"action": {
|
|
"$ref": "#/components/schemas/OperationAction"
|
|
},
|
|
"status": {
|
|
"$ref": "#/components/schemas/OperationStatus"
|
|
},
|
|
"error": {
|
|
"description": "The error that occured",
|
|
"type": "string"
|
|
},
|
|
"failures_count": {
|
|
"description": "The number of times the operation failed",
|
|
"type": "integer",
|
|
"format": "int32"
|
|
},
|
|
"retry_at": {
|
|
"description": "A timestamp indicating when the operation was last retried",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"created_at": {
|
|
"description": "A timestamp indicating when the operation was created",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updated_at": {
|
|
"description": "A timestamp indicating when the operation status was last updated",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"total_duration_ms": {
|
|
"description": "The total duration of the operation in milliseconds",
|
|
"type": "integer",
|
|
"format": "int32"
|
|
}
|
|
},
|
|
"example": [
|
|
{
|
|
"id": "a07f8772-1877-4da9-a939-3a3ae62d1d8d",
|
|
"project_id": "spring-example-302709",
|
|
"branch_id": "br-wispy-meadow-118737",
|
|
"endpoint_id": "ep-silent-smoke-806639",
|
|
"action": "create_branch",
|
|
"status": "running",
|
|
"failures_count": 0,
|
|
"created_at": "2022-11-08T23:33:16Z",
|
|
"updated_at": "2022-11-08T23:33:20Z",
|
|
"total_duration_ms": 400
|
|
},
|
|
{
|
|
"id": "d8ac46eb-a757-42b1-9907-f78322ee394e",
|
|
"project_id": "spring-example-302709",
|
|
"branch_id": "br-wispy-meadow-118737",
|
|
"endpoint_id": "ep-silent-smoke-806639",
|
|
"action": "start_compute",
|
|
"status": "finished",
|
|
"failures_count": 0,
|
|
"created_at": "2022-11-15T20:02:00Z",
|
|
"updated_at": "2022-11-15T20:02:02Z",
|
|
"total_duration_ms": 200
|
|
}
|
|
]
|
|
},
|
|
"OperationResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"operation"
|
|
],
|
|
"properties": {
|
|
"operation": {
|
|
"$ref": "#/components/schemas/Operation"
|
|
}
|
|
}
|
|
},
|
|
"OperationsResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"operations"
|
|
],
|
|
"properties": {
|
|
"operations": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Operation"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"OperationAction": {
|
|
"description": "The action performed by the operation",
|
|
"type": "string",
|
|
"enum": [
|
|
"create_compute",
|
|
"create_timeline",
|
|
"start_compute",
|
|
"suspend_compute",
|
|
"apply_config",
|
|
"check_availability",
|
|
"delete_timeline",
|
|
"create_branch",
|
|
"tenant_ignore",
|
|
"tenant_attach",
|
|
"tenant_detach",
|
|
"tenant_reattach",
|
|
"replace_safekeeper",
|
|
"disable_maintenance",
|
|
"apply_storage_config"
|
|
]
|
|
},
|
|
"OperationStatus": {
|
|
"description": "The status of the operation",
|
|
"type": "string",
|
|
"enum": [
|
|
"running",
|
|
"finished",
|
|
"failed",
|
|
"scheduling"
|
|
]
|
|
},
|
|
"ProjectListItem": {
|
|
"description": "Essential data about the project. Full data is available at the getProject endpoint.\n",
|
|
"type": "object",
|
|
"required": [
|
|
"active_time",
|
|
"id",
|
|
"platform_id",
|
|
"region_id",
|
|
"name",
|
|
"pg_version",
|
|
"proxy_host",
|
|
"branch_logical_size_limit",
|
|
"branch_logical_size_limit_bytes",
|
|
"provisioner",
|
|
"store_passwords",
|
|
"cpu_used_sec",
|
|
"creation_source",
|
|
"created_at",
|
|
"updated_at",
|
|
"owner_id"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"description": "The project ID\n",
|
|
"type": "string"
|
|
},
|
|
"platform_id": {
|
|
"description": "The cloud platform identifier. Currently, only AWS is supported, for which the identifier is `aws`.\n",
|
|
"type": "string"
|
|
},
|
|
"region_id": {
|
|
"description": "The region identifier\n",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "The project name\n",
|
|
"type": "string"
|
|
},
|
|
"provisioner": {
|
|
"$ref": "#/components/schemas/Provisioner"
|
|
},
|
|
"default_endpoint_settings": {
|
|
"$ref": "#/components/schemas/DefaultEndpointSettings"
|
|
},
|
|
"settings": {
|
|
"$ref": "#/components/schemas/ProjectSettingsData"
|
|
},
|
|
"pg_version": {
|
|
"$ref": "#/components/schemas/PgVersion"
|
|
},
|
|
"proxy_host": {
|
|
"description": "The proxy host for the project. This value combines the `region_id`, the `platform_id`, and the Neon domain (`neon.tech`).\n",
|
|
"type": "string"
|
|
},
|
|
"branch_logical_size_limit": {
|
|
"description": "The logical size limit for a branch. The value is in MiB.\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"branch_logical_size_limit_bytes": {
|
|
"description": "The logical size limit for a branch. The value is in B.\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"store_passwords": {
|
|
"description": "Whether or not passwords are stored for roles in the Neon project. Storing passwords facilitates access to Neon features that require authorization.\n",
|
|
"type": "boolean"
|
|
},
|
|
"active_time": {
|
|
"description": "Control plane observed endpoints of this project being active this amount of wall-clock time.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"cpu_used_sec": {
|
|
"deprecated": true,
|
|
"description": "DEPRECATED. Use data from the getProject endpoint instead.\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"maintenance_starts_at": {
|
|
"description": "A timestamp indicating when project maintenance begins. If set, the project is placed into maintenance mode at this time.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"creation_source": {
|
|
"description": "The project creation source\n",
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"description": "A timestamp indicating when the project was created\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updated_at": {
|
|
"description": "A timestamp indicating when the project was last updated\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"synthetic_storage_size": {
|
|
"description": "The current space occupied by the project in storage, in bytes. Synthetic storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches in a project.\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"quota_reset_at": {
|
|
"deprecated": true,
|
|
"description": "DEPRECATED. Use `consumption_period_end` from the getProject endpoint instead.\nA timestamp indicating when the project quota resets\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"owner_id": {
|
|
"type": "string"
|
|
},
|
|
"compute_last_active_at": {
|
|
"description": "The most recent time when any endpoint of this project was active.\n\nOmitted when observed no actitivy for endpoints of this project.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
},
|
|
"example": {
|
|
"id": "spring-example-302709",
|
|
"platform_id": "aws",
|
|
"region_id": "aws-us-east-2",
|
|
"name": "spring-example-302709",
|
|
"provisioner": "k8s-pod",
|
|
"pg_version": 15,
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"store_passwords": true,
|
|
"creation_source": "console",
|
|
"created_at": "2022-12-13T01:30:55Z",
|
|
"updated_at": "2022-12-13T01:30:55Z"
|
|
}
|
|
},
|
|
"Project": {
|
|
"type": "object",
|
|
"required": [
|
|
"consumption_period_end",
|
|
"consumption_period_start",
|
|
"active_time_seconds",
|
|
"compute_time_seconds",
|
|
"written_data_bytes",
|
|
"data_transfer_bytes",
|
|
"data_storage_bytes_hour",
|
|
"id",
|
|
"platform_id",
|
|
"region_id",
|
|
"name",
|
|
"pg_version",
|
|
"proxy_host",
|
|
"branch_logical_size_limit",
|
|
"branch_logical_size_limit_bytes",
|
|
"store_passwords",
|
|
"cpu_used_sec",
|
|
"provisioner",
|
|
"creation_source",
|
|
"history_retention_seconds",
|
|
"created_at",
|
|
"updated_at",
|
|
"owner_id"
|
|
],
|
|
"properties": {
|
|
"data_storage_bytes_hour": {
|
|
"description": "Bytes-Hour. Project consumed that much storage hourly during the billing period. The value has some lag.\nThe value is reset at the beginning of each billing period.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"data_transfer_bytes": {
|
|
"description": "Bytes. Egress traffic from the Neon cloud to the client for given project over the billing period.\nIncludes deleted endpoints. The value has some lag. The value is reset at the beginning of each billing period.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"written_data_bytes": {
|
|
"description": "Bytes. Amount of WAL that travelled through storage for given project across all branches.\nThe value has some lag. The value is reset at the beginning of each billing period.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"compute_time_seconds": {
|
|
"description": "Seconds. The number of CPU seconds used by the project's compute endpoints, including compute endpoints that have been deleted.\nThe value has some lag. The value is reset at the beginning of each billing period.\nExamples:\n1. An endpoint that uses 1 CPU for 1 second is equal to `compute_time=1`.\n2. An endpoint that uses 2 CPUs simultaneously for 1 second is equal to `compute_time=2`.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"active_time_seconds": {
|
|
"description": "Seconds. Control plane observed endpoints of this project being active this amount of wall-clock time.\nThe value has some lag.\nThe value is reset at the beginning of each billing period.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"cpu_used_sec": {
|
|
"description": "DEPRECATED, use compute_time instead.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"deprecated": true
|
|
},
|
|
"id": {
|
|
"description": "The project ID\n",
|
|
"type": "string"
|
|
},
|
|
"platform_id": {
|
|
"description": "The cloud platform identifier. Currently, only AWS is supported, for which the identifier is `aws`.\n",
|
|
"type": "string"
|
|
},
|
|
"region_id": {
|
|
"description": "The region identifier\n",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "The project name\n",
|
|
"type": "string"
|
|
},
|
|
"provisioner": {
|
|
"$ref": "#/components/schemas/Provisioner"
|
|
},
|
|
"default_endpoint_settings": {
|
|
"$ref": "#/components/schemas/DefaultEndpointSettings"
|
|
},
|
|
"settings": {
|
|
"$ref": "#/components/schemas/ProjectSettingsData"
|
|
},
|
|
"pg_version": {
|
|
"$ref": "#/components/schemas/PgVersion"
|
|
},
|
|
"proxy_host": {
|
|
"description": "The proxy host for the project. This value combines the `region_id`, the `platform_id`, and the Neon domain (`neon.tech`).\n",
|
|
"type": "string"
|
|
},
|
|
"branch_logical_size_limit": {
|
|
"description": "The logical size limit for a branch. The value is in MiB.\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"branch_logical_size_limit_bytes": {
|
|
"description": "The logical size limit for a branch. The value is in B.\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"store_passwords": {
|
|
"description": "Whether or not passwords are stored for roles in the Neon project. Storing passwords facilitates access to Neon features that require authorization.\n",
|
|
"type": "boolean"
|
|
},
|
|
"maintenance_starts_at": {
|
|
"description": "A timestamp indicating when project maintenance begins. If set, the project is placed into maintenance mode at this time.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"creation_source": {
|
|
"description": "The project creation source\n",
|
|
"type": "string"
|
|
},
|
|
"history_retention_seconds": {
|
|
"description": "The number of seconds to retain point-in-time restore (PITR) backup history for this project.\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"created_at": {
|
|
"description": "A timestamp indicating when the project was created\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updated_at": {
|
|
"description": "A timestamp indicating when the project was last updated\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"synthetic_storage_size": {
|
|
"description": "The current space occupied by the project in storage, in bytes. Synthetic storage size combines the logical data size and Write-Ahead Log (WAL) size for all branches in a project.\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"consumption_period_start": {
|
|
"description": "A date-time indicating when Neon Cloud started measuring consumption for current consumption period.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"consumption_period_end": {
|
|
"description": "A date-time indicating when Neon Cloud plans to stop measuring consumption for current consumption period.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"quota_reset_at": {
|
|
"deprecated": true,
|
|
"description": "DEPRECATED. Use `consumption_period_end` from the getProject endpoint instead.\nA timestamp indicating when the project quota resets.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"owner_id": {
|
|
"type": "string"
|
|
},
|
|
"owner": {
|
|
"$ref": "#/components/schemas/ProjectOwnerData"
|
|
},
|
|
"compute_last_active_at": {
|
|
"description": "The most recent time when any endpoint of this project was active.\n\nOmitted when observed no actitivy for endpoints of this project.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
},
|
|
"example": {
|
|
"id": "spring-example-302709",
|
|
"platform_id": "aws",
|
|
"region_id": "aws-us-east-2",
|
|
"name": "spring-example-302709",
|
|
"provisioner": "k8s-pod",
|
|
"pg_version": 15,
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"store_passwords": true,
|
|
"creation_source": "console",
|
|
"history_retention_seconds": 604800,
|
|
"created_at": "2022-12-13T01:30:55Z",
|
|
"updated_at": "2022-12-13T01:30:55Z",
|
|
"owner": {
|
|
"email": "some@email.com",
|
|
"branches_limit": 10,
|
|
"subscription_type": "pro"
|
|
}
|
|
}
|
|
},
|
|
"ProjectCreateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"project"
|
|
],
|
|
"properties": {
|
|
"project": {
|
|
"type": "object",
|
|
"properties": {
|
|
"settings": {
|
|
"$ref": "#/components/schemas/ProjectSettingsData"
|
|
},
|
|
"name": {
|
|
"description": "The project name",
|
|
"type": "string"
|
|
},
|
|
"branch": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "The branch name. If not specified, the default branch name will be used.\n",
|
|
"type": "string"
|
|
},
|
|
"role_name": {
|
|
"description": "The role name. If not specified, the default role name will be used.\n",
|
|
"type": "string"
|
|
},
|
|
"database_name": {
|
|
"description": "The database name. If not specified, the default database name will be used.\n",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"autoscaling_limit_min_cu": {
|
|
"deprecated": true,
|
|
"description": "DEPRECATED, use default_endpoint_settings.autoscaling_limit_min_cu instead.\n\nThe minimum number of Compute Units. The minimum value is `0.25`.\nSee [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"autoscaling_limit_max_cu": {
|
|
"deprecated": true,
|
|
"description": "DEPRECATED, use default_endpoint_settings.autoscaling_limit_max_cu instead.\n\nThe maximum number of Compute Units. See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"provisioner": {
|
|
"$ref": "#/components/schemas/Provisioner"
|
|
},
|
|
"region_id": {
|
|
"description": "The region identifier. Refer to our [Regions](https://neon.tech/docs/introduction/regions) documentation for supported regions. Values are specified in this format: `aws-us-east-1`\n",
|
|
"type": "string"
|
|
},
|
|
"default_endpoint_settings": {
|
|
"$ref": "#/components/schemas/DefaultEndpointSettings"
|
|
},
|
|
"pg_version": {
|
|
"$ref": "#/components/schemas/PgVersion"
|
|
},
|
|
"store_passwords": {
|
|
"description": "Whether or not passwords are stored for roles in the Neon project. Storing passwords facilitates access to Neon features that require authorization.\n",
|
|
"type": "boolean"
|
|
},
|
|
"history_retention_seconds": {
|
|
"description": "The number of seconds to retain the point-in-time restore (PITR) backup history for this project.\nThe default is 604800 seconds (7 days).\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0,
|
|
"maximum": 2592000
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"ProjectUpdateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"project"
|
|
],
|
|
"properties": {
|
|
"project": {
|
|
"type": "object",
|
|
"properties": {
|
|
"settings": {
|
|
"$ref": "#/components/schemas/ProjectSettingsData"
|
|
},
|
|
"name": {
|
|
"description": "The project name",
|
|
"type": "string"
|
|
},
|
|
"default_endpoint_settings": {
|
|
"$ref": "#/components/schemas/DefaultEndpointSettings"
|
|
},
|
|
"history_retention_seconds": {
|
|
"description": "The number of seconds to retain the point-in-time restore (PITR) backup history for this project.\nThe default is 604800 seconds (7 days).\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0,
|
|
"maximum": 2592000
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"ProjectSettingsData": {
|
|
"type": "object",
|
|
"properties": {
|
|
"quota": {
|
|
"$ref": "#/components/schemas/ProjectQuota"
|
|
},
|
|
"allowed_ips": {
|
|
"$ref": "#/components/schemas/AllowedIps"
|
|
},
|
|
"enable_logical_replication": {
|
|
"description": "Sets wal_level=logical for all compute endpoints in this project.\nAll active endpoints will be suspended.\nOnce enabled, logical replication cannot be disabled.\n",
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"ProjectResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"project"
|
|
],
|
|
"properties": {
|
|
"project": {
|
|
"$ref": "#/components/schemas/Project"
|
|
}
|
|
}
|
|
},
|
|
"ProjectsResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"projects"
|
|
],
|
|
"properties": {
|
|
"projects": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ProjectListItem"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"ProjectPermission": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"granted_to_email",
|
|
"granted_at"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"granted_to_email": {
|
|
"type": "string"
|
|
},
|
|
"granted_at": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"revoked_at": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
},
|
|
"ProjectPermissions": {
|
|
"type": "object",
|
|
"required": [
|
|
"project_permissions"
|
|
],
|
|
"properties": {
|
|
"project_permissions": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ProjectPermission"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"GrantPermissionToProjectRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"email"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"ProjectsConsumptionResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"projects",
|
|
"periods_in_response"
|
|
],
|
|
"properties": {
|
|
"projects": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ProjectConsumption"
|
|
}
|
|
},
|
|
"periods_in_response": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
}
|
|
},
|
|
"ProjectConsumption": {
|
|
"type": "object",
|
|
"required": [
|
|
"period_id",
|
|
"previous_period_id",
|
|
"project_id",
|
|
"active_time_seconds",
|
|
"compute_time_seconds",
|
|
"written_data_bytes",
|
|
"data_transfer_bytes",
|
|
"data_storage_bytes_hour",
|
|
"synthetic_storage_size",
|
|
"updated_at",
|
|
"period_start",
|
|
"period_end"
|
|
],
|
|
"properties": {
|
|
"project_id": {
|
|
"description": "The project ID",
|
|
"type": "string"
|
|
},
|
|
"period_id": {
|
|
"description": "The Id of the consumption period, used to reference the `previous_period_id` field.\n",
|
|
"type": "string",
|
|
"format": "uuid"
|
|
},
|
|
"data_storage_bytes_hour": {
|
|
"description": "Bytes-Hour. The amount of storage the project consumed during the billing period. Expect some lag in the reported value.\nThe value is reset at the beginning of each billing period.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"data_storage_bytes_hour_updated_at": {
|
|
"description": "The timestamp of the last update of the `data_storage_bytes_hour` field.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"synthetic_storage_size": {
|
|
"description": "Bytes. The current space occupied by project in storage. Expect some lag in the reported value.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"synthetic_storage_size_updated_at": {
|
|
"description": "The timestamp of the last update of the `synthetic_storage_size` field.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"data_transfer_bytes": {
|
|
"description": "Bytes. The egress traffic from the Neon cloud to the client for the project over the billing period.\nIncludes egress traffic for deleted endpoints. Expect some lag in the reported value. The value is reset at the beginning of each billing period.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"data_transfer_bytes_updated_at": {
|
|
"description": "Timestamp of the last update of `data_transfer_bytes` field\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"written_data_bytes": {
|
|
"description": "Bytes. The Amount of WAL that travelled through storage for given project for all branches.\nExpect some lag in the reported value. The value is reset at the beginning of each billing period.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"written_data_bytes_updated_at": {
|
|
"description": "The timestamp of the last update of `written_data_bytes` field.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"compute_time_seconds": {
|
|
"description": "Seconds. The number of CPU seconds used by the project's compute endpoints, including compute endpoints that have been deleted.\nExpect some lag in the reported value. The value is reset at the beginning of each billing period.\nExamples:\n1. An endpoint that uses 1 CPU for 1 second is equal to `compute_time=1`.\n2. An endpoint that uses 2 CPUs simultaneously for 1 second is equal to `compute_time=2`.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"compute_time_seconds_updated_at": {
|
|
"description": "The timestamp of the last update of `compute_time_seconds` field.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"active_time_seconds": {
|
|
"description": "Seconds. The amount of time that compute endpoints in this project have been active.\nExpect some lag in the reported value.\n\nThe value is reset at the beginning of each billing period.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"active_time_seconds_updated_at": {
|
|
"description": "The timestamp of the last update of the `active_time_seconds` field.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updated_at": {
|
|
"description": "A timestamp indicating when the period was last updated.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"period_start": {
|
|
"description": "The start of the consumption period.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"period_end": {
|
|
"description": "The end of the consumption period.\n",
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"nullable": true
|
|
},
|
|
"previous_period_id": {
|
|
"description": "The `period_id` of the previous consumption period.\n",
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"nullable": true
|
|
}
|
|
}
|
|
},
|
|
"ProjectLimits": {
|
|
"type": "object",
|
|
"additionalProperties": true,
|
|
"required": [
|
|
"limits"
|
|
],
|
|
"properties": {
|
|
"limits": {
|
|
"type": "object",
|
|
"required": [
|
|
"active_time",
|
|
"max_projects",
|
|
"max_branches",
|
|
"max_autoscaling_cu",
|
|
"cpu_seconds",
|
|
"max_active_endpoints",
|
|
"max_read_only_endpoints",
|
|
"max_allowed_ips"
|
|
],
|
|
"properties": {
|
|
"active_time": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"max_projects": {
|
|
"type": "integer"
|
|
},
|
|
"max_branches": {
|
|
"type": "integer"
|
|
},
|
|
"max_autoscaling_cu": {
|
|
"type": "number",
|
|
"format": "float64"
|
|
},
|
|
"cpu_seconds": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"max_active_endpoints": {
|
|
"type": "integer"
|
|
},
|
|
"max_read_only_endpoints": {
|
|
"type": "integer"
|
|
},
|
|
"max_allowed_ips": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"Branch": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"project_id",
|
|
"name",
|
|
"current_state",
|
|
"creation_source",
|
|
"created_at",
|
|
"updated_at",
|
|
"primary",
|
|
"cpu_used_sec",
|
|
"active_time_seconds",
|
|
"compute_time_seconds",
|
|
"written_data_bytes",
|
|
"data_transfer_bytes"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"description": "The branch ID. This value is generated when a branch is created. A `branch_id` value has a `br` prefix. For example: `br-small-term-683261`.\n",
|
|
"type": "string"
|
|
},
|
|
"project_id": {
|
|
"description": "The ID of the project to which the branch belongs\n",
|
|
"type": "string"
|
|
},
|
|
"parent_id": {
|
|
"description": "The `branch_id` of the parent branch\n",
|
|
"type": "string"
|
|
},
|
|
"parent_lsn": {
|
|
"description": "The Log Sequence Number (LSN) on the parent branch from which this branch was created\n",
|
|
"type": "string"
|
|
},
|
|
"parent_timestamp": {
|
|
"description": "The point in time on the parent branch from which this branch was created\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"name": {
|
|
"description": "The branch name\n",
|
|
"type": "string"
|
|
},
|
|
"current_state": {
|
|
"$ref": "#/components/schemas/BranchState"
|
|
},
|
|
"pending_state": {
|
|
"$ref": "#/components/schemas/BranchState"
|
|
},
|
|
"logical_size": {
|
|
"description": "The logical size of the branch, in bytes\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"creation_source": {
|
|
"description": "The branch creation source\n",
|
|
"type": "string"
|
|
},
|
|
"primary": {
|
|
"description": "Whether the branch is the project's primary branch\n",
|
|
"type": "boolean"
|
|
},
|
|
"cpu_used_sec": {
|
|
"deprecated": true,
|
|
"description": "CPU seconds used by all the endpoints of the branch, including deleted ones.\nThis value is reset at the beginning of each billing period.\nExamples:\n1. A branch that uses 1 CPU for 1 second is equal to `cpu_used_sec=1`.\n2. A branch that uses 2 CPUs simultaneously for 1 second is equal to `cpu_used_sec=2`.\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"compute_time_seconds": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"active_time_seconds": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"written_data_bytes": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"data_transfer_bytes": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"created_at": {
|
|
"description": "A timestamp indicating when the branch was created\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updated_at": {
|
|
"description": "A timestamp indicating when the branch was last updated\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"last_reset_at": {
|
|
"description": "A timestamp indicating when the branch was last reset\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
},
|
|
"example": {
|
|
"id": "br-wispy-meadow-118737",
|
|
"project_id": "spring-example-302709",
|
|
"parent_id": "br-aged-salad-637688",
|
|
"parent_lsn": "0/1DE2850",
|
|
"name": "dev2",
|
|
"current_state": "ready",
|
|
"creation_source": "console",
|
|
"created_at": "2022-11-30T19:09:48Z",
|
|
"updated_at": "2022-12-01T19:53:05Z",
|
|
"primary": true
|
|
}
|
|
},
|
|
"BranchState": {
|
|
"description": "The branch state",
|
|
"type": "string",
|
|
"enum": [
|
|
"init",
|
|
"ready"
|
|
]
|
|
},
|
|
"BranchCreateRequestEndpointOptions": {
|
|
"type": "object",
|
|
"required": [
|
|
"type"
|
|
],
|
|
"properties": {
|
|
"type": {
|
|
"$ref": "#/components/schemas/EndpointType"
|
|
},
|
|
"autoscaling_limit_min_cu": {
|
|
"description": "The minimum number of Compute Units. The minimum value is `0.25`.\n See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\n for more information.\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"autoscaling_limit_max_cu": {
|
|
"description": "The maximum number of Compute Units.\n See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\n for more information.\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"provisioner": {
|
|
"$ref": "#/components/schemas/Provisioner"
|
|
},
|
|
"suspend_timeout_seconds": {
|
|
"$ref": "#/components/schemas/SuspendTimeoutSeconds"
|
|
}
|
|
}
|
|
},
|
|
"BranchCreateRequest": {
|
|
"type": "object",
|
|
"properties": {
|
|
"endpoints": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/BranchCreateRequestEndpointOptions"
|
|
}
|
|
},
|
|
"branch": {
|
|
"type": "object",
|
|
"properties": {
|
|
"parent_id": {
|
|
"description": "The `branch_id` of the parent branch. If omitted or empty, the branch will be created from the project's primary branch.\n",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "The branch name\n",
|
|
"type": "string"
|
|
},
|
|
"parent_lsn": {
|
|
"description": "A Log Sequence Number (LSN) on the parent branch. The branch will be created with data from this LSN.\n",
|
|
"type": "string"
|
|
},
|
|
"parent_timestamp": {
|
|
"description": "A timestamp identifying a point in time on the parent branch. The branch will be created with data starting from this point in time.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"BranchUpdateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"branch"
|
|
],
|
|
"properties": {
|
|
"branch": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"BranchResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"branch"
|
|
],
|
|
"properties": {
|
|
"branch": {
|
|
"$ref": "#/components/schemas/Branch"
|
|
}
|
|
}
|
|
},
|
|
"BranchesResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"branches"
|
|
],
|
|
"properties": {
|
|
"branches": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Branch"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"ConnectionParameters": {
|
|
"type": "object",
|
|
"required": [
|
|
"database",
|
|
"password",
|
|
"role",
|
|
"host",
|
|
"pooler_host"
|
|
],
|
|
"properties": {
|
|
"database": {
|
|
"description": "Database name.\n",
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"description": "Password for the role.\n",
|
|
"type": "string"
|
|
},
|
|
"role": {
|
|
"description": "Role name.\n",
|
|
"type": "string"
|
|
},
|
|
"host": {
|
|
"description": "Host name.\n",
|
|
"type": "string"
|
|
},
|
|
"pooler_host": {
|
|
"description": "Pooler host name.\n",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"ConnectionDetails": {
|
|
"type": "object",
|
|
"required": [
|
|
"connection_uri",
|
|
"connection_parameters"
|
|
],
|
|
"properties": {
|
|
"connection_uri": {
|
|
"description": "Connection URI is same as specified in https://www.postgresql.org/docs/current/libpq-connect.html#id-1.7.3.8.3.6\nIt is a ready to use string for psql or for DATABASE_URL environment variable.\n",
|
|
"type": "string"
|
|
},
|
|
"connection_parameters": {
|
|
"$ref": "#/components/schemas/ConnectionParameters"
|
|
}
|
|
}
|
|
},
|
|
"Endpoint": {
|
|
"type": "object",
|
|
"required": [
|
|
"host",
|
|
"id",
|
|
"project_id",
|
|
"branch_id",
|
|
"region_id",
|
|
"autoscaling_limit_max_cu",
|
|
"autoscaling_limit_min_cu",
|
|
"type",
|
|
"current_state",
|
|
"pooler_enabled",
|
|
"pooler_mode",
|
|
"disabled",
|
|
"passwordless_access",
|
|
"creation_source",
|
|
"created_at",
|
|
"updated_at",
|
|
"settings",
|
|
"proxy_host",
|
|
"suspend_timeout_seconds",
|
|
"provisioner"
|
|
],
|
|
"properties": {
|
|
"host": {
|
|
"description": "The hostname of the compute endpoint. This is the hostname specified when connecting to a Neon database.\n",
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"description": "The compute endpoint ID. Compute endpoint IDs have an `ep-` prefix. For example: `ep-little-smoke-851426`\n",
|
|
"type": "string"
|
|
},
|
|
"project_id": {
|
|
"description": "The ID of the project to which the compute endpoint belongs\n",
|
|
"type": "string"
|
|
},
|
|
"branch_id": {
|
|
"description": "The ID of the branch that the compute endpoint is associated with\n",
|
|
"type": "string"
|
|
},
|
|
"autoscaling_limit_min_cu": {
|
|
"description": "The minimum number of Compute Units\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"autoscaling_limit_max_cu": {
|
|
"description": "The maximum number of Compute Units\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"region_id": {
|
|
"type": "string",
|
|
"description": "The region identifier\n"
|
|
},
|
|
"type": {
|
|
"$ref": "#/components/schemas/EndpointType"
|
|
},
|
|
"current_state": {
|
|
"$ref": "#/components/schemas/EndpointState"
|
|
},
|
|
"pending_state": {
|
|
"$ref": "#/components/schemas/EndpointState"
|
|
},
|
|
"settings": {
|
|
"$ref": "#/components/schemas/EndpointSettingsData"
|
|
},
|
|
"pooler_enabled": {
|
|
"description": "Whether connection pooling is enabled for the compute endpoint\n",
|
|
"type": "boolean"
|
|
},
|
|
"pooler_mode": {
|
|
"$ref": "#/components/schemas/EndpointPoolerMode"
|
|
},
|
|
"disabled": {
|
|
"description": "Whether to restrict connections to the compute endpoint.\nEnabling this option schedules a suspend compute operation.\nA disabled compute endpoint cannot be enabled by a connection or\nconsole action. However, the compute endpoint is periodically\nenabled by check_availability operations.\n",
|
|
"type": "boolean"
|
|
},
|
|
"passwordless_access": {
|
|
"description": "Whether to permit passwordless access to the compute endpoint\n",
|
|
"type": "boolean"
|
|
},
|
|
"last_active": {
|
|
"description": "A timestamp indicating when the compute endpoint was last active\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"creation_source": {
|
|
"description": "The compute endpoint creation source\n",
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"description": "A timestamp indicating when the compute endpoint was created\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updated_at": {
|
|
"description": "A timestamp indicating when the compute endpoint was last updated\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"proxy_host": {
|
|
"description": "DEPRECATED. Use the \"host\" property instead.\n",
|
|
"type": "string"
|
|
},
|
|
"suspend_timeout_seconds": {
|
|
"$ref": "#/components/schemas/SuspendTimeoutSeconds"
|
|
},
|
|
"provisioner": {
|
|
"$ref": "#/components/schemas/Provisioner"
|
|
}
|
|
},
|
|
"example": {
|
|
"host": "ep-silent-smoke-806639.us-east-2.aws.neon.tech",
|
|
"id": "ep-silent-smoke-806639",
|
|
"project_id": "spring-example-302709",
|
|
"branch_id": "br-wispy-meadow-118737",
|
|
"autoscaling_limit_min_cu": 1,
|
|
"autoscaling_limit_max_cu": 1,
|
|
"region_id": "aws-us-east-2",
|
|
"type": "read_write",
|
|
"current_state": "init",
|
|
"pending_state": "active",
|
|
"settings": {
|
|
"pg_settings": {}
|
|
},
|
|
"pooler_enabled": false,
|
|
"pooler_mode": "transaction",
|
|
"disabled": false,
|
|
"passwordless_access": true,
|
|
"creation_source": "console",
|
|
"created_at": "2022-12-03T15:37:07Z",
|
|
"updated_at": "2022-12-03T15:37:07Z",
|
|
"proxy_host": "us-east-2.aws.neon.tech",
|
|
"suspend_timeout_seconds": 0
|
|
}
|
|
},
|
|
"EndpointState": {
|
|
"description": "The state of the compute endpoint\n",
|
|
"type": "string",
|
|
"enum": [
|
|
"init",
|
|
"active",
|
|
"idle"
|
|
]
|
|
},
|
|
"EndpointType": {
|
|
"description": "The compute endpoint type. Either `read_write` or `read_only`.\nThe `read_only` compute endpoint type is not yet supported.\n",
|
|
"type": "string",
|
|
"enum": [
|
|
"read_only",
|
|
"read_write"
|
|
]
|
|
},
|
|
"EndpointPoolerMode": {
|
|
"description": "The connection pooler mode. Neon supports PgBouncer in `transaction` mode only.\n",
|
|
"type": "string",
|
|
"enum": [
|
|
"transaction"
|
|
]
|
|
},
|
|
"SuspendTimeoutSeconds": {
|
|
"description": "Duration of inactivity in seconds after which the compute endpoint is\nautomatically suspended. The value `0` means use the global default.\nThe value `-1` means never suspend. The default value is `300` seconds (5 minutes).\nThe maximum value is `604800` seconds (1 week). For more information, see\n[Auto-suspend configuration](https://neon.tech/docs/manage/endpoints#auto-suspend-configuration).\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": -1,
|
|
"maximum": 604800
|
|
},
|
|
"AllowedIps": {
|
|
"description": "A list of IP addresses that are allowed to connect to the endpoint.\nIf the list is empty or not set, all IP addresses are allowed.\nIf primary_branch_only is true, the list will be applied only to the primary branch.\n",
|
|
"type": "object",
|
|
"required": [
|
|
"primary_branch_only"
|
|
],
|
|
"properties": {
|
|
"ips": {
|
|
"description": "A list of IP addresses that are allowed to connect to the endpoint.",
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"primary_branch_only": {
|
|
"description": "If true, the list will be applied only to the primary branch.",
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"EndpointCreateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"endpoint"
|
|
],
|
|
"properties": {
|
|
"endpoint": {
|
|
"type": "object",
|
|
"required": [
|
|
"branch_id",
|
|
"type"
|
|
],
|
|
"properties": {
|
|
"branch_id": {
|
|
"description": "The ID of the branch the compute endpoint will be associated with\n",
|
|
"type": "string"
|
|
},
|
|
"region_id": {
|
|
"description": "The region where the compute endpoint will be created. Only the project's `region_id` is permitted.\n",
|
|
"type": "string"
|
|
},
|
|
"type": {
|
|
"$ref": "#/components/schemas/EndpointType"
|
|
},
|
|
"settings": {
|
|
"$ref": "#/components/schemas/EndpointSettingsData"
|
|
},
|
|
"autoscaling_limit_min_cu": {
|
|
"description": "The minimum number of Compute Units. The minimum value is `0.25`.\nSee [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"autoscaling_limit_max_cu": {
|
|
"description": "The maximum number of Compute Units.\nSee [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"provisioner": {
|
|
"$ref": "#/components/schemas/Provisioner"
|
|
},
|
|
"pooler_enabled": {
|
|
"deprecated": true,
|
|
"description": "Whether to enable connection pooling for the compute endpoint\n",
|
|
"type": "boolean"
|
|
},
|
|
"pooler_mode": {
|
|
"$ref": "#/components/schemas/EndpointPoolerMode"
|
|
},
|
|
"disabled": {
|
|
"type": "boolean",
|
|
"description": "Whether to restrict connections to the compute endpoint.\nEnabling this option schedules a suspend compute operation.\nA disabled compute endpoint cannot be enabled by a connection or\nconsole action. However, the compute endpoint is periodically\nenabled by check_availability operations.\n"
|
|
},
|
|
"passwordless_access": {
|
|
"type": "boolean",
|
|
"description": "NOT YET IMPLEMENTED. Whether to permit passwordless access to the compute endpoint.\n"
|
|
},
|
|
"suspend_timeout_seconds": {
|
|
"$ref": "#/components/schemas/SuspendTimeoutSeconds"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"EndpointUpdateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"endpoint"
|
|
],
|
|
"properties": {
|
|
"endpoint": {
|
|
"type": "object",
|
|
"properties": {
|
|
"branch_id": {
|
|
"description": "The destination branch ID. The destination branch must not have an exsiting read-write endpoint.\n",
|
|
"type": "string"
|
|
},
|
|
"autoscaling_limit_min_cu": {
|
|
"description": "The minimum number of Compute Units. The minimum value is `0.25`.\nSee [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"autoscaling_limit_max_cu": {
|
|
"description": "The maximum number of Compute Units.\nSee [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"provisioner": {
|
|
"$ref": "#/components/schemas/Provisioner"
|
|
},
|
|
"settings": {
|
|
"$ref": "#/components/schemas/EndpointSettingsData"
|
|
},
|
|
"pooler_enabled": {
|
|
"deprecated": true,
|
|
"description": "Whether to enable connection pooling for the compute endpoint\n",
|
|
"type": "boolean"
|
|
},
|
|
"pooler_mode": {
|
|
"$ref": "#/components/schemas/EndpointPoolerMode"
|
|
},
|
|
"disabled": {
|
|
"description": "Whether to restrict connections to the compute endpoint.\nEnabling this option schedules a suspend compute operation.\nA disabled compute endpoint cannot be enabled by a connection or\nconsole action. However, the compute endpoint is periodically\nenabled by check_availability operations.\n",
|
|
"type": "boolean"
|
|
},
|
|
"passwordless_access": {
|
|
"description": "NOT YET IMPLEMENTED. Whether to permit passwordless access to the compute endpoint.\n",
|
|
"type": "boolean"
|
|
},
|
|
"suspend_timeout_seconds": {
|
|
"$ref": "#/components/schemas/SuspendTimeoutSeconds"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"EndpointResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"endpoint"
|
|
],
|
|
"properties": {
|
|
"endpoint": {
|
|
"$ref": "#/components/schemas/Endpoint"
|
|
}
|
|
}
|
|
},
|
|
"ConnectionURIsResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"connection_uris"
|
|
],
|
|
"properties": {
|
|
"connection_uris": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ConnectionDetails"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"ConnectionURIsOptionalResponse": {
|
|
"type": "object",
|
|
"properties": {
|
|
"connection_uris": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ConnectionDetails"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"EndpointsResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"endpoints"
|
|
],
|
|
"properties": {
|
|
"endpoints": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Endpoint"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"EndpointPasswordlessSessionAuthRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"session_id"
|
|
],
|
|
"properties": {
|
|
"session_id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Duration": {
|
|
"description": "A Duration represents the elapsed time between two instants\nas an int64 nanosecond count. The representation limits the\nlargest representable duration to approximately 290 years.",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"StatementResult": {
|
|
"type": "object",
|
|
"required": [
|
|
"query"
|
|
],
|
|
"properties": {
|
|
"data": {
|
|
"$ref": "#/components/schemas/StatementData"
|
|
},
|
|
"error": {
|
|
"type": "string"
|
|
},
|
|
"explain_data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/ExplainData"
|
|
}
|
|
},
|
|
"query": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"StatementData": {
|
|
"type": "object",
|
|
"required": [
|
|
"truncated"
|
|
],
|
|
"properties": {
|
|
"fields": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"rows": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"truncated": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"ExplainData": {
|
|
"type": "object",
|
|
"required": [
|
|
"QUERY PLAN"
|
|
],
|
|
"properties": {
|
|
"QUERY PLAN": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"Role": {
|
|
"type": "object",
|
|
"required": [
|
|
"branch_id",
|
|
"name",
|
|
"created_at",
|
|
"updated_at"
|
|
],
|
|
"properties": {
|
|
"branch_id": {
|
|
"description": "The ID of the branch to which the role belongs\n",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "The role name\n",
|
|
"type": "string"
|
|
},
|
|
"password": {
|
|
"description": "The role password\n",
|
|
"type": "string"
|
|
},
|
|
"protected": {
|
|
"description": "Whether or not the role is system-protected\n",
|
|
"type": "boolean"
|
|
},
|
|
"created_at": {
|
|
"description": "A timestamp indicating when the role was created\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updated_at": {
|
|
"description": "A timestamp indicating when the role was last updated\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
},
|
|
"example": {
|
|
"branch_id": "br-wispy-meadow-118737",
|
|
"name": "casey",
|
|
"protected": false,
|
|
"created_at": "2022-11-23T17:42:25Z",
|
|
"updated_at": "2022-11-23T17:42:25Z"
|
|
}
|
|
},
|
|
"RoleCreateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"role"
|
|
],
|
|
"properties": {
|
|
"role": {
|
|
"type": "object",
|
|
"required": [
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"description": "The role name. Cannot exceed 63 bytes in length.\n",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"RoleResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"role"
|
|
],
|
|
"properties": {
|
|
"role": {
|
|
"$ref": "#/components/schemas/Role"
|
|
}
|
|
}
|
|
},
|
|
"RolesResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"roles"
|
|
],
|
|
"properties": {
|
|
"roles": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Role"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"RolePasswordResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"password"
|
|
],
|
|
"properties": {
|
|
"password": {
|
|
"description": "The role password\n",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"PaymentSourceBankCard": {
|
|
"type": "object",
|
|
"required": [
|
|
"last4"
|
|
],
|
|
"properties": {
|
|
"last4": {
|
|
"type": "string",
|
|
"description": "Last 4 digits of the card.\n"
|
|
},
|
|
"brand": {
|
|
"type": "string",
|
|
"description": "Brand of credit card.\n",
|
|
"enum": [
|
|
"amex",
|
|
"diners",
|
|
"discover",
|
|
"jcb",
|
|
"mastercard",
|
|
"unionpay",
|
|
"unknown",
|
|
"visa"
|
|
]
|
|
},
|
|
"exp_month": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "Credit card expiration month\n"
|
|
},
|
|
"exp_year": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"description": "Credit card expiration year\n"
|
|
}
|
|
}
|
|
},
|
|
"PaymentSource": {
|
|
"type": "object",
|
|
"required": [
|
|
"type"
|
|
],
|
|
"properties": {
|
|
"type": {
|
|
"type": "string",
|
|
"description": "Type of payment source. E.g. \"card\".\n"
|
|
},
|
|
"card": {
|
|
"$ref": "#/components/schemas/PaymentSourceBankCard"
|
|
}
|
|
}
|
|
},
|
|
"BillingAccount": {
|
|
"type": "object",
|
|
"required": [
|
|
"payment_source",
|
|
"subscription_type",
|
|
"quota_reset_at_last",
|
|
"email",
|
|
"address_city",
|
|
"address_country",
|
|
"address_line1",
|
|
"address_line2",
|
|
"address_postal_code",
|
|
"address_state"
|
|
],
|
|
"properties": {
|
|
"payment_source": {
|
|
"$ref": "#/components/schemas/PaymentSource"
|
|
},
|
|
"subscription_type": {
|
|
"$ref": "#/components/schemas/BillingSubscriptionType"
|
|
},
|
|
"quota_reset_at_last": {
|
|
"description": "The last time the quota was reset. Defaults to the date-time the account is created.\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"email": {
|
|
"description": "Billing email, to receive emails related to invoices and subscriptions.\n",
|
|
"type": "string"
|
|
},
|
|
"address_city": {
|
|
"description": "Billing address city.\n",
|
|
"type": "string"
|
|
},
|
|
"address_country": {
|
|
"description": "Billing address country.\n",
|
|
"type": "string"
|
|
},
|
|
"address_line1": {
|
|
"description": "Billing address line 1.\n",
|
|
"type": "string"
|
|
},
|
|
"address_line2": {
|
|
"description": "Billing address line 2.\n",
|
|
"type": "string"
|
|
},
|
|
"address_postal_code": {
|
|
"description": "Billing address postal code.\n",
|
|
"type": "string"
|
|
},
|
|
"address_state": {
|
|
"description": "Billing address state or region.\n",
|
|
"type": "string"
|
|
},
|
|
"orb_portal_url": {
|
|
"description": "Orb user portal url\n",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"BillingAccountUpdateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"billing_account"
|
|
],
|
|
"properties": {
|
|
"billing_account": {
|
|
"type": "object",
|
|
"properties": {
|
|
"email": {
|
|
"description": "Billing email, to receive emails related to invoices and subscriptions.\n",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"BillingAccountResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"billing_account"
|
|
],
|
|
"properties": {
|
|
"billing_account": {
|
|
"$ref": "#/components/schemas/BillingAccount"
|
|
}
|
|
}
|
|
},
|
|
"BillingSubscriptionType": {
|
|
"type": "string",
|
|
"description": "Type of subscription to Neon Cloud.\nNotice that for users without billing account this will be \"UNKNOWN\"\n",
|
|
"enum": [
|
|
"UNKNOWN",
|
|
"free",
|
|
"pro",
|
|
"direct_sales",
|
|
"aws_marketplace",
|
|
"free_v2",
|
|
"launch",
|
|
"scale"
|
|
]
|
|
},
|
|
"Database": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"branch_id",
|
|
"name",
|
|
"owner_name",
|
|
"created_at",
|
|
"updated_at"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"description": "The database ID\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"branch_id": {
|
|
"description": "The ID of the branch to which the database belongs\n",
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"description": "The database name\n",
|
|
"type": "string"
|
|
},
|
|
"owner_name": {
|
|
"description": "The name of role that owns the database\n",
|
|
"type": "string"
|
|
},
|
|
"created_at": {
|
|
"description": "A timestamp indicating when the database was created\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
},
|
|
"updated_at": {
|
|
"description": "A timestamp indicating when the database was last updated\n",
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
},
|
|
"example": {
|
|
"id": 834686,
|
|
"branch_id": "br-wispy-meadow-118737",
|
|
"name": "neondb",
|
|
"owner_name": "casey",
|
|
"created_at": "2022-11-30T18:25:15Z",
|
|
"updated_at": "2022-11-30T18:25:15Z"
|
|
}
|
|
},
|
|
"DatabaseCreateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"database"
|
|
],
|
|
"properties": {
|
|
"database": {
|
|
"type": "object",
|
|
"required": [
|
|
"name",
|
|
"owner_name"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"description": "The name of the datbase\n",
|
|
"type": "string"
|
|
},
|
|
"owner_name": {
|
|
"description": "The name of the role that owns the database\n",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"DatabaseUpdateRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"database"
|
|
],
|
|
"properties": {
|
|
"database": {
|
|
"type": "object",
|
|
"properties": {
|
|
"name": {
|
|
"description": "The name of the database\n",
|
|
"type": "string"
|
|
},
|
|
"owner_name": {
|
|
"description": "The name of the role that owns the database\n",
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"DatabaseResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"database"
|
|
],
|
|
"properties": {
|
|
"database": {
|
|
"$ref": "#/components/schemas/Database"
|
|
}
|
|
}
|
|
},
|
|
"DatabasesResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"databases"
|
|
],
|
|
"properties": {
|
|
"databases": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/Database"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"CurrentUserAuthAccount": {
|
|
"type": "object",
|
|
"required": [
|
|
"provider",
|
|
"email",
|
|
"name",
|
|
"login",
|
|
"image"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"image": {
|
|
"type": "string"
|
|
},
|
|
"login": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"provider": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"UpdateUserInfoRequest": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"email"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid"
|
|
},
|
|
"image": {
|
|
"type": "string"
|
|
},
|
|
"first_name": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"CurrentUserInfoResponse": {
|
|
"type": "object",
|
|
"required": [
|
|
"active_seconds_limit",
|
|
"billing_account",
|
|
"id",
|
|
"email",
|
|
"login",
|
|
"name",
|
|
"last_name",
|
|
"image",
|
|
"projects_limit",
|
|
"branches_limit",
|
|
"max_autoscaling_limit",
|
|
"auth_accounts",
|
|
"plan"
|
|
],
|
|
"properties": {
|
|
"active_seconds_limit": {
|
|
"description": "Control plane observes active endpoints of a user this amount of wall-clock time.\n",
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"billing_account": {
|
|
"$ref": "#/components/schemas/BillingAccount"
|
|
},
|
|
"auth_accounts": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/components/schemas/CurrentUserAuthAccount"
|
|
}
|
|
},
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"image": {
|
|
"type": "string"
|
|
},
|
|
"login": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"last_name": {
|
|
"type": "string"
|
|
},
|
|
"projects_limit": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"branches_limit": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"max_autoscaling_limit": {
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"compute_seconds_limit": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
},
|
|
"plan": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"EndpointSettingsData": {
|
|
"type": "object",
|
|
"description": "A collection of settings for a compute endpoint",
|
|
"properties": {
|
|
"pg_settings": {
|
|
"$ref": "#/components/schemas/PgSettingsData"
|
|
},
|
|
"pgbouncer_settings": {
|
|
"$ref": "#/components/schemas/PgbouncerSettingsData"
|
|
}
|
|
}
|
|
},
|
|
"ProjectQuota": {
|
|
"type": "object",
|
|
"description": "Per-project consumption quota. If the quota is exceeded, all active computes\nare automatically suspended and it will not be possible to start them with\nan API method call or incoming proxy connections. The only exception is\n`logical_size_bytes`, which is applied on per-branch basis, i.e., only the\ncompute on the branch that exceeds the `logical_size` quota will be suspended.\n\nQuotas are enforced based on per-project consumption metrics with the same names,\nwhich are reset at the end of each billing period (the first day of the month).\nLogical size is also an exception in this case, as it represents the total size\nof data stored in a branch, so it is not reset.\n\nA zero or empty quota value means 'unlimited'.\n",
|
|
"properties": {
|
|
"active_time_seconds": {
|
|
"description": "The total amount of wall-clock time allowed to be spent by the project's compute endpoints.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"compute_time_seconds": {
|
|
"description": "The total amount of CPU seconds allowed to be spent by the project's compute endpoints.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"written_data_bytes": {
|
|
"description": "Total amount of data written to all of a project's branches.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"data_transfer_bytes": {
|
|
"description": "Total amount of data transferred from all of a project's branches using the proxy.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
},
|
|
"logical_size_bytes": {
|
|
"description": "Limit on the logical size of every project's branch.\n",
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"minimum": 0
|
|
}
|
|
}
|
|
},
|
|
"DefaultEndpointSettings": {
|
|
"type": "object",
|
|
"description": "A collection of settings for a Neon endpoint",
|
|
"properties": {
|
|
"pg_settings": {
|
|
"$ref": "#/components/schemas/PgSettingsData"
|
|
},
|
|
"pgbouncer_settings": {
|
|
"$ref": "#/components/schemas/PgbouncerSettingsData"
|
|
},
|
|
"autoscaling_limit_min_cu": {
|
|
"description": "The minimum number of Compute Units. The minimum value is `0.25`.\nSee [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"autoscaling_limit_max_cu": {
|
|
"description": "The maximum number of Compute Units. See [Compute size and Autoscaling configuration](https://neon.tech/docs/manage/endpoints#compute-size-and-autoscaling-configuration)\nfor more information.\n",
|
|
"$ref": "#/components/schemas/ComputeUnit"
|
|
},
|
|
"suspend_timeout_seconds": {
|
|
"$ref": "#/components/schemas/SuspendTimeoutSeconds"
|
|
}
|
|
},
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"PgSettingsData": {
|
|
"description": "A raw representation of PostgreSQL settings",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"PgbouncerSettingsData": {
|
|
"description": "A raw representation of PgBouncer settings",
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"PgVersion": {
|
|
"description": "The major PostgreSQL version number. Currently supported versions are `14`, `15` and `16`.",
|
|
"type": "integer",
|
|
"minimum": 14,
|
|
"maximum": 16,
|
|
"default": 15
|
|
},
|
|
"HealthCheck": {
|
|
"type": "object",
|
|
"required": [
|
|
"status"
|
|
],
|
|
"properties": {
|
|
"status": {
|
|
"description": "Service status",
|
|
"type": "string"
|
|
}
|
|
},
|
|
"example": {
|
|
"status": "ok"
|
|
}
|
|
},
|
|
"ProjectOwnerData": {
|
|
"type": "object",
|
|
"required": [
|
|
"email",
|
|
"branches_limit",
|
|
"subscription_type"
|
|
],
|
|
"properties": {
|
|
"email": {
|
|
"type": "string"
|
|
},
|
|
"branches_limit": {
|
|
"type": "integer"
|
|
},
|
|
"subscription_type": {
|
|
"$ref": "#/components/schemas/BillingSubscriptionType"
|
|
}
|
|
}
|
|
},
|
|
"GeneralError": {
|
|
"type": "object",
|
|
"description": "General Error",
|
|
"required": [
|
|
"message",
|
|
"code"
|
|
],
|
|
"properties": {
|
|
"code": {
|
|
"$ref": "#/components/schemas/ErrorCode"
|
|
},
|
|
"message": {
|
|
"description": "Error message",
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"ErrorCode": {
|
|
"type": "string"
|
|
},
|
|
"BranchOperations": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/BranchResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/OperationsResponse"
|
|
}
|
|
]
|
|
},
|
|
"EndpointOperations": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/EndpointResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/OperationsResponse"
|
|
}
|
|
]
|
|
},
|
|
"DatabaseOperations": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/DatabaseResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/OperationsResponse"
|
|
}
|
|
]
|
|
},
|
|
"RoleOperations": {
|
|
"allOf": [
|
|
{
|
|
"$ref": "#/components/schemas/RoleResponse"
|
|
},
|
|
{
|
|
"$ref": "#/components/schemas/OperationsResponse"
|
|
}
|
|
]
|
|
},
|
|
"SupportTicketSeverity": {
|
|
"type": "string",
|
|
"enum": [
|
|
"low",
|
|
"normal",
|
|
"high",
|
|
"critical"
|
|
]
|
|
}
|
|
}
|
|
}
|
|
} |