diff --git a/.gitattributes b/.gitattributes
index 642db914..5b03d703 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,2 @@
*.js linguist-detectable=false
+*.ts linguist-detectable=false
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 00000000..77b37102
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,4 @@
+# These are supported funding model platforms
+
+github: postgres-ai
+patreon: Database_Lab # Replace with a single Patreon username
diff --git a/.gitignore b/.gitignore
index 44a297f5..8719d1d4 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,6 @@
.DS_Store
.idea/
+.env
engine/bin/
/db-lab-run/
@@ -11,4 +12,7 @@ engine/bin/
/engine/configs/server.yml
/engine/configs/run_ci.yaml
/engine/configs/ci_checker.yml
-/packer/example.com.key
+
+engine/meta
+
+ui/packages/shared/dist/
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 4c8aef61..da8a843d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,5 +1,4 @@
variables:
- SAST_EXCLUDED_ANALYZERS: "semgrep-sast,gosec-sast"
DOCKER_DRIVER: overlay2
workflow:
diff --git a/.gitlab/agents/k8s-cluster-1/config.yaml b/.gitlab/agents/k8s-cluster-1/config.yaml
new file mode 100644
index 00000000..73481f44
--- /dev/null
+++ b/.gitlab/agents/k8s-cluster-1/config.yaml
@@ -0,0 +1,3 @@
+ci_access:
+ projects:
+ - id: postgres-ai/database-lab
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 00000000..a4267581
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,23 @@
+# CLAUDE.md
+
+This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
+
+## Build/Test/Lint Commands
+- Build all components: `cd engine && make build`
+- Lint code: `cd engine && make lint`
+- Run unit tests: `cd engine && make test`
+- Run integration tests: `cd engine && make test-ci-integration`
+- Run a specific test: `cd engine && GO111MODULE=on go test -v ./path/to/package -run TestName`
+- Run UI: `cd ui && pnpm start:ce` (Community Edition) or `pnpm start:platform`
+
+## Code Style Guidelines
+- Go code follows "Effective Go" and "Go Code Review Comments" guidelines
+- Use present tense and imperative mood in commit messages
+- Limit first commit line to 72 characters
+- All Git commits must be signed
+- Format Go code with `cd engine && make fmt`
+- Use error handling with pkg/errors
+- Follow standard Go import ordering
+- Group similar functions together
+- Error messages should be descriptive and actionable
+- UI uses pnpm for package management
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index f32b4abf..4d399f35 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -23,11 +23,11 @@ These are mostly guidelines, not rules. Use your best judgment, and feel free to
- [Git commit messages](#git-commit-messages)
- [Go styleguide](#go-styleguide)
- [Documentation styleguide](#documentation-styleguide)
+ - [API design and testing](#api-design-and-testing)
+ - [UI development](#ui-development)
- [Development setup](#development-setup)
- [Repo overview](#repo-overview)
-
---
@@ -121,6 +121,45 @@ We encourage you to follow the principles described in the following documents:
- [Effective Go](https://go.dev/doc/effective_go)
- [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments)
+### Message style guide
+Consistent messaging is important throughout the codebase. Follow these guidelines for errors, logs, and user-facing messages:
+
+#### Error messages
+- Lowercase for internal errors and logs: `failed to start session` (no ending period)
+- Uppercase for user-facing errors: `Requested object does not exist. Specify your request.` (with ending period)
+- Omit articles ("a", "an", "the") for brevity: use `failed to update clone` not `failed to update the clone`
+- Be specific and actionable whenever possible
+- For variable interpolation, use consistent formatting: `failed to find clone: %s`
+
+#### CLI output
+- Use concise, action-oriented language
+- Present tense with ellipsis for in-progress actions: `Creating clone...`
+ - Ellipsis (`...`) indicates an ongoing process where the user should wait
+ - Always follow up with a completion message when the operation finishes
+- Past tense with period for results: `Clone created successfully.`
+- Include relevant identifiers (IDs, names) in output
+
+#### Progress indication
+- Use ellipsis (`...`) to indicate that an operation is in progress and the user should wait
+- For longer operations, consider providing percentage or step indicators: `Cloning database... (25%)`
+- When an operation with ellipsis completes, always provide a completion message without ellipsis
+- Example sequence:
+ ```
+ Creating clone...
+ Clone "test-clone" created successfully.
+ ```
+
+#### UI messages
+- Be consistent with terminology across UI and documentation
+- For confirmations, use format: `{Resource} {action} successfully.`
+- For errors, provide clear next steps when possible
+- Use sentence case for all messages (capitalize first word only)
+
+#### Commit messages
+- Start with lowercase type prefix: `fix:`, `feat:`, `docs:`, etc.
+- Use imperative mood: `add feature` not `added feature`
+- Provide context in the body if needed
+
### Documentation styleguide
Documentation for Database Lab Engine and additional components is hosted at https://postgres.ai/docs and is maintained in this GitLab repo: https://gitlab.com/postgres-ai/docs.
@@ -132,6 +171,94 @@ We're building documentation following the principles described at https://docum
Learn more: https://documentation.divio.com/.
+### API design and testing
+The DBLab API follows RESTful principles with these key guidelines:
+- Clear resource-based URL structure
+- Consistent usage of HTTP methods (GET, POST, DELETE, etc.)
+- Standardized error responses
+- Authentication via API tokens
+- JSON for request and response bodies
+- Comprehensive documentation with examples
+
+#### API Documentation
+We use readme.io to host the API docs: https://dblab.readme.io/ and https://api.dblab.dev.
+
+When updating the API specification:
+1. Make changes to the OpenAPI spec file in `engine/api/swagger-spec/`
+2. Upload it to readme.io as a new documentation version
+3. Review and publish the new version
+
+#### Testing with Postman and Newman
+Postman collection is generated based on the OpenAPI spec file, using [Portman](https://github.com/apideck-libraries/portman).
+
+##### Setup and Generation
+1. Install Portman: `npm install -g @apideck/portman`
+2. Generate Postman collection file:
+ ```
+ portman --cliOptionsFile engine/api/postman/portman-cli.json
+ ```
+
+##### Test Structure Best Practices
+- Arrange tests in logical flows (create, read, update, delete)
+- Use environment variables to store and pass data between requests
+- For object creation tests, capture the ID in the response to use in subsequent requests
+- Add validation tests for response status, body structure, and expected values
+- Clean up created resources at the end of test flows
+
+##### CI/CD Integration
+The Postman collection is automatically run in CI/CD pipelines using Newman. For local testing:
+```
+newman run engine/api/postman/dblab_api.postman_collection.json -e engine/api/postman/branching.aws.postgres.ai.postman_environment.json
+```
+
+### UI development
+The Database Lab Engine UI contains two main packages:
+- `@postgres.ai/platform` - Platform version of UI
+- `@postgres.ai/ce` - Community Edition version of UI
+- `@postgres.ai/shared` - Common modules shared between packages
+
+#### Working with UI packages
+At the repository root:
+- `pnpm install` - Install all dependencies
+- `npm run build -ws` - Build all packages
+- `npm run start -w @postgres.ai/platform` - Run Platform UI in dev mode
+- `npm run start -w @postgres.ai/ce` - Run Community Edition UI in dev mode
+
+_Note: Don't use commands for `@postgres.ai/shared` - it's a dependent package that can't be run or built directly_
+
+#### Platform UI Development
+1. Set up environment variables:
+ ```bash
+ cd ui/packages/platform
+ cp .env_example_dev .env
+ ```
+2. Edit `.env` to set:
+ - `REACT_APP_API_URL_PREFIX` to point to dev API server
+ - `REACT_APP_TOKEN_DEBUG` to set your JWT token
+3. Start development server: `pnpm run start`
+
+#### CI pipelines for UI code
+To deploy UI changes, tag the commit with `ui/` prefix and push it:
+```shell
+git tag ui/1.0.12
+git push origin ui/1.0.12
+```
+
+#### Handling Vulnerabilities
+When addressing vulnerabilities in UI packages:
+1. Update the affected package to a newer version if available
+2. For sub-package vulnerabilities, try using [npm-force-resolutions](https://www.npmjs.com/package/npm-force-resolutions)
+3. As a last resort, consider forking the package locally
+
+For code-related issues:
+1. Consider rewriting JavaScript code in TypeScript
+2. Follow recommendations from security analysis tools
+3. Only ignore false positives when absolutely necessary
+
+#### TypeScript Migration
+- `@postgres.ai/shared` and `@postgres.ai/ce` are written in TypeScript
+- `@postgres.ai/platform` is partially written in TypeScript with ongoing migration efforts
+
### Repo overview
The [postgres-ai/database-lab](https://gitlab.com/postgres-ai/database-lab) repo contains 2 components:
- [Database Lab Engine](https://gitlab.com/postgres-ai/database-lab/-/tree/master/engine)
@@ -140,7 +267,6 @@ The [postgres-ai/database-lab](https://gitlab.com/postgres-ai/database-lab) repo
- [Database Lab CLI](https://gitlab.com/postgres-ai/database-lab/-/tree/master/engine/cmd/cli)
- [Database Lab UI](https://gitlab.com/postgres-ai/database-lab/-/tree/master/ui)
- [Community Edition](https://gitlab.com/postgres-ai/database-lab/-/tree/master/ui/packages/ce)
- - [Platform](https://gitlab.com/postgres-ai/database-lab/-/tree/master/ui/packages/platform)
- [Shared components](https://gitlab.com/postgres-ai/database-lab/-/tree/master/ui/packages/shared)
Components have a separate version, denoted by either:
@@ -191,10 +317,27 @@ Components have a separate version, denoted by either:
### Building from source
-Use `Makefile` to build Database Lab components from source.
+The Database Lab Engine provides multiple build targets in its `Makefile`:
+
+```bash
+cd engine
+make help # View all available build targets
+make build # Build all components (Server, CLI, CI Checker)
+make build-dle # Build Database Lab Engine binary and Docker image
+make test # Run unit tests
+```
+
+You can also build specific components:
+
+```bash
+# Build the CLI for all supported platforms
+make build-client
+
+# Build the Server in debug mode
+make build-debug
-Run `make help` to see all available targets.
+# Build and run DLE locally
+make run-dle
+```
-
+See our [GitLab Container Registry](https://gitlab.com/postgres-ai/database-lab/container_registry) to find pre-built images for development branches.
diff --git a/LICENSE b/LICENSE
index fd32533a..b0cc8d52 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,19 +1,201 @@
-Copyright © 2018-present, Postgres.ai (https://postgres.ai), Nikolay Samokhvalov nik@postgres.ai
-
-Portions of this software are licensed as follows:
-- UI components:
- - All content that resides in the "./ui/packages/platform" directory of this repository is licensed under the
- license defined in "./ui/packages/platform/LICENSE"
- - All content that resides in the "./ui/packages/ce" directory of this repository is licensed under the "AGPLv3"
- license defined in "./LICENSE"
- - All content that resides in the "./ui/packages/shared" directory of this repository is licensed under the "AGPLv3"
- license defined in "./LICENSE"
-- All third party components incorporated into the Database Lab Engine software are licensed under the original license
-provided by the owner of the applicable component.
-- Content outside of the above mentioned directories above is licensed under the "AGPLv3" license defined
-in "./LICENSE"
-
-In plain language: this repository contains open-source software licensed under an OSI-approved license AGPLv3 (see
-https://opensource.org/) except "./ui/packages/platform" that defines user interfaces and business logic for the
-"Platform" version of Database Lab, which is not open source and can be used only with commercial license obtained
-from Postgres.ai (see https://postgres.ai/pricing).
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright 2023-2025 Postgres AI https://postgres.ai/
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
\ No newline at end of file
diff --git a/LICENSE-AGPL b/LICENSE-AGPL
deleted file mode 100644
index e308d63a..00000000
--- a/LICENSE-AGPL
+++ /dev/null
@@ -1,661 +0,0 @@
- GNU AFFERO GENERAL PUBLIC LICENSE
- Version 3, 19 November 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU Affero General Public License is a free, copyleft license for
-software and other kinds of works, specifically designed to ensure
-cooperation with the community in the case of network server software.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-our General Public Licenses are intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- Developers that use our General Public Licenses protect your rights
-with two steps: (1) assert copyright on the software, and (2) offer
-you this License which gives you legal permission to copy, distribute
-and/or modify the software.
-
- A secondary benefit of defending all users' freedom is that
-improvements made in alternate versions of the program, if they
-receive widespread use, become available for other developers to
-incorporate. Many developers of free software are heartened and
-encouraged by the resulting cooperation. However, in the case of
-software used on network servers, this result may fail to come about.
-The GNU General Public License permits making a modified version and
-letting the public access it on a server without ever releasing its
-source code to the public.
-
- The GNU Affero General Public License is designed specifically to
-ensure that, in such cases, the modified source code becomes available
-to the community. It requires the operator of a network server to
-provide the source code of the modified version running there to the
-users of that server. Therefore, public use of a modified version, on
-a publicly accessible server, gives the public access to the source
-code of the modified version.
-
- An older license, called the Affero General Public License and
-published by Affero, was designed to accomplish similar goals. This is
-a different license, not a version of the Affero GPL, but Affero has
-released a new version of the Affero GPL which permits relicensing under
-this license.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU Affero General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Remote Network Interaction; Use with the GNU General Public License.
-
- Notwithstanding any other provision of this License, if you modify the
-Program, your modified version must prominently offer all users
-interacting with it remotely through a computer network (if your version
-supports such interaction) an opportunity to receive the Corresponding
-Source of your version by providing access to the Corresponding Source
-from a network server at no charge, through some standard or customary
-means of facilitating copying of software. This Corresponding Source
-shall include the Corresponding Source for any work covered by version 3
-of the GNU General Public License that is incorporated pursuant to the
-following paragraph.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the work with which it is combined will remain governed by version
-3 of the GNU General Public License.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU Affero General Public License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU Affero General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU Affero General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU Affero General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- Database Lab – instant database clones to boost development
- Copyright © 2018-present, Postgres.ai (https://postgres.ai), Nikolay Samokhvalov
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published
- by the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Affero General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see .
-
-Also add information on how to contact you by electronic and paper mail.
-
- If your software can interact with users remotely through a computer
-network, you should also make sure that it provides a way for users to
-get its source. For example, if your program is a web application, its
-interface could display a "Source" link that leads users to an archive
-of the code. There are many ways you could offer source, and different
-solutions will be better for different programs; see section 13 for the
-specific requirements.
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU AGPL, see
- .
diff --git a/README.md b/README.md
index fb7f20e0..9eada025 100644
--- a/README.md
+++ b/README.md
@@ -5,18 +5,21 @@
-
Database Lab Engine (DLE)
+
DBLab Engine
- :zap: Blazing-fast cloning of PostgreSQL databases :elephant:
- Thin clones of PostgreSQL to build powerful development, test, QA, and staging environments.
- Available for any PostgreSQL, including AWS RDS* , GCP CloudSQL* , Heroku* , Digital Ocean* , and self-managed instances.
+ ⚡ Blazing-fast PostgreSQL cloning and branching 🐘
+ 🛠️ Build powerful dev/test environments.
+ 🔃 Cover 100% of DB migrations with CI tests.
+ 💡 Quickly verify ChatGPT ideas to get rid of hallucinations.
+ Available for any PostgreSQL, including self-managed and managed services* like AWS RDS, GCP Cloud SQL, Supabase, and Timescale.
+ It can be installed and used anywhere: across all cloud environments and on-premises.
@@ -44,25 +47,29 @@
---
- * For a managed PostgreSQL cloud service such as AWS RDS or Heroku, where physical connection and access to PGDATA are not available, DLE is supposed to be running on a separate VM in the same region, performing periodical automated full refresh of data and serving itself as a database-as-a-service solution providing thin database clones for development and testing purposes.
+ * For managed PostgreSQL cloud services like AWS RDS or Heroku, direct physical connection and PGDATA access aren't possible. In these cases, DBLab should run on a separate VM within the same region. It will routinely auto-refresh its data, effectively acting as a database-as-a-service solution. This setup then offers thin database branching ideal for development and testing.
-## Why DLE?
-- Build dev/QA/staging environments based on full-size production-like databases.
+## Why DBLab?
+- Build dev/QA/staging environments using full-scale, production-like databases.
- Provide temporary full-size database clones for SQL query analysis and optimization (see also: [SQL optimization chatbot Joe](https://gitlab.com/postgres-ai/joe)).
-- Automatically test database changes in CI/CD pipelines to avoid incidents in production.
+- Automatically test database changes in CI/CD pipelines, minimizing risks of production incidents.
+- Rapidly validate ChatGPT or other LLM concepts, check for hallucinations, and iterate towards effective solutions.
-For example, cloning a 1 TiB PostgreSQL database takes ~10 seconds. Dozens of independent clones are up and running on a single machine, supporting lots of development and testing activities, without increasing costs for hardware.
+For example, cloning a 1 TiB PostgreSQL database takes just about 10 seconds. On a single machine, you can have dozens of independent clones running simultaneously, supporting extensive development and testing activities without any added hardware costs.
Try it yourself right now:
-- enter [the Database Lab Platform](https://console.postgres.ai/), join the "Demo" organization, and test cloning of ~1 TiB demo database, or
-- check out another demo setup, DLE CE: https://nik-tf-test.aws.postgres.ai:446/instance, use the token `demo` to enter (this setup has self-signed certificates, so ignore browser's complaints)
+- Visit [Postgres.ai Console](https://console.postgres.ai/), set up your first organization, and provision a DBLab Standard Edition (DBLab SE) to any cloud or on-premises environment.
+ - [Pricing](https://postgres.ai/pricing) (starting at $62/month)
+ - [Documentation: How to install DBLab SE](https://postgres.ai/docs/how-to-guides/administration/install-dle-from-postgres-ai)
+- Demo: https://demo.dblab.dev (use the token `demo-token` to access)
+- Looking for a free version? Install the DBLab Community Edition by [following this tutorial](https://postgres.ai/docs/tutorials/database-lab-tutorial).
## How it works
-Thin cloning is fast because it uses [Copy-on-Write (CoW)](https://en.wikipedia.org/wiki/Copy-on-write#In_computer_storage). DLE supports two technologies to enable CoW and thin cloning: [ZFS](https://en.wikipedia.org/wiki/ZFS) (default) and [LVM](https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)).
+Thin cloning is fast because it is based on [Copy-on-Write (CoW)](https://en.wikipedia.org/wiki/Copy-on-write#In_computer_storage). DBLab employs two technologies for enabling thin cloning: [ZFS](https://en.wikipedia.org/wiki/ZFS) (default) and [LVM](https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)).
-With ZFS, Database Lab Engine periodically creates a new snapshot of the data directory and maintains a set of snapshots, cleaning up old and unused ones. When requesting a new clone, users can choose which snapshot to use.
+Using ZFS, DBLab routinely takes new snapshots of the data directory, managing a collection of them and removing old or unused ones. When requesting a fresh clone, users have the option to select their preferred snapshot.
Read more:
- [How it works](https://postgres.ai/products/how-it-works)
@@ -71,53 +78,61 @@ Read more:
- [Questions and answers](https://postgres.ai/docs/questions-and-answers)
## Where to start
-- [Database Lab tutorial for any PostgreSQL database](https://postgres.ai/docs/tutorials/database-lab-tutorial)
-- [Database Lab tutorial for Amazon RDS](https://postgres.ai/docs/tutorials/database-lab-tutorial-amazon-rds)
-- [Terraform module template (AWS)](https://postgres.ai/docs/how-to-guides/administration/install-database-lab-with-terraform)
+- [DBLab tutorial for any PostgreSQL database](https://postgres.ai/docs/tutorials/database-lab-tutorial)
+- [DBLab tutorial for Amazon RDS](https://postgres.ai/docs/tutorials/database-lab-tutorial-amazon-rds)
+- [How to install DBLab SE using Postgres.ai Console](https://postgres.ai/docs/how-to-guides/administration/install-dle-from-postgres-ai)
+- [How to install DBLab SE using AWS Marketplace](https://postgres.ai/docs/how-to-guides/administration/install-dle-from-aws-marketplace)
## Case studies
-- Qiwi: [How Qiwi Controls the Data to Accelerate Development](https://postgres.ai/resources/case-studies/qiwi)
- GitLab: [How GitLab iterates on SQL performance optimization workflow to reduce downtime risks](https://postgres.ai/resources/case-studies/gitlab)
## Features
-- Blazing-fast cloning of Postgres databases – a few seconds to create a new clone ready to accept connections and queries, regardless of database size.
-- The theoretical maximum number of snapshots and clones is 264 ([ZFS](https://en.wikipedia.org/wiki/ZFS), default).
-- The theoretical maximum size of PostgreSQL data directory: 256 quadrillion zebibytes, or 2128 bytes ([ZFS](https://en.wikipedia.org/wiki/ZFS), default).
-- PostgreSQL major versions supported: 9.6–14.
-- Two technologies are supported to enable thin cloning ([CoW](https://en.wikipedia.org/wiki/Copy-on-write)): [ZFS](https://en.wikipedia.org/wiki/ZFS) and [LVM](https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)).
-- All components are packaged in Docker containers.
-- UI to make manual work more convenient.
-- API and CLI to automate the work with DLE snapshots and clones.
-- By default, PostgreSQL containers include many popular extensions ([docs](https://postgres.ai/docs/database-lab/supported-databases#extensions-included-by-default)).
-- PostgreSQL containers can be customized ([docs](https://postgres.ai/docs/database-lab/supported-databases#how-to-add-more-extensions)).
-- Source database can be located anywhere (self-managed Postgres, AWS RDS, GCP CloudSQL, Azure, Timescale Cloud, and so on) and does NOT require any adjustments. There are NO requirements to install ZFS or Docker to the source (production) databases.
-- Initial data provisioning can be done at either the physical (pg_basebackup, backup / archiving tools such as WAL-G or pgBackRest) or logical (dump/restore directly from the source or from files stored at AWS S3) level.
-- For logical mode, partial data retrieval is supported (specific databases, specific tables).
-- For physical mode, a continuously updated state is supported ("sync container"), making DLE a specialized version of standby Postgres.
-- For logical mode, periodic full refresh is supported, automated, and controlled by DLE. It is possible to use multiple disks containing different versions of the database, so full refresh won't require downtime.
-- Fast Point in Time Recovery (PITR) to the points available in DLE snapshots.
-- Unused clones are automatically deleted.
-- "Deletion protection" flag can be used to block automatic or manual deletion of clones.
-- Snapshot retention policies supported in DLE configuration.
-- Persistent clones: clones survive DLE restarts (including full VM reboots).
-- The "reset" command can be used to switch to a different version of data.
-- DB Migration Checker component collects various artifacts useful for DB testing in CI ([docs](https://postgres.ai/docs/db-migration-checker)).
-- SSH port forwarding for API and Postgres connections.
-- Docker container config parameters can be specified in the DLE config.
-- Resource usage quotas for clones: CPU, RAM (container quotas, supported by Docker)
-- Postgres config parameters can be specified in the DLE config (separately for clones, the "sync" container, and the "promote" container).
-- Monitoring: auth-free `/healthz` API endpoint, extended `/status` (requires auth), [Netdata module](https://gitlab.com/postgres-ai/netdata_for_dle).
+- Speed & scale
+ - Blazing-fast cloning of PostgreSQL databases – clone in seconds, irrespective of database size
+ - Theoretical max of snapshots/clones: 264 ([ZFS](https://en.wikipedia.org/wiki/ZFS), default)
+ - Maximum size of PostgreSQL data directory: 256 quadrillion zebibytes, or 2128 bytes ([ZFS](https://en.wikipedia.org/wiki/ZFS), default)
+- Support & technologies
+ - Supported PostgreSQL versions: 9.6–17
+ - Thin cloning ([CoW](https://en.wikipedia.org/wiki/Copy-on-write)) technologies: [ZFS](https://en.wikipedia.org/wiki/ZFS) and [LVM](https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux))
+ - UI for manual tasks and API & CLI for automation
+ - Packaged in Docker containers for all components
+- PostgreSQL containers
+ - Popular extensions including contrib modules, pgvector, HypoPG and many others ([docs](https://postgres.ai/docs/database-lab/supported-databases#extensions-included-by-default))
+ - Customization capabilities for containers ([docs](https://postgres.ai/docs/database-lab/supported-databases#how-to-add-more-extensions))
+ - Docker container and PostgreSQL configuration parameters in the DBLab config
+- Source database requirements
+ - Location flexibility: self-managed PostgreSQL, AWS RDS, GCP Cloud SQL, Azure, etc.—no source adjustments needed.
+ - No ZFS or Docker requirements for source databases
+- Data provisioning & retrieval
+ - Physical (pg_basebackup, WAL-G, pgBackRest) and logical (dump/restore) provisioning
+ - Partial data retrieval in logical mode (specific databases/tables)
+ - Continuous update in physical mode
+ - Periodic full refresh in logical mode without downtime
+- Recovery & management
+ - Fast Point in Time Recovery (PITR) for physical mode
+ - Auto-deletion of unused clones
+ - Snapshot retention policies in DBLab configuration
+- Clones
+ - "Deletion protection" for preventing clone deletion
+ - Persistent clones withstand DBLab restarts
+ - "Reset" command for data version switching
+ - Resource quotas: CPU, RAM
+- Monitoring & security
+ - `/healthz` API endpoint (no auth), extended `/status` endpoint ([API docs](https://api.dblab.dev))
+ - Netdata module for insights
## How to contribute
-### Give the project a star
-The easiest way to contribute is to give the project a GitHub/GitLab star:
+### Support us on GitHub/GitLab
+The simplest way to show your support is by giving us a star on GitHub or GitLab! ⭐

### Spread the word
-Post a tweet mentioning [@Database_Lab](https://twitter.com/Database_Lab) or share the link to this repo in your favorite social network.
+- Tweet about DBLab and mention [@Database_Lab](https://twitter.com/Database_Lab).
+- Share a link to this repository on your favorite social media platform.
-If you are actively using DLE, tell others about your experience. You can use the logo referenced below and stored in the `./assets` folder. Feel free to put them in your documents, slide decks, application, and website interfaces to show that you use DLE.
+### Share your experience
+If DBLab has been a vital tool for you, tell the world about your journey. Use the logo from the `./assets` folder for a visual touch. Whether it's in documents, presentations, applications, or on your website, let everyone know you trust and use DBLab.
HTML snippet for lighter backgrounds:
@@ -142,57 +157,60 @@ For darker backgrounds:
```
### Propose an idea or report a bug
-Check out our [contributing guide](./CONTRIBUTING.md) for more details.
+For proposals, bug reports, and participation in development, see our [Contributing Guide](./CONTRIBUTING.md).
-### Participate in development
-Check out our [contributing guide](./CONTRIBUTING.md) for more details.
-
-### Translate the README
-Making Database Lab Engine more accessible to engineers around the Globe is a great help for the project. Check details in the [translation section of contributing guide](./CONTRIBUTING.md#Translation).
### Reference guides
-- [DLE components](https://postgres.ai/docs/reference-guides/database-lab-engine-components)
-- [DLE configuration reference](https://postgres.ai/docs/database-lab/config-reference)
-- [DLE API reference](https://postgres.ai/swagger-ui/dblab/)
+- [DBLab components](https://postgres.ai/docs/reference-guides/database-lab-engine-components)
- [Client CLI reference](https://postgres.ai/docs/database-lab/cli-reference)
+- [DBLab API reference](https://api.dblab.dev/)
+- [DBLab configuration reference](https://postgres.ai/docs/database-lab/config-reference)
### How-to guides
-- [How to install Database Lab with Terraform on AWS](https://postgres.ai/docs/how-to-guides/administration/install-database-lab-with-terraform)
- [How to install and initialize Database Lab CLI](https://postgres.ai/docs/how-to-guides/cli/cli-install-init)
-- [How to manage DLE](https://postgres.ai/docs/how-to-guides/administration)
+- [How to manage DBLab](https://postgres.ai/docs/how-to-guides/administration)
- [How to work with clones](https://postgres.ai/docs/how-to-guides/cloning)
+- [How to work with branches](XXXXXXX) – TBD
+- [How to integrate DBLab with GitHub Actions](XXXXXXX) – TBD
+- [How to integrate DBLab with GitLab CI/CD](XXXXXXX) – TBD
-More you can find in [the "How-to guides" section](https://postgres.ai/docs/how-to-guides) of the docs.
+You can find more in the ["How-to guides" section](https://postgres.ai/docs/how-to-guides) of the documentation.
### Miscellaneous
-- [DLE Docker images](https://hub.docker.com/r/postgresai/dblab-server)
+- [DBLab Docker images](https://hub.docker.com/r/postgresai/dblab-server)
- [Extended Docker images for PostgreSQL (with plenty of extensions)](https://hub.docker.com/r/postgresai/extended-postgres)
- [SQL Optimization chatbot (Joe Bot)](https://postgres.ai/docs/joe-bot)
- [DB Migration Checker](https://postgres.ai/docs/db-migration-checker)
## License
-DLE source code is licensed under the OSI-approved open source license GNU Affero General Public License version 3 (AGPLv3).
+The DBLab source code is licensed under the OSI-approved open source license [Apache 2.0](https://opensource.org/license/apache-2-0/).
Reach out to the Postgres.ai team if you want a trial or commercial license that does not contain the GPL clauses: [Contact page](https://postgres.ai/contact).
-[](https://app.fossa.io/projects/git%2Bgithub.com%2Fpostgres-ai%2Fdatabase-lab-engine?ref=badge_large)
-
## Community & Support
-- ["Database Lab Engine Community Covenant Code of Conduct"](./CODE_OF_CONDUCT.md)
-- Where to get help: [Contact page](https://postgres.ai/contact)
+- [Database Lab Engine Community Covenant Code of Conduct](./CODE_OF_CONDUCT.md)
+- Where to get help: [Contact page](https://postgres.ai/contact).
- [Community Slack](https://slack.postgres.ai)
-- If you need to report a security issue, follow instructions in ["Database Lab Engine security guidelines"](./SECURITY.md).
+- If you need to report a security issue, follow the instructions in [Database Lab Engine Security Guidelines](./SECURITY.md).
[](./CODE_OF_CONDUCT.md)
+Many thanks to our amazing contributors!
+
+
+
+
+
## Translations
+Making DBLab more accessible to engineers around the globe is a great help for the project. Check details in the [translation section of contributing guide](./CONTRIBUTING.md#Translation).
This README is available in the following translations:
-
-- [German / Deutsch](translations/README.german.md) (🙏 [@ane4ka](https://github.com/ane4ka))
-- [Brazilian Portuguese / Português (BR)](translations/README.portuguese-br.md) (🙏 [@Alexand](https://gitlab.com/Alexand))
-- [Russian / Pусский](translations/README.russian.md) (🙏 [@Tanya301](https://github.com/Tanya301))
-- [Spanish / Español](translations/README.spanish.md) (🙏 [@asotolongo](https://gitlab.com/asotolongo))
-- [Ukrainian / Українська](translations/README.ukrainian.md) (🙏 [@denis-boost](https://github.com/denis-boost))
+- [German / Deutsch](translations/README.german.md) (by [@ane4ka](https://github.com/ane4ka))
+- [Brazilian Portuguese / Português (BR)](translations/README.portuguese-br.md) (by [@Alexand](https://gitlab.com/Alexand))
+- [Russian / Pусский](translations/README.russian.md) (by [@Tanya301](https://github.com/Tanya301))
+- [Spanish / Español](translations/README.spanish.md) (by [@asotolongo](https://gitlab.com/asotolongo))
+- [Ukrainian / Українська](translations/README.ukrainian.md) (by [@denis-boost](https://github.com/denis-boost))
👉 [How to make a translation contribution](./CONTRIBUTING.md#translation)
+
+
diff --git a/assets/database-lab-dark-mode.png b/assets/database-lab-dark-mode.png
new file mode 100644
index 00000000..072f6fb3
Binary files /dev/null and b/assets/database-lab-dark-mode.png differ
diff --git a/assets/database-lab-dark-mode.svg b/assets/database-lab-dark-mode.svg
new file mode 100644
index 00000000..2db3bd73
--- /dev/null
+++ b/assets/database-lab-dark-mode.svg
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/assets/database-lab-light-mode.png b/assets/database-lab-light-mode.png
new file mode 100644
index 00000000..347745a2
Binary files /dev/null and b/assets/database-lab-light-mode.png differ
diff --git a/assets/database-lab-light-mode.svg b/assets/database-lab-light-mode.svg
new file mode 100644
index 00000000..81ad331b
--- /dev/null
+++ b/assets/database-lab-light-mode.svg
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/assets/dle-simple.png b/assets/dle-simple.png
new file mode 100644
index 00000000..9727a2d9
Binary files /dev/null and b/assets/dle-simple.png differ
diff --git a/assets/dle-simple.svg b/assets/dle-simple.svg
new file mode 100644
index 00000000..76daec73
--- /dev/null
+++ b/assets/dle-simple.svg
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/assets/dle.svg b/assets/dle.svg
index 9d056971..ab0b2f99 100644
--- a/assets/dle.svg
+++ b/assets/dle.svg
@@ -3,10 +3,10 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/assets/dle_button.svg b/assets/dle_button.svg
index 4efa2538..a03d399d 100644
--- a/assets/dle_button.svg
+++ b/assets/dle_button.svg
@@ -4,12 +4,12 @@
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/cloudformation/dle_cf_template.yaml b/cloudformation/dle_cf_template.yaml
deleted file mode 100644
index 6b53e154..00000000
--- a/cloudformation/dle_cf_template.yaml
+++ /dev/null
@@ -1,583 +0,0 @@
-AWSTemplateFormatVersion: 2010-09-09
-Description: >-
- AWS CloudFormation template DLE_Instance_Host: Creates a single EC2 instance based on Database Lab Engine (DLE) AMI,
- configures DLE, launches the data retrieval process, eventually making it possible to create thin clones using DLE API, CLI, or UI.
- You will be billed for the AWS resources used if you create a stack from this template.
-Metadata:
- AWS::CloudFormation::Interface:
- ParameterGroups:
- -
- Label:
- default: "Amazon EC2 configuration"
- Parameters:
- - InstanceType
- - ZFSVolumeSize
- - SSHLocation
- - VPC
- - Subnet
- - KeyName
- - Label:
- default: "TLS certificate configuration"
- Parameters:
- - CertificateSubdomain
- - CertificateHostedZone
- - CertificateEmail
- -
- Label:
- default: "Database Lab Engine (DLE) configuration"
- Parameters:
- - DLERetrievalRefreshTimetable
- - PostgresDumpParallelJobs
- - DLEVerificationToken
- - DLEDebugMode
- -
- Label:
- default: "Source PostgreSQL parameters"
- Parameters:
- - SourceDatabaseSize
- - SourcePostgresHost
- - SourcePostgresPort
- - SourcePostgresUsername
- - SourcePostgresPassword
- - SourcePostgresDBName
- - PostgresConfigSharedPreloadLibraries
- - SourcePostgresDBList
- -
- Label:
- default: "Advanced DLE configuration"
- Parameters:
- - PostgresDockerImage
- - DLEZFSDataSetsNumber
- ParameterLabels:
- KeyName:
- default: "Key pair"
- InstanceType:
- default: "Instance type"
- SSHLocation:
- default: "Connection source IP range"
- SourceDatabaseSize:
- default: "Total source database size in GiB"
- CertificateSubdomain:
- default: "Certificate subdomain"
- CertificateHostedZone:
- default: "Hosted zone"
- CertificateEmail:
- default: "Certificate email"
- DLEDebugMode:
- default: "DLE debug mode"
- DLEVerificationToken:
- default: "DLE verification token"
- DLERetrievalRefreshTimetable:
- default: "DLE retrieval refresh timetable"
- PostgresDockerImage:
- default: "Postgres docker image"
- DLEZFSDataSetsNumber:
- default: "Number of supported snapshots."
- PostgresDumpParallelJobs:
- default: "Number of pg_dump jobs"
- SourcePostgresDBName:
- default: "Database name"
- VPC:
- default: "VPC security group"
- Subnet:
- default: "Subnet"
- SourcePostgresHost:
- default: "Host name or IP"
- SourcePostgresPort:
- default: "Port"
- SourcePostgresUsername:
- default: "User name"
- SourcePostgresPassword:
- default: "Password"
- PostgresConfigSharedPreloadLibraries:
- default: "shared_preload_libraries parameter"
- SourcePostgresDBList:
- default: "Comma separated list of databases to copy"
-Parameters:
- Subnet:
- Description: Subnet to attach EC2 machine.
- Type: AWS::EC2::Subnet::Id
- VPC:
- Description: VPC to attach EC2 machine.
- Type: AWS::EC2::VPC::Id
- ConstraintDescription: Can contain only ASCII characters and can not be empty.
- KeyName:
- Description: Name of an existing EC2 KeyPair to enable SSH access to the instance
- Type: 'AWS::EC2::KeyPair::KeyName'
- ConstraintDescription: Can contain only ASCII characters and can not be empty.
- InstanceType:
- Description: DLE EC2 instance type
- Type: String
- Default: m5.2xlarge
- AllowedValues:
- - r5.large
- - r5.xlarge
- - r5.2xlarge
- - r5.4xlarge
- - r5.8xlarge
- - r5.12xlarge
- - r5.16xlarge
- - r5.24xlarge
- - m5.large
- - m5.xlarge
- - m5.2xlarge
- - m5.4xlarge
- - m5.8xlarge
- - m5.12xlarge
- - m5.16xlarge
- - m5.24xlarge
- ConstraintDescription: must be a valid EC2 instance type.
- SSHLocation:
- Description: CIDR in format x.x.x.x/32 to allow one specific IP address access, 0.0.0.0/0 to allow all IP addresses access, or another CIDR range
- Type: String
- MinLength: '9'
- MaxLength: '18'
- AllowedPattern: '(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})/(\d{1,2})'
- ConstraintDescription: Must be a valid IP CIDR range of the form x.x.x.x/x
- SourceDatabaseSize:
- Description: The size of the source databases used to calculate the size of EBS volume, in GiB
- Type: Number
- Default: 40
- CertificateSubdomain:
- Description: Subdomain to obtain a TLS certificate for (for example, dle). Leave it empty if you don't need SSL connection or don't have Route 53 hosted zone.
- Type: String
- CertificateHostedZone:
- Description: Hosted zone to obtain a TLS certificate for (for example, example.com). Leave it empty if you don't need SSL connection or don't have Route 53 hosted zone.
- Type: String
- CertificateEmail:
- Description: Email address for important account notifications about the issued TLS certificate. Leave it empty if you don't need SSL connection or don't have Route 53 hosted zone.
- Type: String
- AllowedPattern: '^$|[^\s@]+@[^\s@]+\.[^\s@]+'
- Default: ''
- ConstraintDescription: Must be a valid email of the form \'user@example.com\'
- DLEDebugMode:
- Description: Enables DLE debug mode
- Type: String
- Default: True
- AllowedValues:
- - True
- - False
- DLEVerificationToken:
- Description: DLE verification token
- Type: String
- Default: "example-verification-token"
- MinLength: '9'
- MaxLength: '32'
- DLERetrievalRefreshTimetable:
- Description: DLE refresh schedule on cron format
- Type: String
- Default: '0 0 * * *'
- DLEZFSDataSetsNumber:
- Description: Number of database copies needed
- Type: Number
- Default: 2
- MinValue: 2
- MaxValue: 100
- PostgresDockerImage:
- Description: Docker image to run PostgreSQL
- Type: String
- Default: 'postgresai/extended-postgres:14'
- SourcePostgresDBName:
- Description: Source database name. This parameter is used to connect to the database
- Type: String
- Default: 'postgres'
- SourcePostgresHost:
- Description: Source Postgres cluster host name or IP
- Type: String
- Default: ''
- SourcePostgresPort:
- Description: Source Postgres cluster port
- Type: Number
- MinValue: 1024
- MaxValue: 65535
- Default: 5432
- SourcePostgresUsername:
- Description: Source Postgres cluster username
- Type: String
- Default: postgres
- SourcePostgresPassword:
- Description: Source Postgres cluster password
- Type: String
- Default: ''
- NoEcho: true
- PostgresConfigSharedPreloadLibraries:
- Description: Source Postgres shared_preload_libraries value
- Type: String
- Default: ''
- PostgresDumpParallelJobs:
- Description: Number of jobs to run pg_dump against the source database
- Type: String
- Default: '1'
- SourcePostgresDBList:
- Description: List of database names on source for copy to DLE. Leave it empty to copy all accessible databases
- Type: String
- Default: ''
-Mappings:
- AWSInstanceType2Arch:
- r5.large:
- Arch: HVM64
- r5.xlarge:
- Arch: HVM64
- r5.2xlarge:
- Arch: HVM64
- r5.4xlarge:
- Arch: HVM64
- r5.8xlarge:
- Arch: HVM64
- r5.12xlarge:
- Arch: HVM64
- r5.16xlarge:
- Arch: HVM64
- r5.24xlarge:
- Arch: HVM64
- m5.large:
- Arch: HVM64
- m5.xlarge:
- Arch: HVM64
- m5.2xlarge:
- Arch: HVM64
- m5.4xlarge:
- Arch: HVM64
- m5.8xlarge:
- Arch: HVM64
- m5.12xlarge:
- Arch: HVM64
- m5.16xlarge:
- Arch: HVM64
- m5.24xlarge:
- Arch: HVM64
- AWSRegionArch2AMI:
- eu-north-1:
- HVM64: ami-0888261a1eacb636e
- ap-south-1:
- HVM64: ami-00539bfa7a6926e1b
- eu-west-3:
- HVM64: ami-038d1f1d1ef71112b
- eu-west-2:
- HVM64: ami-07c2bca027887871b
- eu-west-1:
- HVM64: ami-0e38f0f4f0acd49c2
- ap-northeast-3:
- HVM64: ami-01cd2976ef1688c25
- ap-northeast-2:
- HVM64: ami-049c608703690f99e
- ap-northeast-1:
- HVM64: ami-0cb59515cd67fdc93
- sa-east-1:
- HVM64: ami-0b3aeaa58412025de
- ca-central-1:
- HVM64: ami-075d0aae6fdd356b1
- ap-southeast-1:
- HVM64: ami-054e735ba76985f92
- ap-southeast-2:
- HVM64: ami-06558ef4fedcf3c2f
- eu-central-1:
- HVM64: ami-048a27a74e4c1239d
- us-east-1:
- HVM64: ami-0ed40b8023c788775
- us-east-2:
- HVM64: ami-0d6a0bd053962b66f
- us-west-1:
- HVM64: ami-0ef7453c037b624ec
- us-west-2:
- HVM64: ami-0bdf048f8e10f02eb
-Conditions:
- CreateSubDomain:
- !Not [!Equals [!Ref CertificateHostedZone, '']]
- NotCreateSubDomain:
- !Not [Condition: CreateSubDomain]
-
-Resources:
- LambdaExecutionRole:
- Type: AWS::IAM::Role
- Properties:
- AssumeRolePolicyDocument:
- Version: '2012-10-17'
- Statement:
- - Effect: Allow
- Principal: {Service: [lambda.amazonaws.com]}
- Action: ['sts:AssumeRole']
- Path: "/"
- ManagedPolicyArns:
- - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole
- PowerFunction:
- Type: AWS::Lambda::Function
- Properties:
- Handler: index.handler
- Role: !GetAtt LambdaExecutionRole.Arn
- Code:
- ZipFile: !Sub |
- var response = require('cfn-response');
- exports.handler = function(event, context) {
- var result = parseInt(event.ResourceProperties.Op1)*(parseInt(event.ResourceProperties.Op2)+2);
- response.send(event, context, response.SUCCESS, {Value: result});
- };
- Runtime: nodejs14.x
- SizeCalculate:
- Type: Custom::Power
- Properties:
- ServiceToken: !GetAtt PowerFunction.Arn
- Op1: !Ref SourceDatabaseSize
- Op2: !Ref DLEZFSDataSetsNumber
-
- ZFSVolume:
- Type: AWS::EC2::Volume
- DeletionPolicy: Snapshot
- Properties:
- Encrypted: True
- AvailabilityZone: !GetAtt DLEInstance.AvailabilityZone
- Size: !GetAtt SizeCalculate.Value
- Tags:
- -
- Key: Name
- Value: dle-zfs-volume
- VolumeType: gp2
-
- DLEInstance:
- Type: 'AWS::EC2::Instance'
- Properties:
- ImageId: !FindInMap
- - AWSRegionArch2AMI
- - !Ref 'AWS::Region'
- - !FindInMap
- - AWSInstanceType2Arch
- - !Ref InstanceType
- - Arch
- InstanceType: !Ref InstanceType
- SecurityGroupIds: !If
- - CreateSubDomain
- - - !GetAtt DLESecurityGroup.GroupId
- - !GetAtt DLEUISecurityGroup.GroupId
- - - !GetAtt DLESecurityGroup.GroupId
- KeyName: !Ref KeyName
- SubnetId: !Ref Subnet
- Tags:
- -
- Key: Name
- Value: "DLE Instance"
- UserData:
- Fn::Base64: !Sub | # No more Fn::Join needed
- #!/bin/bash
- set -ex
-
- sleep 30
-
- # This code tested and works on Ubuntu 20.04 (current base AMI)
- disk=$(lsblk -e7 --output PATH,NAME,FSTYPE --json | jq -r '.blockdevices[] | select(.children == null and .fstype == null) | .path ')
-
- sudo zpool create -f \
- -O compression=on \
- -O atime=off \
- -O recordsize=128k \
- -O logbias=throughput \
- -m /var/lib/dblab/dblab_pool \
- dblab_pool \
- $disk
-
- for i in {1..${DLEZFSDataSetsNumber}}; do
- sudo zfs create dblab_pool/dataset_$i
- done
-
- dle_config_path="/home/ubuntu/.dblab/engine/configs"
- dle_meta_path="/home/ubuntu/.dblab/engine/meta"
- postgres_conf_path="/home/ubuntu/.dblab/postgres_conf"
-
- yq e -i '
- .global.debug=${DLEDebugMode} |
- .embeddedUI.host="" |
- .server.verificationToken="${DLEVerificationToken}" |
- .retrieval.refresh.timetable="${DLERetrievalRefreshTimetable}" |
- .retrieval.spec.logicalRestore.options.forceInit=true |
- .poolManager.mountDir = "/var/lib/dblab/dblab_pool" |
- .retrieval.spec.logicalDump.options.dumpLocation="/var/lib/dblab/dblab_pool/dataset_1/dump/" |
- .retrieval.spec.logicalRestore.options.dumpLocation="/var/lib/dblab/dblab_pool/dataset_1/dump/" |
- .databaseContainer.dockerImage="${PostgresDockerImage}" |
- .databaseConfigs.configs.shared_preload_libraries="${PostgresConfigSharedPreloadLibraries}"
- ' $dle_config_path/server.yml
-
- yq e -i '
- .retrieval.spec.logicalDump.options.source.connection.host = "${SourcePostgresHost}" |
- .retrieval.spec.logicalDump.options.source.connection.port = ${SourcePostgresPort} |
- .retrieval.spec.logicalDump.options.source.connection.dbname="${SourcePostgresDBName}" |
- .retrieval.spec.logicalDump.options.source.connection.username = "${SourcePostgresUsername}" |
- .retrieval.spec.logicalDump.options.source.connection.password = "${SourcePostgresPassword}" |
- .retrieval.spec.logicalDump.options.parallelJobs = ${PostgresDumpParallelJobs} |
- .retrieval.spec.logicalRestore.options.configs.shared_preload_libraries = "${PostgresConfigSharedPreloadLibraries}"
- ' $dle_config_path/server.yml
-
- for i in $(echo ${SourcePostgresDBList} | sed "s/,/ /g")
- do
- yq e -i "
- .retrieval.spec.logicalDump.options.databases.$i = {}
- " $dle_config_path/server.yml
- done
-
-
- sudo docker run \
- --detach \
- --name dblab_server \
- --label dblab_control \
- --privileged \
- --publish 2345:2345 \
- --volume /var/run/docker.sock:/var/run/docker.sock \
- --volume /var/lib/dblab:/var/lib/dblab/:rshared \
- --volume /var/lib/dblab/dblab_pool/dataset_1/dump/:/var/lib/dblab/dblab_pool/dataset_1/dump/:rshared \
- --volume $dle_config_path:/home/dblab/configs:ro \
- --volume $dle_meta_path:/home/dblab/meta \
- --volume $postgres_conf_path:/home/dblab/standard/postgres/control \
- --env DOCKER_API_VERSION=1.39 \
- --restart always \
- registry.gitlab.com/postgres-ai/database-lab/dblab-server:3.1.1
-
- if [ ! -z "${CertificateHostedZone}" ]; then
- export DOMAIN=${CertificateSubdomain}.${CertificateHostedZone}
- export USER_EMAIL=${CertificateEmail}
- export CERTIFICATE_EMAIL=${!USER_EMAIL:-'noreply@'$DOMAIN}
-
- sudo certbot certonly --standalone -d $DOMAIN -m $CERTIFICATE_EMAIL --agree-tos -n
- sudo cp /etc/letsencrypt/live/$DOMAIN/fullchain.pem /etc/envoy/certs/fullchain1.pem
- sudo cp /etc/letsencrypt/live/$DOMAIN/privkey.pem /etc/envoy/certs/privkey1.pem
-
- cat < /etc/letsencrypt/renewal-hooks/deploy/envoy.deploy
- #!/bin/bash
- umask 0177
- export DOMAIN=${CertificateSubdomain}.${CertificateHostedZone}
- export DATA_DIR=/etc/envoy/certs/
- cp /etc/letsencrypt/live/$DOMAIN/fullchain.pem $DATA_DIR/fullchain1.pem
- cp /etc/letsencrypt/live/$DOMAIN/privkey.pem $DATA_DIR/privkey1.pem
- EOF
- sudo chmod +x /etc/letsencrypt/renewal-hooks/deploy/envoy.deploy
-
- sudo systemctl enable envoy
- sudo systemctl start envoy
- fi
-
- while ! echo "UI started" | nc localhost 2346; do sleep 10; done
- /opt/aws/bin/cfn-signal -e $? -d "DLE UI is available" -r "DLE Deploy Process Complete" '${WaitHandle}'
-
- WaitHandle:
- Type: AWS::CloudFormation::WaitConditionHandle
- WaitCondition:
- Type: AWS::CloudFormation::WaitCondition
- DependsOn: DLEInstance
- Properties:
- Handle: !Ref 'WaitHandle'
- Timeout: '600'
-
- MountPoint:
- Type: AWS::EC2::VolumeAttachment
- Properties:
- InstanceId: !Ref DLEInstance
- VolumeId: !Ref ZFSVolume
- Device: /dev/xvdh
-
- DLEElasticIP:
- Type: AWS::EC2::EIP
- Properties:
- Domain: vpc
- InstanceId: !Ref DLEInstance
-
- SubDomain:
- Type: AWS::Route53::RecordSet
- Condition: CreateSubDomain
- Properties:
- HostedZoneName: !Sub '${CertificateHostedZone}.'
- Comment: DNS name for DLE instance.
- Name: !Sub '${CertificateSubdomain}.${CertificateHostedZone}'
- Type: CNAME
- TTL: 60
- ResourceRecords:
- - !GetAtt DLEInstance.PublicDnsName
- DependsOn:
- - DLEInstance
- - DLEElasticIP
-
- DLESecurityGroup:
- Type: 'AWS::EC2::SecurityGroup'
- Properties:
- GroupDescription: Enable ssh access via port 22
- SecurityGroupIngress:
- - IpProtocol: tcp
- FromPort: 22
- ToPort: 22
- CidrIp: !Ref SSHLocation
- SecurityGroupEgress:
- - IpProtocol: -1
- CidrIp: '0.0.0.0/0'
- VpcId: !Ref VPC
-
- DLEUISecurityGroup:
- Type: 'AWS::EC2::SecurityGroup'
- Condition: CreateSubDomain
- Properties:
- GroupDescription: Enable ports to access DLE UI
- SecurityGroupIngress:
- - IpProtocol: tcp
- FromPort: 80
- ToPort: 80
- CidrIp: !Ref SSHLocation
-
- - IpProtocol: tcp
- FromPort: 443
- ToPort: 443
- CidrIp: !Ref SSHLocation
-
- - IpProtocol: tcp
- FromPort: 446
- ToPort: 446
- CidrIp: !Ref SSHLocation
- SecurityGroupEgress:
- - IpProtocol: -1
- CidrIp: '0.0.0.0/0'
- VpcId: !Ref VPC
-
-Outputs:
- 02VerificationToken:
- Description: 'DLE verification token'
- Value: !Ref DLEVerificationToken
-
- 08DLEInstance:
- Description: URL for newly created DLE instance
- Value: !Sub 'https://${CertificateSubdomain}.${CertificateHostedZone}'
- Condition: CreateSubDomain
-
- 01WebUIUrl:
- Description: UI URL with a domain for newly created DLE instance
- Value: !Sub 'https://${CertificateSubdomain}.${CertificateHostedZone}:446'
- Condition: CreateSubDomain
- 01WebUIUrl:
- Description: UI URL with a domain for newly created DLE instance
- Value: !Sub 'http://localhost:2346'
- Condition: NotCreateSubDomain
-
- 07EBSVolumeSize:
- Description: Size of provisioned EBS volume
- Value: !GetAtt SizeCalculate.Value
-
- 03DNSName:
- Description: Public DNS name
- Value: !GetAtt DLEInstance.PublicDnsName
-
- 06EC2SSH:
- Description: SSH connection to the EC2 instance with Database Lab Engine
- Value: !Sub
- - 'ssh ubuntu@${DNSName} -i YOUR_PRIVATE_KEY'
- - DNSName: !GetAtt DLEInstance.PublicDnsName
-
- 05DLETunnel:
- Description: Create an SSH-tunnel to Database Lab Engine
- Value: !Sub
- - 'ssh -N -L 2345:${DNSName}:2345 ubuntu@${DNSName} -i YOUR_PRIVATE_KEY'
- - DNSName: !GetAtt DLEInstance.PublicDnsName
-
- 00UITunnel:
- Description: Use SSH port forwarding to be able to access DLE UI
- Value: !Sub
- - 'ssh -N -L 2346:${DNSName}:2346 ubuntu@${DNSName} -i YOUR_PRIVATE_KEY'
- - DNSName: !GetAtt DLEInstance.PublicDnsName
-
- 04CloneTunnel:
- Description: Use SSH port forwarding to be able to access a database clone
- Value: !Sub
- - 'ssh -N -L CLONE_PORT:${DNSName}:CLONE_PORT ubuntu@${DNSName} -i YOUR_PRIVATE_KEY'
- - DNSName: !GetAtt DLEInstance.PublicDnsName
diff --git a/cloudformation/getAMIs.sh b/cloudformation/getAMIs.sh
deleted file mode 100755
index 27a71304..00000000
--- a/cloudformation/getAMIs.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-# This script takes a a parameter which needs to be a name of an AWS AMI
-# The string will have to identify the AMI uniquely in all regions.
-# The script will generate an output which can be copied into json files of AWS CloudFormation
-#
-# The script uses the AWS command line tools.
-# The AWS command line tools have to have a default profile with the permission to
-# describe a region and to describe an image
-
-# The script can be run with normal OS user privileges.
-# The script is not supposed to modify anything.
-# There is no warranty. Please check the script upfront. You will use it on your own risk
-# String to be used when no AMI is available in region
-NOAMI="NOT_SUPPORTED"
-# Change your aws prfile if needed here:
-PROFILE=" --profile default"
-# Check whether AWS CLI is installed and in search path
-if ! aws_loc="$(type -p "aws")" || [ -z "$aws_loc" ]; then
-echo "Error: Script requeres AWS CLI . Install it and retry"
-exit 1
-fi
-# Check whether parameter has been provided
-if [ -z "$1" ]
-then
-NAME=DBLABserver*
-echo "No parameter provided."
-else
-NAME=$1
-fi
-echo "Will search for AMIs with name: ${NAME}"
-echo "---------------------------------------"
-##NAME=DBLABserver*
-R=$(aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text ${PROFILE})
-for i in $R; do
-AMI=`aws ec2 describe-images --owners 005923036815 --region $i --filters "Name=name,Values=${NAME}" --output json | jq -r '.Images | sort_by(.CreationDate) | last(.[]).ImageId'`
-if [ -z "$AMI" ]
-then
-AMI=$NOAMI
-fi
-echo " "${i}: $'\n' " "HVM64: ${AMI}
-done
-
diff --git a/engine/.dockerignore b/engine/.dockerignore
new file mode 100644
index 00000000..840be396
--- /dev/null
+++ b/engine/.dockerignore
@@ -0,0 +1 @@
+meta/
\ No newline at end of file
diff --git a/engine/.gitlab-ci.yml b/engine/.gitlab-ci.yml
index 0d47c139..a048e132 100644
--- a/engine/.gitlab-ci.yml
+++ b/engine/.gitlab-ci.yml
@@ -1,5 +1,7 @@
default:
- image: golang:1.18
+ image:
+ name: golang:1.23
+ pull_policy: if-not-present
stages:
- test
@@ -56,7 +58,9 @@ lint:
### Build binary.
build-binary-alpine:
<<: *only_engine
- image: golang:1.18-alpine
+ image:
+ name: golang:1.23-alpine
+ pull_policy: if-not-present
stage: build-binary
artifacts:
paths:
@@ -136,13 +140,18 @@ build-binary-client-rc:
- gsutil -m cp -r bin/cli/* gs://database-lab-cli/${CLEAN_TAG}/
.job_template: &build_image_definition
- image: docker:20
+ image:
+ name: docker:24
+ pull_policy: if-not-present
stage: build
artifacts:
paths:
- engine/bin
services:
- - name: docker:dind
+ - name: docker:24-dind
+ alias: docker
+ command: [ "--tls=false" ]
+ pull_policy: if-not-present
script:
- cd engine
- apk update && apk upgrade && apk add --no-cache bash # TODO(anatoly): Remove dependency.
@@ -203,7 +212,7 @@ build-image-master-server:
build-image-master-server-zfs08:
<<: *build_image_definition
<<: *only_master
- variables:
+ variables:
DOCKER_FILE: "Dockerfile.dblab-server-zfs08"
DOCKER_NAME: "registry.gitlab.com/postgres-ai/database-lab/dblab-server"
TAGS: "${DOCKER_NAME}:master-zfs0.8,${DOCKER_NAME}:master-${CI_COMMIT_SHORT_SHA}-zfs0.8"
@@ -219,7 +228,7 @@ build-image-master-ci-checker:
build-image-master-client:
<<: *build_image_definition
<<: *only_master
- variables:
+ variables:
DOCKER_FILE: "Dockerfile.dblab-cli"
DOCKER_NAME: "registry.gitlab.com/postgres-ai/database-lab/dblab-cli"
TAGS: "${DOCKER_NAME}:master,${DOCKER_NAME}:master-${CI_COMMIT_SHORT_SHA}"
@@ -237,7 +246,6 @@ build-image-latest-server:
- export CLEAN_TAG=$(echo ${CI_COMMIT_TAG#"v"})
- export LATEST_TAG=$(echo ${CLEAN_TAG%.*}-latest)
- export TAGS="${DOCKER_NAME}:${LATEST_TAG},${DOCKER_NAME}:${CLEAN_TAG}"
-
build-image-latest-server-zfs08:
<<: *build_image_definition
<<: *only_tag_release
@@ -331,7 +339,6 @@ build-image-rc-server-zfs08:
REGISTRY: "${DH_CI_REGISTRY}"
DOCKER_FILE: "Dockerfile.dblab-server-zfs08"
DOCKER_NAME: "postgresai/dblab-server"
-
build-image-rc-server-dev:
<<: *build_image_definition
<<: *only_tag_rc
@@ -344,7 +351,6 @@ build-image-rc-server-dev:
REGISTRY: "${CI_REGISTRY}"
DOCKER_FILE: "Dockerfile.dblab-server"
DOCKER_NAME: "registry.gitlab.com/postgres-ai/database-lab/dblab-server"
-
build-image-rc-server-dev-zfs08:
<<: *build_image_definition
<<: *only_tag_rc
@@ -357,7 +363,6 @@ build-image-rc-server-dev-zfs08:
REGISTRY: "${CI_REGISTRY}"
DOCKER_FILE: "Dockerfile.dblab-server-zfs08"
DOCKER_NAME: "registry.gitlab.com/postgres-ai/database-lab/dblab-server"
-
build-image-rc-ci-checker:
<<: *build_image_definition
<<: *only_tag_rc
@@ -370,7 +375,6 @@ build-image-rc-ci-checker:
REGISTRY: "${DH_CI_REGISTRY}"
DOCKER_FILE: "Dockerfile.ci-checker"
DOCKER_NAME: "postgresai/dblab-ci-checker"
-
build-image-rc-ci-checker-dev:
<<: *build_image_definition
<<: *only_tag_rc
@@ -383,7 +387,6 @@ build-image-rc-ci-checker-dev:
REGISTRY: "${CI_REGISTRY}"
DOCKER_FILE: "Dockerfile.ci-checker"
DOCKER_NAME: "registry.gitlab.com/postgres-ai/database-lab/dblab-ci-checker"
-
build-image-rc-client:
<<: *build_image_definition
<<: *only_tag_rc
@@ -396,17 +399,15 @@ build-image-rc-client:
REGISTRY: "${DH_CI_REGISTRY}"
DOCKER_FILE: "Dockerfile.dblab-cli"
DOCKER_NAME: "postgresai/dblab"
-
-build-image-swagger-latest:
+build-image-swagger-release:
<<: *build_image_definition
<<: *only_tag_release
variables:
DOCKER_FILE: "Dockerfile.swagger-ui"
- DOCKER_NAME: "registry.gitlab.com/postgres-ai/database-lab/dblab-swagger-ui"
+ DOCKER_IMAGE_NAME: "registry.gitlab.com/postgres-ai/database-lab/dblab-swagger-ui"
before_script:
- export CLEAN_TAG=$(echo ${CI_COMMIT_TAG#"v"})
- - export LATEST_TAG=$(echo ${CLEAN_TAG%.*}-latest)
- - export TAGS="${DOCKER_NAME}:${LATEST_TAG}"
+ - export TAGS="${DOCKER_IMAGE_NAME}:${CLEAN_TAG}"
.bash-test: &bash_test
stage: integration-test
@@ -421,6 +422,8 @@ build-image-swagger-latest:
artifacts:
paths:
- engine/bin
+ before_script:
+ - bash engine/test/_cleanup.sh
script:
- bash engine/test/1.synthetic.sh
- bash engine/test/2.logical_generic.sh
@@ -460,15 +463,32 @@ bash-test-14:
variables:
POSTGRES_VERSION: 14
+bash-test-15:
+ <<: *bash_test
+ variables:
+ POSTGRES_VERSION: 15
+
+bash-test-16:
+ <<: *bash_test
+ variables:
+ POSTGRES_VERSION: 16
+
+bash-test-17:
+ <<: *bash_test
+ variables:
+ POSTGRES_VERSION: 17
+
integration-test:
services:
- - name: docker:dind
+ - name: docker:24-dind
+ alias: docker
command: [ "--tls=false" ]
+ pull_policy: if-not-present
<<: *only_feature
stage: integration-test
variables:
# Instruct Testcontainers to use the daemon of DinD.
- DOCKER_HOST: "tcp://docker:2375"
+ # DOCKER_HOST: "tcp://docker:2375"
# Instruct Docker not to start over TLS.
DOCKER_TLS_CERTDIR: ""
# Improve performance with overlayfs.
@@ -478,3 +498,26 @@ integration-test:
script:
- cd engine
- make test-ci-integration
+
+## Deploy
+.deploy-definition: &deploy_definition
+ stage: deploy
+ image:
+ name: dtzar/helm-kubectl:2.14.1
+ pull_policy: if-not-present
+ script:
+ - bash ./engine/scripts/do.sh subs_envs ./engine/deploy/swagger-ui.yaml /tmp/swagger-ui.yaml
+ - kubectl apply --filename /tmp/swagger-ui.yaml -n $NAMESPACE
+
+deploy-swagger-ui-tag-release:
+ <<: *only_tag_release
+ <<: *deploy_definition
+ environment:
+ name: production
+ variables:
+ ENV: production
+ NAMESPACE: production
+ DOCKER_IMAGE_NAME: "registry.gitlab.com/postgres-ai/database-lab/dblab-swagger-ui"
+ before_script:
+ - export CLEAN_TAG=$(echo ${CI_COMMIT_TAG#"v"})
+ - export TAG="${DOCKER_IMAGE_NAME}:${CLEAN_TAG}"
diff --git a/engine/.golangci.yml b/engine/.golangci.yml
index 2b9a46df..bad31644 100644
--- a/engine/.golangci.yml
+++ b/engine/.golangci.yml
@@ -2,10 +2,9 @@ run:
timeout: 2m
issues-exit-code: 1
tests: true
- skip-dirs:
- - vendor
output:
- format: colored-line-number
+ formats:
+ - format: colored-line-number
print-issued-lines: true
print-linter-name: true
@@ -22,10 +21,8 @@ linters-settings:
gofmt:
simplify: true
gofumpt:
- lang-version: "1.17"
extra-rules: false
gosimple:
- go: "1.17"
checks: [ "all" ]
goimports:
local-prefixes: gitlab.com/postgres-ai/database-lab
@@ -37,14 +34,17 @@ linters-settings:
lll:
line-length: 140
tab-width: 1
- gomnd:
- settings:
- mnd:
- ignored-functions: strconv.Format*,os.*,strconv.Parse*,strings.SplitN,bytes.SplitN
+ mnd:
+ ignored-functions:
+ - strconv.Format*
+ - os.*
+ - strconv.Parse*
+ - strings.SplitN
+ - bytes.SplitN
revive:
- min-confidence: 0.8
+ confidence: 0.8
unused:
- check-exported: false
+ exported-fields-are-used: false
unparam:
check-exported: false
nakedret:
@@ -66,36 +66,31 @@ linters-settings:
linters:
enable:
- - deadcode
- - depguard
- dupl
- errcheck
- gochecknoinits
- goconst
- gocritic
- goimports
- - gomnd
- gosimple
- govet
- ineffassign
- lll
- - megacheck
- misspell
+ - mnd
- prealloc
- revive
- - structcheck
+ - staticcheck
- stylecheck
- unconvert
- - varcheck
- unused
- unparam
- wsl
enable-all: false
disable:
+ - depguard
- gosec
- - interfacer
- gocyclo # currently unmaintained
- presets:
fast: false
issues:
@@ -107,7 +102,9 @@ issues:
- lll
- errcheck
- wsl
- - gomnd
+ - mnd
+ exclude-dirs:
+ - vendor
exclude-use-default: false
max-issues-per-linter: 0
diff --git a/engine/Dockerfile.ci-checker b/engine/Dockerfile.ci-checker
index 966ab8c3..b509bc51 100644
--- a/engine/Dockerfile.ci-checker
+++ b/engine/Dockerfile.ci-checker
@@ -1,4 +1,4 @@
-FROM docker:20.10.12
+FROM docker:20.10.24
# Install dependencies.
RUN apk update && apk add --no-cache bash
diff --git a/engine/Dockerfile.dblab-cli b/engine/Dockerfile.dblab-cli
index 16eadd1a..d14f8222 100644
--- a/engine/Dockerfile.dblab-cli
+++ b/engine/Dockerfile.dblab-cli
@@ -1,7 +1,7 @@
-FROM docker:20.10.12
+FROM docker:20.10.24
# Install dependencies.
-RUN apk update && apk add --no-cache bash jq
+RUN apk update && apk add --no-cache bash jq tzdata
WORKDIR /home/dblab
COPY ./bin/dblab ./bin/dblab
diff --git a/engine/Dockerfile.dblab-server b/engine/Dockerfile.dblab-server
index ba5a22bb..c1d2644c 100644
--- a/engine/Dockerfile.dblab-server
+++ b/engine/Dockerfile.dblab-server
@@ -1,18 +1,10 @@
# See Guides to learn how to start a container: https://postgres.ai/docs/how-to-guides/administration/engine-manage
-FROM docker:20.10.12
+FROM docker:20.10.24
# Install dependencies
RUN apk update \
- && apk add zfs=2.1.4-r0 --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/main \
- && apk add --no-cache lvm2 bash util-linux
-RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.13/main' >> /etc/apk/repositories \
- && echo 'http://dl-cdn.alpinelinux.org/alpine/v3.13/community' >> /etc/apk/repositories \
- && apk add bcc-tools=0.18.0-r0 bcc-doc=0.18.0-r0 && ln -s $(which python3) /usr/bin/python \
- # TODO: remove after release the PR: https://github.com/iovisor/bcc/pull/3286 (issue: https://github.com/iovisor/bcc/issues/3099)
- && wget https://raw.githubusercontent.com/iovisor/bcc/master/tools/biosnoop.py -O /usr/share/bcc/tools/biosnoop
-
-ENV PATH="${PATH}:/usr/share/bcc/tools"
+ && apk add --no-cache zfs lvm2 bash util-linux tzdata
WORKDIR /home/dblab
diff --git a/engine/Dockerfile.dblab-server-debug b/engine/Dockerfile.dblab-server-debug
index 84d31ef4..af6b1f17 100644
--- a/engine/Dockerfile.dblab-server-debug
+++ b/engine/Dockerfile.dblab-server-debug
@@ -1,7 +1,7 @@
# How to start a container: https://postgres.ai/docs/how-to-guides/administration/engine-manage
# Compile stage
-FROM golang:1.18 AS build-env
+FROM golang:1.23 AS build-env
# Build Delve
RUN go install github.com/go-delve/delve/cmd/dlv@latest
@@ -17,14 +17,7 @@ FROM docker:20.10.12
# Install dependencies
RUN apk update \
&& apk add zfs=2.1.4-r0 --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/edge/main \
- && apk add --no-cache lvm2 bash util-linux
-RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.13/main' >> /etc/apk/repositories \
- && echo 'http://dl-cdn.alpinelinux.org/alpine/v3.13/community' >> /etc/apk/repositories \
- && apk add bcc-tools=0.18.0-r0 bcc-doc=0.18.0-r0 && ln -s $(which python3) /usr/bin/python \
- # TODO: remove after release the PR: https://github.com/iovisor/bcc/pull/3286 (issue: https://github.com/iovisor/bcc/issues/3099)
- && wget https://raw.githubusercontent.com/iovisor/bcc/master/tools/biosnoop.py -O /usr/share/bcc/tools/biosnoop
-
-ENV PATH="${PATH}:/usr/share/bcc/tools"
+ && apk add --no-cache lvm2 bash util-linux tzdata
WORKDIR /home/dblab
diff --git a/engine/Dockerfile.dblab-server-zfs08 b/engine/Dockerfile.dblab-server-zfs08
index 02d55262..5ed8938c 100644
--- a/engine/Dockerfile.dblab-server-zfs08
+++ b/engine/Dockerfile.dblab-server-zfs08
@@ -1,17 +1,10 @@
# See Guides to learn how to start a container: https://postgres.ai/docs/how-to-guides/administration/engine-manage
-FROM docker:20.10.12
+FROM docker:20.10.24
# Install dependencies.
RUN apk update && apk add zfs=0.8.4-r0 --no-cache --repository=https://dl-cdn.alpinelinux.org/alpine/v3.12/main \
- && apk add --no-cache lvm2 bash util-linux
-RUN echo 'http://dl-cdn.alpinelinux.org/alpine/v3.13/main' >> /etc/apk/repositories \
- && echo 'http://dl-cdn.alpinelinux.org/alpine/v3.13/community' >> /etc/apk/repositories \
- && apk add bcc-tools=0.18.0-r0 bcc-doc=0.18.0-r0 && ln -s $(which python3) /usr/bin/python \
- # TODO: remove after release the PR: https://github.com/iovisor/bcc/pull/3286 (issue: https://github.com/iovisor/bcc/issues/3099)
- && wget https://raw.githubusercontent.com/iovisor/bcc/master/tools/biosnoop.py -O /usr/share/bcc/tools/biosnoop
-
-ENV PATH="${PATH}:/usr/share/bcc/tools"
+ && apk add --no-cache lvm2 bash util-linux tzdata
WORKDIR /home/dblab
diff --git a/engine/Makefile b/engine/Makefile
index e76f7538..84bf96de 100644
--- a/engine/Makefile
+++ b/engine/Makefile
@@ -5,6 +5,8 @@ RUN_CI_BINARY = run-ci
CLI_BINARY = dblab
GOARCH = amd64
+PWD= $(shell pwd)
+
COMMIT?=$(shell git rev-parse HEAD)
BUILD_TIME?=$(shell date -u '+%Y%m%d-%H%M')
VERSION=$(shell git describe --tags --match "v*" 2>/dev/null || echo "${COMMIT}")
@@ -22,7 +24,7 @@ GOBUILD = GO111MODULE=on CGO_ENABLED=0 GOARCH=${GOARCH} go build ${LDFLAGS}
GOTEST = GO111MODULE=on go test -race
CLIENT_PLATFORMS=darwin linux freebsd windows
-ARCHITECTURES=amd64
+ARCHITECTURES=amd64 arm64
help: ## Display the help message
@echo "Please use \`make \` where is one of:"
@@ -32,7 +34,7 @@ help: ## Display the help message
all: clean build ## Build all binary components of the project
install-lint: ## Install the linter to $GOPATH/bin which is expected to be in $PATH
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.0
+ curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0
run-lint: ## Run linters
golangci-lint run
@@ -77,4 +79,20 @@ fmt: ## Format code
clean: ## Remove compiled binaries from the local bin/ directory
rm -f bin/*
-.PHONY: help all build test run-lint install-lint lint fmt clean build-image build-dle build-ci-checker build-client build-ci-checker
+run-dle: build-dle
+ docker run \
+ --rm \
+ --volume /tmp:/tmp \
+ --volume /var/run/docker.sock:/var/run/docker.sock \
+ --volume /var/lib/dblab:/var/lib/dblab/:rshared \
+ --volume /var/lib/dblab/dblab_pool/dump:/var/lib/dblab/dblab_pool/dump \
+ --volume /sys/kernel/debug:/sys/kernel/debug:rw \
+ --volume /lib/modules:/lib/modules:ro \
+ --volume $(PWD)/configs:/home/dblab/configs:ro \
+ --volume $(PWD)/meta:/home/dblab/meta \
+ --volume /proc:/host_proc:ro \
+ --env DOCKER_API_VERSION=1.39 \
+ -p "2345:2345" \
+ dblab_server:local
+
+.PHONY: help all build test run-lint install-lint lint fmt clean build-image build-dle build-ci-checker build-client build-ci-checker run-dle
diff --git a/engine/api/README.md b/engine/api/README.md
new file mode 100644
index 00000000..37e228aa
--- /dev/null
+++ b/engine/api/README.md
@@ -0,0 +1,24 @@
+# Database Lab Engine API
+
+## Directory Contents
+- `swagger-spec` – OpenAPI 3.0 specification of DBLab API
+- `swagger-ui` – Swagger UI to see the API specification (embedded in DBLab, available at :2345 or :2346/api)
+- `postman` – [Postman](https://www.postman.com/) collection and environment files used to test the API in CI/CD pipelines via [`newman`](https://github.com/postmanlabs/newman)
+
+## Design principles
+Work in progress: https://gitlab.com/postgres-ai/database-lab/-/merge_requests/744
+
+## API docs
+We use ReadMe.io to host the API documentation: https://dblab.readme.io/. Once a new API spec is ready, upload it as a new documentation version and publish.
+
+## Postman, newman, and CI/CD tests
+The Postman collection is generated from the OpenAPI spec file using [Portman](https://github.com/apideck-libraries/portman).
+1. Install and initialize `portman`.
+1. Generate a new version of the Postman collection:
+ ```
+ portman --cliOptionsFile engine/api/postman/portman-cli.json
+ ```
+1. Review and adjust the collection:
+ - Ensure object creation occurs before its deletion and pass the new object's ID between requests (TODO: provide example).
+ - Review and update tests as needed (TODO: details).
+1. Commit, push, and ensure Newman's CI/CD testing passes.
\ No newline at end of file
diff --git a/engine/api/postman/branching.aws.postgres.ai.postman_environment.json b/engine/api/postman/branching.aws.postgres.ai.postman_environment.json
new file mode 100644
index 00000000..407d3d88
--- /dev/null
+++ b/engine/api/postman/branching.aws.postgres.ai.postman_environment.json
@@ -0,0 +1,21 @@
+{
+ "id": "30035c51-5e48-4d31-8676-2aac8af456ee",
+ "name": "branching.aws.postgres.ai",
+ "values": [
+ {
+ "key": "baseUrl",
+ "value": "https://branching.aws.postgres.ai:446/api",
+ "type": "default",
+ "enabled": true
+ },
+ {
+ "key": "verificationToken",
+ "value": "demo-token",
+ "type": "default",
+ "enabled": true
+ }
+ ],
+ "_postman_variable_scope": "environment",
+ "_postman_exported_at": "2023-05-18T04:01:37.154Z",
+ "_postman_exported_using": "Postman/10.14.2-230517-0637"
+}
\ No newline at end of file
diff --git a/engine/api/postman/dblab.postman_collection.json b/engine/api/postman/dblab.postman_collection.json
deleted file mode 100644
index 2c57013d..00000000
--- a/engine/api/postman/dblab.postman_collection.json
+++ /dev/null
@@ -1,431 +0,0 @@
-{
- "variables": [],
- "info": {
- "name": "Database Lab",
- "_postman_id": "d0182a6c-79d0-877f-df91-18dbca63b734",
- "description": "",
- "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json"
- },
- "item": [
- {
- "name": "status",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "var jsonData = JSON.parse(responseBody);",
- "tests[\"Check instance status\"] = responseCode.code === 200 && jsonData && jsonData.status && jsonData.status.code && jsonData.status.code === \"OK\";"
- ]
- }
- }
- ],
- "request": {
- "url": "{{DBLAB_URL}}/status",
- "method": "GET",
- "header": [
- {
- "key": "Verification-Token",
- "value": "{{DBLAB_VERIFY_TOKEN}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": "",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n\t\"dblab_id\": 1\n}"
- },
- "description": "Select users"
- },
- "response": []
- },
- {
- "name": "snapshots",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "var jsonData = JSON.parse(responseBody);",
- "tests[\"Check snapshots list\"] = responseCode.code === 200 && jsonData && Array.isArray(jsonData) && jsonData.length === 1;",
- ""
- ]
- }
- }
- ],
- "request": {
- "url": "{{DBLAB_URL}}/snapshots",
- "method": "GET",
- "header": [
- {
- "key": "Verification-Token",
- "value": "{{DBLAB_VERIFY_TOKEN}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n\t\"dblab_id\": 1\n}"
- },
- "description": "Select users"
- },
- "response": []
- },
- {
- "name": "clone not found",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "var jsonData = JSON.parse(responseBody);",
- "tests[\"Check for clone status\"] = responseCode.code === 404 && jsonData && jsonData.detail && jsonData.detail === \"Requested object does not exist.\";",
- ""
- ]
- }
- }
- ],
- "request": {
- "url": "{{DBLAB_URL}}/clone/bopta26mq8oddsim86v0",
- "method": "GET",
- "header": [
- {
- "key": "Verification-Token",
- "value": "{{DBLAB_VERIFY_TOKEN}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n\t\"dblab_id\": 1\n}"
- },
- "description": "Select users"
- },
- "response": []
- },
- {
- "name": "create clone",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "var jsonData = JSON.parse(responseBody);",
- "tests[\"Check for clone create\"] = responseCode.code === 201 && jsonData && jsonData.id && jsonData.status && ",
- "(jsonData.status.code == 'OK' || jsonData.status.code == 'CREATING');",
- "postman.setGlobalVariable(\"DBLAB_CLONE_ID\", jsonData.id);"
- ]
- }
- }
- ],
- "request": {
- "url": "{{DBLAB_URL}}/clone",
- "method": "POST",
- "header": [
- {
- "key": "Verification-Token",
- "value": "{{DBLAB_VERIFY_TOKEN}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\r\n\t\"name\": \"test-demo-clone\",\r\n\t\"protected\": false,\r\n\t\"db\": {\r\n\t\t\"username\": \"username\",\r\n\t\t\"password\": \"password\"\r\n\t}\r\n}"
- },
- "description": "Select users"
- },
- "response": []
- },
- {
- "name": "clone status",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "var jsonData = JSON.parse(responseBody);",
- "tests[\"Check for clone status\"] = responseCode.code === 200 && jsonData && jsonData.id && jsonData.status && ",
- "(jsonData.status.code == 'OK' || jsonData.status.code == 'CREATING');",
- ""
- ]
- }
- }
- ],
- "request": {
- "url": "{{DBLAB_URL}}/clone/{{DBLAB_CLONE_ID}}",
- "method": "GET",
- "header": [
- {
- "key": "Verification-Token",
- "value": "{{DBLAB_VERIFY_TOKEN}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n\t\"dblab_id\": 1\n}"
- },
- "description": "Select users"
- },
- "response": []
- },
- {
- "name": "clone update (name, protected)",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "tests[\"Check for clone update\"] = responseCode.code === 200;",
- ""
- ]
- }
- }
- ],
- "request": {
- "url": "{{DBLAB_URL}}/clone/{{DBLAB_CLONE_ID}}",
- "method": "PATCH",
- "header": [
- {
- "key": "Verification-Token",
- "value": "{{DBLAB_VERIFY_TOKEN}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": "",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n\t\"protected\": true,\n\t\"name\": \"UPDATE_CLONE_TEST\"\n}"
- },
- "description": "Select users"
- },
- "response": []
- },
- {
- "name": "clone/reset",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "tests[\"Check for clone reset\"] = responseCode.code === 200;",
- ""
- ]
- }
- }
- ],
- "request": {
- "url": "{{DBLAB_URL}}/clone/{{DBLAB_CLONE_ID}}/reset",
- "method": "POST",
- "header": [
- {
- "key": "Verification-Token",
- "value": "{{DBLAB_VERIFY_TOKEN}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": "",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n\t\"id\": \"xxx\"\n}"
- },
- "description": "Select users"
- },
- "response": []
- },
- {
- "name": "delete protected clone",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "var jsonData = JSON.parse(responseBody);",
- "tests[\"Check for delete protected clone\"] = responseCode.code === 500 && jsonData && jsonData.detail && jsonData.detail === \"clone is protected\";",
- ""
- ]
- }
- }
- ],
- "request": {
- "url": "{{DBLAB_URL}}/clone/{{DBLAB_CLONE_ID}}",
- "method": "DELETE",
- "header": [
- {
- "key": "Verification-Token",
- "value": "{{DBLAB_VERIFY_TOKEN}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": ""
- },
- "description": "Select users"
- },
- "response": []
- },
- {
- "name": "clone update (disable protection)",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "tests[\"Check for clone update\"] = responseCode.code === 200;",
- ""
- ]
- }
- }
- ],
- "request": {
- "url": "{{DBLAB_URL}}/clone/{{DBLAB_CLONE_ID}}",
- "method": "PATCH",
- "header": [
- {
- "key": "Verification-Token",
- "value": "{{DBLAB_VERIFY_TOKEN}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": "",
- "disabled": true
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n\t\"protected\": false\n}"
- },
- "description": "Select users"
- },
- "response": []
- },
- {
- "name": "delete clone",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "tests[\"Check for delete protected clone\"] = responseCode.code === 200;",
- ""
- ]
- }
- }
- ],
- "request": {
- "url": "{{DBLAB_URL}}/clone/{{DBLAB_CLONE_ID}}",
- "method": "DELETE",
- "header": [
- {
- "key": "Verification-Token",
- "value": "{{DBLAB_VERIFY_TOKEN}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": ""
- },
- "description": "Select users"
- },
- "response": []
- },
- {
- "name": "removed clone status",
- "event": [
- {
- "listen": "test",
- "script": {
- "type": "text/javascript",
- "exec": [
- "var jsonData = JSON.parse(responseBody);",
- "tests[\"Check for clone status\"] = (responseCode.code === 200 && jsonData && jsonData.id && jsonData.status && ",
- "jsonData.status.code == 'DELETING') || responseCode.code == 404;",
- ""
- ]
- }
- }
- ],
- "request": {
- "url": "{{DBLAB_URL}}/clone/{{DBLAB_CLONE_ID}}",
- "method": "GET",
- "header": [
- {
- "key": "Verification-Token",
- "value": "{{DBLAB_VERIFY_TOKEN}}",
- "description": ""
- },
- {
- "key": "Content-Type",
- "value": "application/json",
- "description": ""
- }
- ],
- "body": {
- "mode": "raw",
- "raw": "{\n\t\"dblab_id\": 1\n}"
- },
- "description": "Select users"
- },
- "response": []
- }
- ]
-}
diff --git a/engine/api/postman/dblab.postman_environment.json b/engine/api/postman/dblab.postman_environment.json
deleted file mode 100644
index 5f7244c9..00000000
--- a/engine/api/postman/dblab.postman_environment.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "id": "ff4200f0-7acd-eb4f-1dee-59da8c98c313",
- "name": "Database Lab",
- "values": [
- {
- "enabled": true,
- "key": "DBLAB_URL",
- "value": "https://url",
- "type": "text"
- },
- {
- "enabled": true,
- "key": "DBLAB_VERIFY_TOKEN",
- "value": "secret_token",
- "type": "text"
- }
- ],
- "timestamp": 1580454458304,
- "_postman_variable_scope": "environment",
- "_postman_exported_at": "2020-01-31T09:42:37.377Z",
- "_postman_exported_using": "Postman/5.5.4"
-}
diff --git a/engine/api/postman/dblab_api.postman_collection.json b/engine/api/postman/dblab_api.postman_collection.json
new file mode 100644
index 00000000..7995382f
--- /dev/null
+++ b/engine/api/postman/dblab_api.postman_collection.json
@@ -0,0 +1,4057 @@
+{
+ "info": {
+ "_postman_id": "ed8af9f0-1cde-4633-8a57-a47e10d12bfa",
+ "name": "DBLab API 4.0.0-beta.2",
+ "description": "This page provides the OpenAPI specification for the Database Lab (DBLab) API, previously recognized as the DLE API (Database Lab Engine API).\n\nContact Support:\n Name: DBLab API Support\n Email: api@postgres.ai",
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
+ "_exporter_id": "34026417"
+ },
+ "item": [
+ {
+ "name": "Instance",
+ "item": [
+ {
+ "name": "DBLab instance status and detailed information",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[GET]::/status - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[GET]::/status - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",
+ "});",
+ "",
+ "// Validate if response has JSON Body ",
+ "pm.test(\"[GET]::/status - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Response Validation",
+ "const schema = {\"type\":\"object\",\"properties\":{\"status\":{\"required\":[\"code\",\"message\"],\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"Status code\"},\"message\":{\"type\":\"string\",\"description\":\"Status description\"}}},\"engine\":{\"type\":\"object\",\"properties\":{\"version\":{\"type\":\"string\"},\"edition\":{\"type\":\"string\"},\"billingActive\":{\"type\":\"string\"},\"instanceID\":{\"type\":\"string\"},\"startedAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"telemetry\":{\"type\":\"boolean\"},\"disableConfigModification\":{\"type\":\"boolean\"}}},\"pools\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"name\":{\"type\":\"string\"},\"mode\":{\"type\":\"string\"},\"dataStateAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"status\":{\"type\":\"string\"},\"cloneList\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"fileSystem\":{\"type\":\"object\",\"properties\":{\"mode\":{\"type\":\"string\"},\"free\":{\"type\":\"integer\",\"format\":\"int64\"},\"size\":{\"type\":\"integer\",\"format\":\"int64\"},\"used\":{\"type\":\"integer\",\"format\":\"int64\"},\"dataSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"usedBySnapshots\":{\"type\":\"integer\",\"format\":\"int64\"},\"usedByClones\":{\"type\":\"integer\",\"format\":\"int64\"},\"compressRatio\":{\"type\":\"integer\",\"format\":\"float64\"}}}}}},\"cloning\":{\"type\":\"object\",\"properties\":{\"expectedCloningTime\":{\"type\":\"integer\",\"format\":\"float64\"},\"numClones\":{\"type\":\"integer\",\"format\":\"int64\"},\"clones\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"},\"snapshot\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"createdAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"dataStateAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"physicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"logicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"pool\":{\"type\":\"string\"},\"numClones\":{\"type\":\"integer\",\"format\":\"int\"}}},\"protected\":{\"type\":\"boolean\",\"default\":false},\"deleteAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"createdAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"status\":{\"required\":[\"code\",\"message\"],\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"Status code\"},\"message\":{\"type\":\"string\",\"description\":\"Status description\"}}},\"db\":{\"type\":\"object\",\"properties\":{\"connStr\":{\"type\":\"string\"},\"host\":{\"type\":\"string\"},\"port\":{\"type\":\"string\"},\"username\":{\"type\":\"string\"},\"password\":{\"type\":\"string\"}}},\"metadata\":{\"type\":\"object\",\"properties\":{\"cloneDiffSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"logicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"cloningTime\":{\"type\":\"integer\",\"format\":\"float64\"},\"maxIdleMinutes\":{\"type\":\"integer\",\"format\":\"int64\"}}}}}}}},\"retrieving\":{\"type\":\"object\",\"properties\":{\"mode\":{\"type\":\"string\"},\"status\":{\"type\":\"string\"},\"lastRefresh\":{\"type\":\"string\",\"format\":\"date-time\"},\"nextRefresh\":{\"type\":\"string\",\"format\":\"date-time\"},\"alerts\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"activity\":{\"type\":\"object\",\"properties\":{\"source\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"},\"query\":{\"type\":\"string\"},\"duration\":{\"type\":\"number\"},\"waitEventType\":{\"type\":\"string\"},\"waitEvent\":{\"type\":\"string\"}}}},\"target\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"},\"query\":{\"type\":\"string\"},\"duration\":{\"type\":\"number\"},\"waitEventType\":{\"type\":\"string\"},\"waitEvent\":{\"type\":\"string\"}}}}}}}},\"provisioner\":{\"type\":\"object\",\"properties\":{\"dockerImage\":{\"type\":\"string\"},\"containerConfig\":{\"type\":\"object\",\"properties\":{}}}},\"synchronization\":{\"type\":\"object\",\"properties\":{\"status\":{\"required\":[\"code\",\"message\"],\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"Status code\"},\"message\":{\"type\":\"string\",\"description\":\"Status description\"}}},\"startedAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"lastReplayedLsn\":{\"type\":\"string\"},\"lastReplayedLsnAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"replicationLag\":{\"type\":\"string\"},\"replicationUptime\":{\"type\":\"integer\"}}}}}",
+ "",
+ "// Validate if response matches JSON schema ",
+ "pm.test(\"[GET]::/status - Schema is valid\", function() {",
+ " pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/status",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "status"
+ ]
+ },
+ "description": "Retrieves detailed information about the DBLab instance: status, version, clones, snapshots, etc."
+ },
+ "response": [
+ {
+ "name": "Returned detailed information about the DBLab instance",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/status",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "status"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"status\": {\n \"code\": \"OK\",\n \"message\": \"Instance is ready\"\n },\n \"engine\": {\n \"version\": \"v4.0.0-alpha.5-20230516-0224\",\n \"edition\": \"standard\",\n \"billingActive\": true,\n \"instanceID\": \"chhfqfcnvrvc73d0lij0\",\n \"startedAt\": \"2023-05-16T03:50:19Z\",\n \"telemetry\": true,\n \"disableConfigModification\": false\n },\n \"pools\": [\n {\n \"name\": \"dblab_pool/dataset_1\",\n \"mode\": \"zfs\",\n \"dataStateAt\": \"\",\n \"status\": \"empty\",\n \"cloneList\": [],\n \"fileSystem\": {\n \"mode\": \"zfs\",\n \"size\": 30685528064,\n \"free\": 30685282816,\n \"used\": 245248,\n \"dataSize\": 12288,\n \"usedBySnapshots\": 0,\n \"usedByClones\": 219648,\n \"compressRatio\": 1\n }\n },\n {\n \"name\": \"dblab_pool/dataset_2\",\n \"mode\": \"zfs\",\n \"dataStateAt\": \"\",\n \"status\": \"empty\",\n \"cloneList\": [],\n \"fileSystem\": {\n \"mode\": \"zfs\",\n \"size\": 30685528064,\n \"free\": 30685282816,\n \"used\": 245248,\n \"dataSize\": 12288,\n \"usedBySnapshots\": 0,\n \"usedByClones\": 219648,\n \"compressRatio\": 1\n }\n },\n {\n \"name\": \"dblab_pool/dataset_3\",\n \"mode\": \"zfs\",\n \"dataStateAt\": \"\",\n \"status\": \"empty\",\n \"cloneList\": [],\n \"fileSystem\": {\n \"mode\": \"zfs\",\n \"size\": 30685528064,\n \"free\": 30685282816,\n \"used\": 245248,\n \"dataSize\": 12288,\n \"usedBySnapshots\": 0,\n \"usedByClones\": 219648,\n \"compressRatio\": 1\n }\n }\n ],\n \"cloning\": {\n \"expectedCloningTime\": 0,\n \"numClones\": 0,\n \"clones\": []\n },\n \"retrieving\": {\n \"mode\": \"logical\",\n \"status\": \"pending\",\n \"lastRefresh\": null,\n \"nextRefresh\": null,\n \"alerts\": {},\n \"activity\": null\n },\n \"provisioner\": {\n \"dockerImage\": \"postgresai/extended-postgres:15\",\n \"containerConfig\": {\n \"shm-size\": \"1gb\"\n }\n },\n \"synchronization\": {\n \"status\": {\n \"code\": \"Not available\",\n \"message\": \"\"\n },\n \"lastReplayedLsn\": \"\",\n \"lastReplayedLsnAt\": \"\",\n \"replicationLag\": 0,\n \"replicationUptime\": 0\n }\n}"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/status",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "status"
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Data refresh status",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[GET]::/instance/retrieval - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[GET]::/instance/retrieval - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",
+ "});",
+ "",
+ "// Validate if response has JSON Body ",
+ "pm.test(\"[GET]::/instance/retrieval - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Response Validation",
+ "const schema = {\"type\":\"object\",\"properties\":{\"mode\":{\"type\":\"string\"},\"status\":{\"type\":\"string\"},\"lastRefresh\":{\"type\":\"string\",\"format\":\"date-time\"},\"nextRefresh\":{\"type\":\"string\",\"format\":\"date-time\"},\"alerts\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"activity\":{\"type\":\"object\",\"properties\":{\"source\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"},\"query\":{\"type\":\"string\"},\"duration\":{\"type\":\"number\"},\"waitEventType\":{\"type\":\"string\"},\"waitEvent\":{\"type\":\"string\"}}}},\"target\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"user\":{\"type\":\"string\"},\"query\":{\"type\":\"string\"},\"duration\":{\"type\":\"number\"},\"waitEventType\":{\"type\":\"string\"},\"waitEvent\":{\"type\":\"string\"}}}}}}}}",
+ "",
+ "// Validate if response matches JSON schema ",
+ "pm.test(\"[GET]::/instance/retrieval - Schema is valid\", function() {",
+ " pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/instance/retrieval",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "instance",
+ "retrieval"
+ ]
+ },
+ "description": "Report a status of the data refresh subsystem (also known as \"data retrieval\"): timestamps of the previous and next refresh runs, status, messages."
+ },
+ "response": [
+ {
+ "name": "Reported a status of the data retrieval subsystem",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/instance/retrieval",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "instance",
+ "retrieval"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"mode\": \"logical\",\n \"status\": \"pending\",\n \"lastRefresh\": null,\n \"nextRefresh\": null,\n \"alerts\": {},\n \"activity\": null\n}"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/instance/retrieval",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "instance",
+ "retrieval"
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Service health check",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "type": "text/javascript",
+ "exec": [
+ "// Validate status 2xx \npm.test(\"[GET]::/healthz - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n",
+ "// Validate if response header has matching content-type\npm.test(\"[GET]::/healthz - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n",
+ "// Validate if response has JSON Body \npm.test(\"[GET]::/healthz - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n",
+ "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"version\":{\"type\":\"string\"},\"edition\":{\"type\":\"string\"},\"billingActive\":{\"type\":\"string\"},\"instanceID\":{\"type\":\"string\"},\"startedAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"telemetry\":{\"type\":\"boolean\"},\"disableConfigModification\":{\"type\":\"boolean\"}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/healthz - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n"
+ ]
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/healthz",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "healthz"
+ ]
+ },
+ "description": "Check the overall health and availability of the API system. This endpoint does not require the 'Verification-Token' header."
+ },
+ "response": [
+ {
+ "name": "Successful operation",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/healthz",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "healthz"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"version\": \"v4.0.0-alpha.5-20230516-0224\",\n \"edition\": \"standard\",\n \"instanceID\": \"chhfqfcnvrvc73d0lij0\"\n}"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Snapshots",
+ "item": [
+ {
+ "name": "List all snapshots",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[GET]::/snapshots - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[GET]::/snapshots - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",
+ "});",
+ "",
+ "// Validate if response has JSON Body ",
+ "pm.test(\"[GET]::/snapshots - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Response Validation",
+ "const schema = {\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"createdAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"dataStateAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"physicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"logicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"pool\":{\"type\":\"string\"},\"numClones\":{\"type\":\"integer\",\"format\":\"int\"}}}}",
+ "",
+ "// Validate if response matches JSON schema ",
+ "pm.test(\"[GET]::/snapshots - Schema is valid\", function() {",
+ " pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/snapshots",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "snapshots"
+ ]
+ },
+ "description": "Return a list of all available snapshots."
+ },
+ "response": [
+ {
+ "name": "Returned a list of snapshots",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/snapshots",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "snapshots"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "[\n {\n \"id\": \"dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711\",\n \"createdAt\": \"2023-05-09T21:27:11Z\",\n \"dataStateAt\": \"2023-05-09T21:27:11Z\",\n \"physicalSize\": 0,\n \"logicalSize\": 11518021632,\n \"pool\": \"dblab_pool/dataset_2\",\n \"numClones\": 1\n },\n {\n \"id\": \"dblab_pool/dataset_2/nik-test-branch/20230307171959@20230307171959\",\n \"createdAt\": \"2023-03-07T17:19:59Z\",\n \"dataStateAt\": \"2023-03-07T17:19:59Z\",\n \"physicalSize\": 151552,\n \"logicalSize\": 11518015488,\n \"pool\": \"dblab_pool/dataset_2\",\n \"numClones\": 1\n }\n]"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/snapshots",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "snapshots"
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Create a snapshot",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[POST]::/branch/snapshot - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::/branch/snapshot - Content-Type is */*\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"*/*\");",
+ "});",
+ ""
+ ],
+ "type": "text/javascript",
+ "packages": {}
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"cloneID\": \"test3\",\n \"message\": \"do\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/branch/snapshot",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ "snapshot"
+ ]
+ },
+ "description": "Create a new snapshot using the specified clone. After a snapshot has been created, the original clone can be deleted in order to free up compute resources, if necessary. The snapshot created by this endpoint can be used later to create one or more new clones."
+ },
+ "response": [
+ {
+ "name": "OK",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"cloneID\": \"aliquip sit nisi\",\n \"message\": \"do\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/branch/snapshot",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ "snapshot"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"snapshotID\": \"voluptate\"\n}"
+ },
+ {
+ "name": "Bad request",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"cloneID\": \"aliquip sit nisi\",\n \"message\": \"do\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/branch/snapshot",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ "snapshot"
+ ]
+ }
+ },
+ "status": "Bad Request",
+ "code": 400,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"incididunt minim nulla\",\n \"message\": \"qui fugiat\",\n \"detail\": \"occaecat\",\n \"hint\": \"anim\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Retrieve a snapshot",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[GET]::/branch/snapshot/:id - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[GET]::/branch/snapshot/:id - Content-Type is */*\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"*/*\");",
+ "});",
+ ""
+ ],
+ "type": "text/javascript",
+ "packages": {}
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/branch/snapshot/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ "snapshot",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": ""
+ }
+ ]
+ },
+ "description": "Retrieves the information for the specified snapshot."
+ },
+ "response": [
+ {
+ "name": "OK",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/branch/snapshot/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ "snapshot",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) ID of the branch snapshot"
+ }
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"id\": \"nostrud exercitation id velit\",\n \"parent\": \"exercitation sunt do anim\",\n \"child\": \"cillum incididunt voluptate veniam\",\n \"branch\": [\n \"cillum\",\n \"Excepteur ut ut occaecat eu\"\n ],\n \"root\": \"mollit culpa enim nostrud\",\n \"dataStateAt\": \"2008-01-19T00:42:22.510Z\",\n \"message\": \"irure qui \"\n}"
+ },
+ {
+ "name": "Bad request",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/branch/snapshot/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ "snapshot",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) ID of the branch snapshot"
+ }
+ ]
+ }
+ },
+ "status": "Bad Request",
+ "code": 400,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"incididunt minim nulla\",\n \"message\": \"qui fugiat\",\n \"detail\": \"occaecat\",\n \"hint\": \"anim\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Delete a snapshot",
+ "request": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) ",
+ "type": "text"
+ },
+ {
+ "key": "Accept",
+ "value": "*/*",
+ "type": "text"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/snapshot/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "snapshot",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "lorem"
+ }
+ ]
+ }
+ },
+ "response": [
+ {
+ "name": "OK",
+ "originalRequest": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "type": "text"
+ },
+ {
+ "key": "Accept",
+ "value": "*/*",
+ "type": "text"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/snapshot/dblab_pool/dataset_3@snapshot_20250324084404",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "snapshot",
+ "dblab_pool",
+ "dataset_3@snapshot_20250324084404"
+ ]
+ }
+ },
+ "_postman_previewlanguage": null,
+ "header": null,
+ "cookie": [],
+ "body": null
+ },
+ {
+ "name": "Bad request",
+ "originalRequest": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "type": "text"
+ },
+ {
+ "key": "Accept",
+ "value": "*/*",
+ "type": "text"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/snapshot/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "snapshot",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": ""
+ }
+ ]
+ }
+ },
+ "_postman_previewlanguage": null,
+ "header": null,
+ "cookie": [],
+ "body": "{\n \"code\": \"incididunt minim nulla\",\n \"message\": \"qui fugiat\"\n}"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Clones",
+ "item": [
+ {
+ "name": "List all clones",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[GET]::/clones - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[GET]::/clones - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",
+ "});",
+ "",
+ "// Validate if response has JSON Body ",
+ "pm.test(\"[GET]::/clones - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Response Validation",
+ "const schema = {\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"},\"snapshot\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"createdAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"dataStateAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"physicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"logicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"pool\":{\"type\":\"string\"},\"numClones\":{\"type\":\"integer\",\"format\":\"int\"}}},\"protected\":{\"type\":\"boolean\",\"default\":false},\"deleteAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"createdAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"status\":{\"required\":[\"code\",\"message\"],\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"Status code\"},\"message\":{\"type\":\"string\",\"description\":\"Status description\"}}},\"db\":{\"type\":\"object\",\"properties\":{\"connStr\":{\"type\":\"string\"},\"host\":{\"type\":\"string\"},\"port\":{\"type\":\"string\"},\"username\":{\"type\":\"string\"},\"password\":{\"type\":\"string\"}}},\"metadata\":{\"type\":\"object\",\"properties\":{\"cloneDiffSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"logicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"cloningTime\":{\"type\":\"integer\",\"format\":\"float64\"},\"maxIdleMinutes\":{\"type\":\"integer\",\"format\":\"int64\"}}}}}}",
+ "",
+ "// Validate if response matches JSON schema ",
+ "pm.test(\"[GET]::/clones - Schema is valid\", function() {",
+ " pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/clones",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clones"
+ ]
+ },
+ "description": "Return a list of all available clones (database endpoints)."
+ },
+ "response": [
+ {
+ "name": "Returned a list of all available clones",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/clones",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clones"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "[\n {\n \"id\": \"test-clone-2\",\n \"snapshot\": {\n \"id\": \"dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711\",\n \"createdAt\": \"2023-05-09T21:27:11Z\",\n \"dataStateAt\": \"2023-05-09T21:27:11Z\",\n \"physicalSize\": 120832,\n \"logicalSize\": 11518021632,\n \"pool\": \"dblab_pool/dataset_2\",\n \"numClones\": 3\n },\n \"branch\": \"\",\n \"protected\": false,\n \"deleteAt\": null,\n \"createdAt\": \"2023-05-16T06:12:52Z\",\n \"status\": {\n \"code\": \"OK\",\n \"message\": \"Clone is ready to accept Postgres connections.\"\n },\n \"db\": {\n \"connStr\": \"host=branching.aws.postgres.ai port=6005 user=tester dbname=postgres\",\n \"host\": \"branching.aws.postgres.ai\",\n \"port\": \"6005\",\n \"username\": \"tester\",\n \"password\": \"\",\n \"dbName\": \"postgres\"\n },\n \"metadata\": {\n \"cloneDiffSize\": 484352,\n \"logicalSize\": 11518029312,\n \"cloningTime\": 1.5250661829999999,\n \"maxIdleMinutes\": 120\n }\n },\n {\n \"id\": \"test-clone\",\n \"snapshot\": {\n \"id\": \"dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711\",\n \"createdAt\": \"2023-05-09T21:27:11Z\",\n \"dataStateAt\": \"2023-05-09T21:27:11Z\",\n \"physicalSize\": 120832,\n \"logicalSize\": 11518021632,\n \"pool\": \"dblab_pool/dataset_2\",\n \"numClones\": 3\n },\n \"branch\": \"\",\n \"protected\": false,\n \"deleteAt\": null,\n \"createdAt\": \"2023-05-16T06:12:30Z\",\n \"status\": {\n \"code\": \"OK\",\n \"message\": \"Clone is ready to accept Postgres connections.\"\n },\n \"db\": {\n \"connStr\": \"host=branching.aws.postgres.ai port=6004 user=tester dbname=postgres\",\n \"host\": \"branching.aws.postgres.ai\",\n \"port\": \"6004\",\n \"username\": \"tester\",\n \"password\": \"\",\n \"dbName\": \"postgres\"\n },\n \"metadata\": {\n \"cloneDiffSize\": 486400,\n \"logicalSize\": 11518030336,\n \"cloningTime\": 1.57552338,\n \"maxIdleMinutes\": 120\n }\n }\n]"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/clones",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clones"
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Create a clone",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[POST]::/clone - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::/clone - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",
+ "});",
+ "",
+ "// Validate if response has JSON Body ",
+ "pm.test(\"[POST]::/clone - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Response Validation",
+ "const schema = {\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"},\"snapshot\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"createdAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"dataStateAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"physicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"logicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"pool\":{\"type\":\"string\"},\"numClones\":{\"type\":\"integer\",\"format\":\"int\"}}},\"protected\":{\"type\":\"boolean\",\"default\":false},\"deleteAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"createdAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"status\":{\"required\":[\"code\",\"message\"],\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"Status code\"},\"message\":{\"type\":\"string\",\"description\":\"Status description\"}}},\"db\":{\"type\":\"object\",\"properties\":{\"connStr\":{\"type\":\"string\"},\"host\":{\"type\":\"string\"},\"port\":{\"type\":\"string\"},\"username\":{\"type\":\"string\"},\"password\":{\"type\":\"string\"}}},\"metadata\":{\"type\":\"object\",\"properties\":{\"cloneDiffSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"logicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"cloningTime\":{\"type\":\"integer\",\"format\":\"float64\"},\"maxIdleMinutes\":{\"type\":\"integer\",\"format\":\"int64\"}}}}}",
+ "",
+ "// Validate if response matches JSON schema ",
+ "pm.test(\"[POST]::/clone - Schema is valid\", function() {",
+ " pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"id\": \"magna cupidatat\",\n \"snapshot\": {\n \"id\": \"veniam\"\n },\n \"branch\": \"incididunt aliquip\",\n \"protected\": null,\n \"db\": {\n \"username\": \"Duis Lorem\",\n \"password\": \"culpa non velit ut\",\n \"restricted\": null,\n \"db_name\": \"dolore qui ut\"\n }\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/clone",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone"
+ ]
+ }
+ },
+ "response": [
+ {
+ "name": "Created a new clone",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"id\": \"magna cupidatat\",\n \"snapshot\": {\n \"id\": \"veniam\"\n },\n \"branch\": \"incididunt aliquip\",\n \"protected\": null,\n \"db\": {\n \"username\": \"Duis Lorem\",\n \"password\": \"culpa non velit ut\",\n \"restricted\": null,\n \"db_name\": \"dolore qui ut\"\n }\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/clone",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone"
+ ]
+ }
+ },
+ "status": "Created",
+ "code": 201,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"id\": \"test-clone-2\",\n \"snapshot\": {\n \"id\": \"dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711\",\n \"createdAt\": \"2023-05-09T21:27:11Z\",\n \"dataStateAt\": \"2023-05-09T21:27:11Z\",\n \"physicalSize\": 120832,\n \"logicalSize\": 11518021632,\n \"pool\": \"dblab_pool/dataset_2\",\n \"numClones\": 3\n },\n \"branch\": \"\",\n \"protected\": false,\n \"deleteAt\": null,\n \"createdAt\": \"2023-05-16T06:12:52Z\",\n \"status\": {\n \"code\": \"CREATING\",\n \"message\": \"Clone is being created.\"\n },\n \"db\": {\n \"connStr\": \"\",\n \"host\": \"\",\n \"port\": \"\",\n \"username\": \"tester\",\n \"password\": \"\",\n \"dbName\": \"postgres\"\n },\n \"metadata\": {\n \"cloneDiffSize\": 0,\n \"logicalSize\": 0,\n \"cloningTime\": 0,\n \"maxIdleMinutes\": 0\n }\n}"
+ },
+ {
+ "name": "Returned an error caused by invalid request",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"id\": \"magna cupidatat\",\n \"snapshot\": {\n \"id\": \"veniam\"\n },\n \"branch\": \"incididunt aliquip\",\n \"protected\": null,\n \"db\": {\n \"username\": \"Duis Lorem\",\n \"password\": \"culpa non velit ut\",\n \"restricted\": null,\n \"db_name\": \"dolore qui ut\"\n }\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/clone",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone"
+ ]
+ }
+ },
+ "status": "Bad Request",
+ "code": 400,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"BAD_REQUEST\",\n \"message\": \"clone with such ID already exists\"\n}"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"id\": \"magna cupidatat\",\n \"snapshot\": {\n \"id\": \"veniam\"\n },\n \"branch\": \"incididunt aliquip\",\n \"protected\": null,\n \"db\": {\n \"username\": \"Duis Lorem\",\n \"password\": \"culpa non velit ut\",\n \"restricted\": null,\n \"db_name\": \"dolore qui ut\"\n }\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/clone",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone"
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Retrieve a clone",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[GET]::/clone/:id - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[GET]::/clone/:id - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",
+ "});",
+ "",
+ "// Validate if response has JSON Body ",
+ "pm.test(\"[GET]::/clone/:id - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Response Validation",
+ "const schema = {\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"},\"snapshot\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"createdAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"dataStateAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"physicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"logicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"pool\":{\"type\":\"string\"},\"numClones\":{\"type\":\"integer\",\"format\":\"int\"}}},\"protected\":{\"type\":\"boolean\",\"default\":false},\"deleteAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"createdAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"status\":{\"required\":[\"code\",\"message\"],\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"Status code\"},\"message\":{\"type\":\"string\",\"description\":\"Status description\"}}},\"db\":{\"type\":\"object\",\"properties\":{\"connStr\":{\"type\":\"string\"},\"host\":{\"type\":\"string\"},\"port\":{\"type\":\"string\"},\"username\":{\"type\":\"string\"},\"password\":{\"type\":\"string\"}}},\"metadata\":{\"type\":\"object\",\"properties\":{\"cloneDiffSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"logicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"cloningTime\":{\"type\":\"integer\",\"format\":\"float64\"},\"maxIdleMinutes\":{\"type\":\"integer\",\"format\":\"int64\"}}}}}",
+ "",
+ "// Validate if response matches JSON schema ",
+ "pm.test(\"[GET]::/clone/:id - Schema is valid\", function() {",
+ " pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ },
+ "description": "Retrieves the information for the specified clone."
+ },
+ "response": [
+ {
+ "name": "Returned detailed information for the specified clone",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"id\": \"test-clone\",\n \"snapshot\": {\n \"id\": \"dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711\",\n \"createdAt\": \"2023-05-09T21:27:11Z\",\n \"dataStateAt\": \"2023-05-09T21:27:11Z\",\n \"physicalSize\": 120832,\n \"logicalSize\": 11518021632,\n \"pool\": \"dblab_pool/dataset_2\",\n \"numClones\": 3\n },\n \"branch\": \"\",\n \"protected\": false,\n \"deleteAt\": null,\n \"createdAt\": \"2023-05-16T06:12:30Z\",\n \"status\": {\n \"code\": \"OK\",\n \"message\": \"Clone is ready to accept Postgres connections.\"\n },\n \"db\": {\n \"connStr\": \"host=branching.aws.postgres.ai port=6004 user=tester dbname=postgres\",\n \"host\": \"branching.aws.postgres.ai\",\n \"port\": \"6004\",\n \"username\": \"tester\",\n \"password\": \"\",\n \"dbName\": \"postgres\"\n },\n \"metadata\": {\n \"cloneDiffSize\": 486400,\n \"logicalSize\": 11518030336,\n \"cloningTime\": 1.57552338,\n \"maxIdleMinutes\": 120\n }\n}"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ },
+ {
+ "name": "Not found",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ }
+ },
+ "status": "Not Found",
+ "code": 404,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"NOT_FOUND\",\n \"message\": \"Requested object does not exist. Specify your request.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Delete a clone",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[DELETE]::/clone/:id - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[DELETE]::/clone/:id - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",
+ "});",
+ "",
+ "// Validate if response has JSON Body ",
+ "pm.test(\"[DELETE]::/clone/:id - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ },
+ "description": "Permanently delete the specified clone. It cannot be undone."
+ },
+ "response": [
+ {
+ "name": "Successfully deleted the specified clone",
+ "originalRequest": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "\"OK\""
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ },
+ {
+ "name": "Not found",
+ "originalRequest": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ }
+ },
+ "status": "Not Found",
+ "code": 404,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"NOT_FOUND\",\n \"message\": \"Requested object does not exist. Specify your request.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Update a clone",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[PATCH]::/clone/:id - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[PATCH]::/clone/:id - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",
+ "});",
+ "",
+ "// Validate if response has JSON Body ",
+ "pm.test(\"[PATCH]::/clone/:id - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Response Validation",
+ "const schema = {\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"name\":{\"type\":\"string\"},\"snapshot\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"createdAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"dataStateAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"physicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"logicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"pool\":{\"type\":\"string\"},\"numClones\":{\"type\":\"integer\",\"format\":\"int\"}}},\"protected\":{\"type\":\"boolean\",\"default\":false},\"deleteAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"createdAt\":{\"type\":\"string\",\"format\":\"date-time\"},\"status\":{\"required\":[\"code\",\"message\"],\"type\":\"object\",\"properties\":{\"code\":{\"type\":\"string\",\"description\":\"Status code\"},\"message\":{\"type\":\"string\",\"description\":\"Status description\"}}},\"db\":{\"type\":\"object\",\"properties\":{\"connStr\":{\"type\":\"string\"},\"host\":{\"type\":\"string\"},\"port\":{\"type\":\"string\"},\"username\":{\"type\":\"string\"},\"password\":{\"type\":\"string\"}}},\"metadata\":{\"type\":\"object\",\"properties\":{\"cloneDiffSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"logicalSize\":{\"type\":\"integer\",\"format\":\"int64\"},\"cloningTime\":{\"type\":\"integer\",\"format\":\"float64\"},\"maxIdleMinutes\":{\"type\":\"integer\",\"format\":\"int64\"}}}}}",
+ "",
+ "// Validate if response matches JSON schema ",
+ "pm.test(\"[PATCH]::/clone/:id - Schema is valid\", function() {",
+ " pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "PATCH",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"protected\": false\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ },
+ "description": "Updates the specified clone by setting the values of the parameters passed. Currently, only one paramater is supported: 'protected'."
+ },
+ "response": [
+ {
+ "name": "Successfully updated the specified clone",
+ "originalRequest": {
+ "method": "PATCH",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"protected\": false\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"id\": \"test-clone-2\",\n \"snapshot\": {\n \"id\": \"dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711\",\n \"createdAt\": \"2023-05-09T21:27:11Z\",\n \"dataStateAt\": \"2023-05-09T21:27:11Z\",\n \"physicalSize\": 120832,\n \"logicalSize\": 11518021632,\n \"pool\": \"dblab_pool/dataset_2\",\n \"numClones\": 2\n },\n \"branch\": \"\",\n \"protected\": true,\n \"deleteAt\": null,\n \"createdAt\": \"2023-05-16T06:12:52Z\",\n \"status\": {\n \"code\": \"OK\",\n \"message\": \"Clone is ready to accept Postgres connections.\"\n },\n \"db\": {\n \"connStr\": \"host=branching.aws.postgres.ai port=6005 user=tester dbname=postgres\",\n \"host\": \"branching.aws.postgres.ai\",\n \"port\": \"6005\",\n \"username\": \"tester\",\n \"password\": \"\",\n \"dbName\": \"postgres\"\n },\n \"metadata\": {\n \"cloneDiffSize\": 561664,\n \"logicalSize\": 11518030336,\n \"cloningTime\": 1.5250661829999999,\n \"maxIdleMinutes\": 120\n }\n}"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "PATCH",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"protected\": false\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Reset a clone",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[POST]::/clone/:id/reset - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::/clone/:id/reset - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",
+ "});",
+ "",
+ "// Validate if response has JSON Body ",
+ "pm.test(\"[POST]::/clone/:id/reset - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"snapshotID\": \"ut nulla Duis in in\",\n \"latest\": false\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id/reset",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id",
+ "reset"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ },
+ "description": "Reset the specified clone to a previously stored state. This can be done by specifying a particular snapshot ID or using the 'latest' flag. All changes made after the snapshot are discarded during the reset, unless those changes were preserved in a snapshot. All database connections will be reset, requiring users and applications to reconnect. The duration of the reset operation is comparable to the creation of a new clone. However, unlike creating a new clone, the reset operation retains the database credentials and does not change the port. Consequently, users and applications can continue to use the same database credentials post-reset, though reconnection will be necessary. Please note that any unsaved changes will be irretrievably lost during this operation, so ensure necessary data is backed up in a snapshot prior to resetting the clone."
+ },
+ "response": [
+ {
+ "name": "Successfully reset the state of the specified clone",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"snapshotID\": \"ut nulla Duis in in\",\n \"latest\": false\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id/reset",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id",
+ "reset"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "\"OK\""
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"snapshotID\": \"ut nulla Duis in in\",\n \"latest\": false\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/clone/:id/reset",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "clone",
+ ":id",
+ "reset"
+ ],
+ "variable": [
+ {
+ "key": "id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ }
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Branches",
+ "item": [
+ {
+ "name": "List all branches",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[GET]::/branches - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[GET]::/branches - Content-Type is */*\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"*/*\");",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/branches",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branches"
+ ]
+ },
+ "description": "Return a list of all available branches (named pointers to snapshots)."
+ },
+ "response": [
+ {
+ "name": "Returned a list of all available branches",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/branches",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branches"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ }
+ ],
+ "cookie": [],
+ "body": "[\n {\n \"name\": \"my-1\",\n \"parent\": \"main\",\n \"dataStateAt\": \"20230224202652\",\n \"snapshotID\": \"dblab_pool/dataset_2/main/20230224202652@20230224202652\"\n },\n {\n \"name\": \"nik-test-branch\",\n \"parent\": \"-\",\n \"dataStateAt\": \"20230509212711\",\n \"snapshotID\": \"dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711\"\n },\n {\n \"name\": \"main\",\n \"parent\": \"-\",\n \"dataStateAt\": \"20230224202652\",\n \"snapshotID\": \"dblab_pool/dataset_2/main/20230224202652@20230224202652\"\n }\n]"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/branches",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branches"
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Create a branch",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[POST]::/branch/create - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::/branch/create - Content-Type is */*\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"*/*\");",
+ "});",
+ ""
+ ],
+ "type": "text/javascript",
+ "packages": {}
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"branchName\": \"aute do laborum\",\n \"baseBranch\": \"tempor aliqua consectetur\",\n \"snapshotID\": \"mollit velit\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/branch",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch"
+ ]
+ }
+ },
+ "response": [
+ {
+ "name": "OK",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"branchName\": \"aute do laborum\",\n \"baseBranch\": \"tempor aliqua consectetur\",\n \"snapshotID\": \"mollit velit\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/branch/create",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ "create"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"name\": \"cillum in laborum\"\n}"
+ },
+ {
+ "name": "Bad request",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"branchName\": \"aute do laborum\",\n \"baseBranch\": \"tempor aliqua consectetur\",\n \"snapshotID\": \"mollit velit\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/branch/create",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ "create"
+ ]
+ }
+ },
+ "status": "Bad Request",
+ "code": 400,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"incididunt minim nulla\",\n \"message\": \"qui fugiat\",\n \"detail\": \"occaecat\",\n \"hint\": \"anim\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Delete a branch",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[POST]::/branch/delete - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::/branch/delete - Content-Type is */*\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"*/*\");",
+ "});",
+ ""
+ ],
+ "type": "text/javascript",
+ "packages": {}
+ }
+ }
+ ],
+ "request": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": ""
+ },
+ "url": {
+ "raw": "{{baseUrl}}/branch/:branchName",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ ":branchName"
+ ],
+ "variable": [
+ {
+ "key": "branchName",
+ "value": ""
+ }
+ ]
+ },
+ "description": "Permanently delete the specified branch. It cannot be undone."
+ },
+ "response": [
+ {
+ "name": "OK",
+ "originalRequest": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"branchName\": \"dolore aliqua laboris offi\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/branch/delete",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ "delete"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"status\": \"irure pariatur Excepteur occaecat ullamco\",\n \"message\": \"in enim tempor\"\n}"
+ },
+ {
+ "name": "Bad request",
+ "originalRequest": {
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"branchName\": \"dolore aliqua laboris offi\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/branch/delete",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ "delete"
+ ]
+ }
+ },
+ "status": "Bad Request",
+ "code": 400,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"incididunt minim nulla\",\n \"message\": \"qui fugiat\",\n \"detail\": \"occaecat\",\n \"hint\": \"anim\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Retrieve a branch log",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[POST]::/branch/log - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::/branch/log - Content-Type is */*\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"*/*\");",
+ "});",
+ ""
+ ],
+ "type": "text/javascript",
+ "packages": {}
+ }
+ }
+ ],
+ "protocolProfileBehavior": {
+ "disableBodyPruning": true
+ },
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"branchName\": \"in exercitation eiusmod voluptate eu\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/branch/:branchName/log",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ ":branchName",
+ "log"
+ ],
+ "variable": [
+ {
+ "key": "branchName",
+ "value": ""
+ }
+ ]
+ },
+ "description": "Retrieve a log of the specified branch (history of snapshots)."
+ },
+ "response": [
+ {
+ "name": "OK",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"branchName\": \"in exercitation eiusmod voluptate eu\"\n}"
+ },
+ "url": {
+ "raw": "{{baseUrl}}/branch/log",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "branch",
+ "log"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ }
+ ],
+ "cookie": [],
+ "body": "[\n {\n \"id\": \"commodo enim\",\n \"parent\": \"laboris anim labore adipisi\",\n \"child\": \"consequat\",\n \"branch\": [\n \"ullamco ad cillum proident\",\n \"ea elit tempor nostrud\"\n ],\n \"root\": \"sunt\",\n \"dataStateAt\": \"2013-09-01T22:20:46.803Z\",\n \"message\": \"et sit\"\n },\n {\n \"id\": \"nisi cillum est deserunt\",\n \"parent\": \"pariatur Lorem\",\n \"child\": \"eu labore do deserunt\",\n \"branch\": [\n \"officia dolor\",\n \"dolor cillum eu culpa ut\"\n ],\n \"root\": \"exercitation aute\",\n \"dataStateAt\": \"1963-05-08T18:09:20.040Z\",\n \"message\": \"est Excepteur mollit nostrud\"\n }\n]"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Admin",
+ "item": [
+ {
+ "name": "Get config",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[GET]::/admin/config - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[GET]::/admin/config - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",
+ "});",
+ "",
+ "// Validate if response has JSON Body ",
+ "pm.test(\"[GET]::/admin/config - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Response Validation",
+ "const schema = {\"type\":\"object\"}",
+ "",
+ "// Validate if response matches JSON schema ",
+ "pm.test(\"[GET]::/admin/config - Schema is valid\", function() {",
+ " pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/admin/config",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "config"
+ ]
+ },
+ "description": "Retrieve the DBLab configuration. All sensitive values are masked. Only limited set of configuration parameters is returned – only those that can be changed via API (unless reconfiguration via API is disabled by admin). The result is provided in JSON format."
+ },
+ "response": [
+ {
+ "name": "Returned configuration",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/admin/config",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "config"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"databaseConfigs\": {\n \"configs\": {\n \"shared_buffers\": \"1GB\",\n \"shared_preload_libraries\": \"pg_stat_statements, pg_stat_kcache, auto_explain, logerrors\"\n }\n },\n \"databaseContainer\": {\n \"dockerImage\": \"registry.gitlab.com/postgres-ai/se-images/supabase:15\"\n },\n \"global\": {\n \"debug\": true\n },\n \"retrieval\": {\n \"refresh\": {\n \"timetable\": \"0 1 * * 0\"\n },\n \"spec\": {\n \"logicalDump\": {\n \"options\": {\n \"customOptions\": [],\n \"databases\": {\n \"test_small\": {}\n },\n \"parallelJobs\": 4,\n \"source\": {\n \"connection\": {\n \"dbname\": \"test_small\",\n \"host\": \"dev1.postgres.ai\",\n \"port\": 6666,\n \"username\": \"john\"\n }\n }\n }\n },\n \"logicalRestore\": {\n \"options\": {\n \"customOptions\": [\n \"--no-tablespaces\",\n \"--no-privileges\",\n \"--no-owner\",\n \"--exit-on-error\"\n ],\n \"parallelJobs\": 4\n }\n }\n }\n }\n}"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/admin/config",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "config"
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Set config",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[POST]::/admin/config - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::/admin/config - Content-Type is application/json\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");",
+ "});",
+ "",
+ "// Validate if response has JSON Body ",
+ "pm.test(\"[POST]::/admin/config - Response has JSON Body\", function () {",
+ " pm.response.to.have.jsonBody();",
+ "});",
+ "",
+ "// Response Validation",
+ "const schema = {\"type\":\"object\"}",
+ "",
+ "// Validate if response matches JSON schema ",
+ "pm.test(\"[POST]::/admin/config - Schema is valid\", function() {",
+ " pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/admin/config",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "config"
+ ]
+ },
+ "description": "Set specific configurations for the DBLab instance using this endpoint. The returned configuration parameters are limited to those that can be modified via the API (unless the API-based reconfiguration has been disabled by an administrator). The result will be provided in JSON format."
+ },
+ "response": [
+ {
+ "name": "Successfully saved configuration parameters",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/admin/config",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "config"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{}"
+ },
+ {
+ "name": "Bad request",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/admin/config",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "config"
+ ]
+ }
+ },
+ "status": "Bad Request",
+ "code": 400,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"BAD_REQUEST\",\n \"message\": \"configuration management via UI/API disabled by admin\"\n}"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/admin/config",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "config"
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Get full config (YAML)",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[GET]::/admin/config.yaml - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[GET]::/admin/config.yaml - Content-Type is application/yaml\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/yaml\");",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/yaml"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/admin/config.yaml",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "config.yaml"
+ ]
+ },
+ "description": "Retrieve the DBLab configuration in YAML format. All sensitive values are masked. This method allows seeing the entire configuration file and can be helpful for reviewing configuration and setting up workflows to automate DBLab provisioning and configuration."
+ },
+ "response": [
+ {
+ "name": "Returned configuration (YAML)",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/yaml"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/admin/config.yaml",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "config.yaml"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "text",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/yaml"
+ }
+ ],
+ "cookie": [],
+ "body": ""
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/admin/config.yaml",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "config.yaml"
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Test source database",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[POST]::/admin/test-db-source - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"host\": \"veniam\",\n \"port\": \"tempor\",\n \"dbname\": \"et tempor in\",\n \"username\": \"minim ir\",\n \"password\": \"nisi ut incididunt in mollit\",\n \"db_list\": [\n \"veniam exercitation dolore\",\n \"do nisi in occaecat\"\n ]\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/admin/test-db-source",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "test-db-source"
+ ]
+ }
+ },
+ "response": [
+ {
+ "name": "Successful operation",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"host\": \"adipisicing dolor\",\n \"port\": \"elit\",\n \"dbname\": \"cupidatat in veniam laborum dolore\",\n \"username\": \"sint\",\n \"password\": \"cillum nisi consectetur\",\n \"db_list\": [\n \"ad quis\",\n \"aliqua nisi\"\n ]\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/admin/test-db-source",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "test-db-source"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "text",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "text/plain"
+ }
+ ],
+ "cookie": [],
+ "body": ""
+ },
+ {
+ "name": "Bad request",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"host\": \"adipisicing dolor\",\n \"port\": \"elit\",\n \"dbname\": \"cupidatat in veniam laborum dolore\",\n \"username\": \"sint\",\n \"password\": \"cillum nisi consectetur\",\n \"db_list\": [\n \"ad quis\",\n \"aliqua nisi\"\n ]\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/admin/test-db-source",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "test-db-source"
+ ]
+ }
+ },
+ "status": "Bad Request",
+ "code": 400,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"BAD_REQUEST\",\n \"message\": \"configuration management via UI/API disabled by admin\"\n}"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"host\": \"adipisicing dolor\",\n \"port\": \"elit\",\n \"dbname\": \"cupidatat in veniam laborum dolore\",\n \"username\": \"sint\",\n \"password\": \"cillum nisi consectetur\",\n \"db_list\": [\n \"ad quis\",\n \"aliqua nisi\"\n ]\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/admin/test-db-source",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "test-db-source"
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Test source database",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "exec": [
+ "// Validate status 2xx ",
+ "pm.test(\"[POST]::/admin/ws-auth - Status code is 2xx\", function () {",
+ " pm.response.to.be.success;",
+ "});",
+ "",
+ "// Validate if response header has matching content-type",
+ "pm.test(\"[POST]::/admin/ws-auth - Content-Type is */*\", function () {",
+ " pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"*/*\");",
+ "});",
+ ""
+ ],
+ "type": "text/javascript"
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "{{verificationToken}}",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/admin/ws-auth",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "ws-auth"
+ ]
+ }
+ },
+ "response": [
+ {
+ "name": "Successful operation",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "*/*"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/admin/ws-auth",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "ws-auth"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "*/*"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"token\": \"velit ut minim\"\n}"
+ },
+ {
+ "name": "Bad request",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/admin/ws-auth",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "ws-auth"
+ ]
+ }
+ },
+ "status": "Bad Request",
+ "code": 400,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"BAD_REQUEST\",\n \"message\": \"configuration management via UI/API disabled by admin\"\n}"
+ },
+ {
+ "name": "Unauthorized access",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/admin/ws-auth",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "admin",
+ "ws-auth"
+ ]
+ }
+ },
+ "status": "Unauthorized",
+ "code": 401,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"UNAUTHORIZED\",\n \"message\": \"Check your verification token.\"\n}"
+ }
+ ]
+ }
+ ]
+ },
+ {
+ "name": "Observation",
+ "item": [
+ {
+ "name": "Start observing",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "type": "text/javascript",
+ "exec": [
+ "// Validate status 2xx \npm.test(\"[POST]::/observation/start - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n",
+ "// Validate if response header has matching content-type\npm.test(\"[POST]::/observation/start - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n",
+ "// Validate if response has JSON Body \npm.test(\"[POST]::/observation/start - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n",
+ "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"session_id\":{\"type\":\"integer\",\"format\":\"int64\"},\"started_at\":{\"type\":\"string\",\"format\":\"date-time\"},\"finished_at\":{\"type\":\"string\",\"format\":\"date-time\"},\"config\":{\"type\":\"object\",\"properties\":{\"observation_interval\":{\"type\":\"integer\",\"format\":\"int64\"},\"max_lock_duration\":{\"type\":\"integer\",\"format\":\"int64\"},\"max_duration\":{\"type\":\"integer\",\"format\":\"int64\"}}},\"tags\":{\"type\":\"object\",\"properties\":{}},\"artifacts\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"result\":{\"type\":\"object\",\"properties\":{\"status\":{\"type\":\"string\"},\"intervals\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"started_at\":{\"type\":\"string\",\"format\":\"date-time\"},\"duration\":{\"type\":\"integer\",\"format\":\"int64\"},\"warning\":{\"type\":\"string\"}}}},\"summary\":{\"type\":\"object\",\"properties\":{\"total_duration\":{\"type\":\"integer\",\"format\":\"float64\"},\"total_intervals\":{\"type\":\"integer\",\"format\":\"int\"},\"warning_intervals\":{\"type\":\"integer\",\"format\":\"int\"},\"checklist\":{\"type\":\"object\",\"properties\":{\"overall_success\":{\"type\":\"boolean\"},\"session_duration_acceptable\":{\"type\":\"boolean\"},\"no_long_dangerous_locks\":{\"type\":\"boolean\"}}}}}}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/observation/start - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n"
+ ]
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"clone_id\": \"ut sit irure\",\n \"config\": {\n \"observation_interval\": 33950905,\n \"max_lock_duration\": 82462220,\n \"max_duration\": 54143470\n },\n \"tags\": {},\n \"db_name\": \"magna esse dolore\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/observation/start",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "start"
+ ]
+ },
+ "description": "[EXPERIMENTAL] Start an observation session for the specified clone. Observation sessions help detect dangerous (long-lasting, exclusive) locks in CI/CD pipelines. One of common scenarios is using observation sessions to test schema changes (DB migrations)."
+ },
+ "response": [
+ {
+ "name": "Successful operation",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"clone_id\": \"ut sit irure\",\n \"config\": {\n \"observation_interval\": 33950905,\n \"max_lock_duration\": 82462220,\n \"max_duration\": 54143470\n },\n \"tags\": {},\n \"db_name\": \"magna esse dolore\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/observation/start",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "start"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"session_id\": -41566390,\n \"started_at\": \"1991-02-14T03:01:06.417Z\",\n \"finished_at\": \"2018-05-30T06:18:09.119Z\",\n \"config\": {\n \"observation_interval\": 76803835,\n \"max_lock_duration\": -6633155,\n \"max_duration\": -968293\n },\n \"tags\": {},\n \"artifacts\": [\n \"aliqua do\",\n \"consectetur amet tempor eiusmod\"\n ],\n \"result\": {\n \"status\": \"qui adipisicing velit aute\",\n \"intervals\": [\n {\n \"started_at\": \"2008-06-20T07:35:49.463Z\",\n \"duration\": 34650553,\n \"warning\": \"velit nulla ex\"\n },\n {\n \"started_at\": \"1994-03-12T02:59:52.189Z\",\n \"duration\": 10020998,\n \"warning\": \"ipsum laborum\"\n }\n ],\n \"summary\": {\n \"total_duration\": -51894451,\n \"total_intervals\": -93757197,\n \"warning_intervals\": 95087393,\n \"checklist\": {\n \"overall_success\": false,\n \"session_duration_acceptable\": true,\n \"no_long_dangerous_locks\": false\n }\n }\n }\n}"
+ },
+ {
+ "name": "Not found",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"clone_id\": \"ut sit irure\",\n \"config\": {\n \"observation_interval\": 33950905,\n \"max_lock_duration\": 82462220,\n \"max_duration\": 54143470\n },\n \"tags\": {},\n \"db_name\": \"magna esse dolore\"\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/observation/start",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "start"
+ ]
+ }
+ },
+ "status": "Not Found",
+ "code": 404,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"NOT_FOUND\",\n \"message\": \"Requested object does not exist. Specify your request.\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Stop observing",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "type": "text/javascript",
+ "exec": [
+ "// Validate status 2xx \npm.test(\"[POST]::/observation/stop - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n",
+ "// Validate if response header has matching content-type\npm.test(\"[POST]::/observation/stop - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n",
+ "// Validate if response has JSON Body \npm.test(\"[POST]::/observation/stop - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n",
+ "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"session_id\":{\"type\":\"integer\",\"format\":\"int64\"},\"started_at\":{\"type\":\"string\",\"format\":\"date-time\"},\"finished_at\":{\"type\":\"string\",\"format\":\"date-time\"},\"config\":{\"type\":\"object\",\"properties\":{\"observation_interval\":{\"type\":\"integer\",\"format\":\"int64\"},\"max_lock_duration\":{\"type\":\"integer\",\"format\":\"int64\"},\"max_duration\":{\"type\":\"integer\",\"format\":\"int64\"}}},\"tags\":{\"type\":\"object\",\"properties\":{}},\"artifacts\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"result\":{\"type\":\"object\",\"properties\":{\"status\":{\"type\":\"string\"},\"intervals\":{\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"started_at\":{\"type\":\"string\",\"format\":\"date-time\"},\"duration\":{\"type\":\"integer\",\"format\":\"int64\"},\"warning\":{\"type\":\"string\"}}}},\"summary\":{\"type\":\"object\",\"properties\":{\"total_duration\":{\"type\":\"integer\",\"format\":\"float64\"},\"total_intervals\":{\"type\":\"integer\",\"format\":\"int\"},\"warning_intervals\":{\"type\":\"integer\",\"format\":\"int\"},\"checklist\":{\"type\":\"object\",\"properties\":{\"overall_success\":{\"type\":\"boolean\"},\"session_duration_acceptable\":{\"type\":\"boolean\"},\"no_long_dangerous_locks\":{\"type\":\"boolean\"}}}}}}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[POST]::/observation/stop - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n"
+ ]
+ }
+ }
+ ],
+ "request": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"clone_id\": \"proident cillum nostrud officia\",\n \"overall_error\": false\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/observation/stop",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "stop"
+ ]
+ },
+ "description": "[EXPERIMENTAL] Stop the previously started observation session."
+ },
+ "response": [
+ {
+ "name": "Successful operation",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"clone_id\": \"proident cillum nostrud officia\",\n \"overall_error\": false\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/observation/stop",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "stop"
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"session_id\": 9614128,\n \"started_at\": \"1993-11-12T01:24:57.933Z\",\n \"finished_at\": \"1953-01-01T04:06:59.652Z\",\n \"config\": {\n \"observation_interval\": -46635741,\n \"max_lock_duration\": -53938384,\n \"max_duration\": 85779944\n },\n \"tags\": {},\n \"artifacts\": [\n \"deseru\",\n \"in ullamco veniam\"\n ],\n \"result\": {\n \"status\": \"ut ea l\",\n \"intervals\": [\n {\n \"started_at\": \"1943-07-24T05:03:49.697Z\",\n \"duration\": -45788381,\n \"warning\": \"Ut qui occaecat\"\n },\n {\n \"started_at\": \"1973-02-08T19:49:36.906Z\",\n \"duration\": 78310177,\n \"warning\": \"dolore amet mollit velit\"\n }\n ],\n \"summary\": {\n \"total_duration\": 89098265,\n \"total_intervals\": -25796081,\n \"warning_intervals\": -74609996,\n \"checklist\": {\n \"overall_success\": false,\n \"session_duration_acceptable\": true,\n \"no_long_dangerous_locks\": false\n }\n }\n }\n}"
+ },
+ {
+ "name": "Bad request",
+ "originalRequest": {
+ "method": "POST",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"clone_id\": \"proident cillum nostrud officia\",\n \"overall_error\": false\n}",
+ "options": {
+ "raw": {
+ "language": "json"
+ }
+ }
+ },
+ "url": {
+ "raw": "{{baseUrl}}/observation/stop",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "stop"
+ ]
+ }
+ },
+ "status": "Bad Request",
+ "code": 400,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"incididunt minim nulla\",\n \"message\": \"qui fugiat\",\n \"detail\": \"occaecat\",\n \"hint\": \"anim\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Get observation summary",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "type": "text/javascript",
+ "exec": [
+ "// Validate status 2xx \npm.test(\"[GET]::/observation/summary/:clone_id/:session_id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n",
+ "// Validate if response header has matching content-type\npm.test(\"[GET]::/observation/summary/:clone_id/:session_id - Content-Type is application/json\", function () {\n pm.expect(pm.response.headers.get(\"Content-Type\")).to.include(\"application/json\");\n});\n",
+ "// Validate if response has JSON Body \npm.test(\"[GET]::/observation/summary/:clone_id/:session_id - Response has JSON Body\", function () {\n pm.response.to.have.jsonBody();\n});\n",
+ "// Response Validation\nconst schema = {\"type\":\"object\",\"properties\":{\"session_id\":{\"type\":\"integer\",\"format\":\"int64\"},\"clone_id\":{\"type\":\"string\"},\"duration\":{\"type\":\"object\",\"properties\":{}},\"db_size\":{\"type\":\"object\",\"properties\":{}},\"locks\":{\"type\":\"object\",\"properties\":{}},\"log_errors\":{\"type\":\"object\",\"properties\":{}},\"artifact_types\":{\"type\":\"array\",\"items\":{\"type\":\"string\"}}}}\n\n// Validate if response matches JSON schema \npm.test(\"[GET]::/observation/summary/:clone_id/:session_id - Schema is valid\", function() {\n pm.response.to.have.jsonSchema(schema,{unknownFormats: [\"int32\", \"int64\", \"float\", \"double\"]});\n});\n"
+ ]
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/observation/summary/:clone_id/:session_id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "summary",
+ ":clone_id",
+ ":session_id"
+ ],
+ "variable": [
+ {
+ "key": "clone_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ },
+ {
+ "key": "session_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Session ID"
+ }
+ ]
+ },
+ "description": "[EXPERIMENTAL] Collect the observation summary info."
+ },
+ "response": [
+ {
+ "name": "Successful operation",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/observation/summary/:clone_id/:session_id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "summary",
+ ":clone_id",
+ ":session_id"
+ ],
+ "variable": [
+ {
+ "key": "clone_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ },
+ {
+ "key": "session_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Session ID"
+ }
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"session_id\": 55155718,\n \"clone_id\": \"cupidatat laborum consequat Lorem officia\",\n \"duration\": {},\n \"db_size\": {},\n \"locks\": {},\n \"log_errors\": {},\n \"artifact_types\": [\n \"laboris anim Ut enim\",\n \"ullamco in esse nostrud Exc\"\n ]\n}"
+ },
+ {
+ "name": "Bad request",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/observation/summary/:clone_id/:session_id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "summary",
+ ":clone_id",
+ ":session_id"
+ ],
+ "variable": [
+ {
+ "key": "clone_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ },
+ {
+ "key": "session_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Session ID"
+ }
+ ]
+ }
+ },
+ "status": "Bad Request",
+ "code": 400,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"incididunt minim nulla\",\n \"message\": \"qui fugiat\",\n \"detail\": \"occaecat\",\n \"hint\": \"anim\"\n}"
+ }
+ ]
+ },
+ {
+ "name": "Download an observation artifact",
+ "event": [
+ {
+ "listen": "test",
+ "script": {
+ "type": "text/javascript",
+ "exec": [
+ "// Validate status 2xx \npm.test(\"[GET]::/observation/download/:artifact_type/:clone_id/:session_id - Status code is 2xx\", function () {\n pm.response.to.be.success;\n});\n"
+ ]
+ }
+ }
+ ],
+ "request": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/observation/download/:artifact_type/:clone_id/:session_id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "download",
+ ":artifact_type",
+ ":clone_id",
+ ":session_id"
+ ],
+ "variable": [
+ {
+ "key": "artifact_type",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Type of the requested artifact"
+ },
+ {
+ "key": "clone_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ },
+ {
+ "key": "session_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Session ID"
+ }
+ ]
+ },
+ "description": "[EXPERIMENTAL] Download an artifact for the specified clone and observation session."
+ },
+ "response": [
+ {
+ "name": "Successful operation",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/observation/download/:artifact_type/:clone_id/:session_id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "download",
+ ":artifact_type",
+ ":clone_id",
+ ":session_id"
+ ],
+ "variable": [
+ {
+ "key": "artifact_type",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Type of the requested artifact"
+ },
+ {
+ "key": "clone_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ },
+ {
+ "key": "session_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Session ID"
+ }
+ ]
+ }
+ },
+ "status": "OK",
+ "code": 200,
+ "_postman_previewlanguage": "text",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "text/plain"
+ }
+ ],
+ "cookie": [],
+ "body": ""
+ },
+ {
+ "name": "Bad request",
+ "originalRequest": {
+ "method": "GET",
+ "header": [
+ {
+ "key": "Verification-Token",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) "
+ },
+ {
+ "key": "Accept",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "{{baseUrl}}/observation/download/:artifact_type/:clone_id/:session_id",
+ "host": [
+ "{{baseUrl}}"
+ ],
+ "path": [
+ "observation",
+ "download",
+ ":artifact_type",
+ ":clone_id",
+ ":session_id"
+ ],
+ "variable": [
+ {
+ "key": "artifact_type",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Type of the requested artifact"
+ },
+ {
+ "key": "clone_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Clone ID"
+ },
+ {
+ "key": "session_id",
+ "value": "Ut magna qui deserunt",
+ "description": "(Required) Session ID"
+ }
+ ]
+ }
+ },
+ "status": "Bad Request",
+ "code": 400,
+ "_postman_previewlanguage": "json",
+ "header": [
+ {
+ "key": "Content-Type",
+ "value": "application/json"
+ }
+ ],
+ "cookie": [],
+ "body": "{\n \"code\": \"incididunt minim nulla\",\n \"message\": \"qui fugiat\",\n \"detail\": \"occaecat\",\n \"hint\": \"anim\"\n}"
+ }
+ ]
+ }
+ ]
+ }
+ ],
+ "variable": [
+ {
+ "key": "baseUrl",
+ "value": "https://branching.aws.postgres.ai:446/api",
+ "type": "string"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/engine/api/postman/portman-cli.json b/engine/api/postman/portman-cli.json
new file mode 100644
index 00000000..89b27ed2
--- /dev/null
+++ b/engine/api/postman/portman-cli.json
@@ -0,0 +1,10 @@
+{
+ "baseUrL": "http://branching.aws.postgres.ai:446/api",
+ "verificationToken": "demo-token",
+ "local": "engine/api/swagger-spec/dblab_openapi.yaml",
+ "output": "engine/api/postman/output.json",
+ "envFile": "engine/api/postman/portman.env",
+ "includeTests": true,
+ "syncPostman": true,
+ "runNewman": false
+}
diff --git a/engine/api/swagger-spec/dblab_openapi.yaml b/engine/api/swagger-spec/dblab_openapi.yaml
new file mode 100644
index 00000000..a1d7b208
--- /dev/null
+++ b/engine/api/swagger-spec/dblab_openapi.yaml
@@ -0,0 +1,1919 @@
+# OpenAPI spec for DBLab API
+# Useful links:
+# - validate and test: https://editor.swagger.io/
+# - official reference location for this API: https://dblab.readme.io/
+# - GitHub (give us a ⭐️): https://github.com/postgres-ai/database-lab-engine
+
+openapi: 3.0.1
+info:
+ title: DBLab API
+ description: This page provides the OpenAPI specification for the Database Lab (DBLab)
+ API, previously recognized as the DLE API (Database Lab Engine API).
+ contact:
+ name: DBLab API Support
+ url: https://postgres.ai/contact
+ email: api@postgres.ai
+ license:
+ name: Apache 2.0
+ url: https://github.com/postgres-ai/database-lab-engine/blob/dle-4-0/LICENSE
+ version: 4.0.0
+externalDocs:
+ description: DBLab Docs
+ url: https://gitlab.com/postgres-ai/docs/tree/master/docs/database-lab
+
+servers:
+ - url: "https://demo.dblab.dev/api"
+ description: "DBLab 4.0 demo server (with DB branching support); token: 'demo-token'"
+ x-examples:
+ Verification-Token: "demo-token"
+ - url: "https://demo.aws.postgres.ai:446/api"
+ description: "DBLab 3.x demo server; token: 'demo-token'"
+ x-examples:
+ Verification-Token: "demo-token"
+ - url: "{scheme}://{host}:{port}/{basePath}"
+ description: "Any DBLab accessed locally / through SSH port forwarding"
+ variables:
+ scheme:
+ enum:
+ - "https"
+ - "http"
+ default: "http"
+ description: "'http' for local connections and SSH port forwarding;
+ 'https' for everything else."
+ host:
+ default: "localhost"
+ description: "where DBLab server is installed. Use 'localhost' to work locally
+ or when SSH port forwarding is used."
+ port:
+ default: "2346"
+ description: "Port to access DBLab UI or API. Originally, '2345' is used for
+ direct work with API and '2346' – with UI. However, with UI, API is also available,
+ at ':2346/api'."
+ basePath:
+ default: "api"
+ description: "basePath value to access API. Use empty when working with API port
+ (2345 by default), or '/api' when working with UI port ('2346' by default)."
+ x-examples:
+ Verification-Token: "custom_example_token"
+
+tags:
+- name: DBLab
+ description: "DBLab API Reference – database branching, instant cloning, and more.
+ DBLab CLI and UI rely on DBLab API."
+ externalDocs:
+ description: "DBLab Docs - tutorials, howtos, references."
+ url: https://postgres.ai/docs/reference-guides/database-lab-engine-api-reference
+
+paths:
+ /status:
+ get:
+ tags:
+ - Instance
+ summary: DBLab instance status and detailed information
+ description: "Retrieves detailed information about the DBLab instance: status, version,
+ clones, snapshots, etc."
+ operationId: status
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Returned detailed information about the DBLab instance
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Instance'
+ example:
+ status:
+ code: OK
+ message: Instance is ready
+ engine:
+ version: v4.0.0-alpha.5-20230516-0224
+ edition: standard
+ billingActive: true
+ instanceID: chhfqfcnvrvc73d0lij0
+ startedAt: '2023-05-16T03:50:19Z'
+ telemetry: true
+ disableConfigModification: false
+ pools:
+ - name: dblab_pool/dataset_1
+ mode: zfs
+ dataStateAt: ''
+ status: empty
+ cloneList: []
+ fileSystem:
+ mode: zfs
+ size: 30685528064
+ free: 30685282816
+ used: 245248
+ dataSize: 12288
+ usedBySnapshots: 0
+ usedByClones: 219648
+ compressRatio: 1
+ - name: dblab_pool/dataset_2
+ mode: zfs
+ dataStateAt: ''
+ status: empty
+ cloneList: []
+ fileSystem:
+ mode: zfs
+ size: 30685528064
+ free: 30685282816
+ used: 245248
+ dataSize: 12288
+ usedBySnapshots: 0
+ usedByClones: 219648
+ compressRatio: 1
+ - name: dblab_pool/dataset_3
+ mode: zfs
+ dataStateAt: ''
+ status: empty
+ cloneList: []
+ fileSystem:
+ mode: zfs
+ size: 30685528064
+ free: 30685282816
+ used: 245248
+ dataSize: 12288
+ usedBySnapshots: 0
+ usedByClones: 219648
+ compressRatio: 1
+ cloning:
+ expectedCloningTime: 0
+ numClones: 0
+ clones: []
+ retrieving:
+ mode: logical
+ status: pending
+ lastRefresh:
+ nextRefresh:
+ alerts: {}
+ activity:
+ provisioner:
+ dockerImage: postgresai/extended-postgres:15
+ containerConfig:
+ shm-size: 1gb
+ synchronization:
+ status:
+ code: Not available
+ message: ''
+ lastReplayedLsn: ''
+ lastReplayedLsnAt: ''
+ replicationLag: 0
+ replicationUptime: 0
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ /snapshots:
+ get:
+ tags:
+ - Snapshots
+ summary: List all snapshots
+ description: Return a list of all available snapshots.
+ operationId: snapshots
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: branch
+ in: query
+ required: false
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Returned a list of snapshots
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Snapshot'
+ example:
+ - id: dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711
+ createdAt: '2023-05-09T21:27:11Z'
+ dataStateAt: '2023-05-09T21:27:11Z'
+ physicalSize: 0
+ logicalSize: 11518021632
+ pool: dblab_pool/dataset_2
+ numClones: 1
+ - id: dblab_pool/dataset_2/nik-test-branch/20230307171959@20230307171959
+ createdAt: '2023-03-07T17:19:59Z'
+ dataStateAt: '2023-03-07T17:19:59Z'
+ physicalSize: 151552
+ logicalSize: 11518015488
+ pool: dblab_pool/dataset_2
+ numClones: 1
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ /full-refresh:
+ post:
+ tags:
+ - Instance
+ summary: Trigger full data refresh
+ description: "Initiates a full data refresh."
+ operationId: refresh
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Full refresh has been initiated
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/FullRefresh'
+ example:
+ status: OK
+ message: Full refresh started
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ /snapshot:
+ post:
+ tags:
+ - Snapshots
+ summary: Create a snapshot
+ description: "Create a new snapshot from the current state of the selected pool.
+ This snapshot can later be used to create clones or new branches."
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: "Optional parameters for snapshot creation.
+ If no pool name is provided, the first available pool is used."
+ content:
+ '*/*':
+ schema:
+ type: object
+ properties:
+ poolName:
+ type: string
+ description: Name of the pool to create snapshot in.
+ required: false
+ responses:
+ 200:
+ description: OK
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/Snapshot'
+ 400:
+ description: Bad request
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/Error'
+ x-codegen-request-body-name: body
+ /snapshot/{id}:
+ delete:
+ tags:
+ - Snapshots
+ summary: Delete a snapshot
+ description: "Permanently delete the specified snapshot.
+ If the snapshot has dependent clones or datasets, `force=true` can be provided as a query parameter."
+ parameters:
+ - name: id
+ in: path
+ required: true
+ description: The ID of the snapshot to delete.
+ schema:
+ type: string
+ pattern: '.*'
+ - name: force
+ in: query
+ required: false
+ description: Force deletion even if dependent clones or datasets exist.
+ schema:
+ type: boolean
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: OK
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/ResponseStatus'
+ 400:
+ description: Bad request
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/Error'
+ /clones:
+ get:
+ tags:
+ - Clones
+ summary: List all clones
+ description: Return a list of all available clones (database endpoints).
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Returned a list of all available clones
+ content:
+ application/json:
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Clone'
+ example:
+ - id: test-clone-2
+ snapshot:
+ id: dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711
+ createdAt: '2023-05-09T21:27:11Z'
+ dataStateAt: '2023-05-09T21:27:11Z'
+ physicalSize: 120832
+ logicalSize: 11518021632
+ pool: dblab_pool/dataset_2
+ numClones: 3
+ branch: ''
+ protected: false
+ deleteAt:
+ createdAt: '2023-05-16T06:12:52Z'
+ status:
+ code: OK
+ message: Clone is ready to accept Postgres connections.
+ db:
+ connStr: host=branching.aws.postgres.ai port=6005 user=tester dbname=postgres
+ host: branching.aws.postgres.ai
+ port: '6005'
+ username: tester
+ password: ''
+ dbName: postgres
+ metadata:
+ cloneDiffSize: 484352
+ logicalSize: 11518029312
+ cloningTime: 1.5250661829999999
+ maxIdleMinutes: 120
+ - id: test-clone
+ snapshot:
+ id: dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711
+ createdAt: '2023-05-09T21:27:11Z'
+ dataStateAt: '2023-05-09T21:27:11Z'
+ physicalSize: 120832
+ logicalSize: 11518021632
+ pool: dblab_pool/dataset_2
+ numClones: 3
+ branch: ''
+ protected: false
+ deleteAt:
+ createdAt: '2023-05-16T06:12:30Z'
+ status:
+ code: OK
+ message: Clone is ready to accept Postgres connections.
+ db:
+ connStr: host=branching.aws.postgres.ai port=6004 user=tester dbname=postgres
+ host: branching.aws.postgres.ai
+ port: '6004'
+ username: tester
+ password: ''
+ dbName: postgres
+ metadata:
+ cloneDiffSize: 486400
+ logicalSize: 11518030336
+ cloningTime: 1.57552338
+ maxIdleMinutes: 120
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ /clone:
+ post:
+ tags:
+ - Clones
+ summary: Create a clone
+ operationId: createClone
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: Clone object
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateClone'
+ required: true
+ responses:
+ 201:
+ description: Created a new clone
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Clone'
+ example:
+ id: test-clone-2
+ snapshot:
+ id: dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711
+ createdAt: '2023-05-09T21:27:11Z'
+ dataStateAt: '2023-05-09T21:27:11Z'
+ physicalSize: 120832
+ logicalSize: 11518021632
+ pool: dblab_pool/dataset_2
+ numClones: 3
+ branch: ''
+ protected: false
+ deleteAt:
+ createdAt: '2023-05-16T06:12:52Z'
+ status:
+ code: CREATING
+ message: Clone is being created.
+ db:
+ connStr: ''
+ host: ''
+ port: ''
+ username: tester
+ password: ''
+ dbName: postgres
+ metadata:
+ cloneDiffSize: 0
+ logicalSize: 0
+ cloningTime: 0
+ maxIdleMinutes: 0
+ 400:
+ description: Returned an error caused by invalid request
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "BAD_REQUEST"
+ message: "clone with such ID already exists"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ x-codegen-request-body-name: body
+ /clone/{id}:
+ get:
+ tags:
+ - Clones
+ summary: Retrieve a clone
+ description: Retrieves the information for the specified clone.
+ operationId: getClone
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: id
+ in: path
+ description: Clone ID
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Returned detailed information for the specified clone
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Clone'
+ example:
+ id: test-clone
+ snapshot:
+ id: dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711
+ createdAt: '2023-05-09T21:27:11Z'
+ dataStateAt: '2023-05-09T21:27:11Z'
+ physicalSize: 120832
+ logicalSize: 11518021632
+ pool: dblab_pool/dataset_2
+ numClones: 3
+ branch: ''
+ protected: false
+ deleteAt:
+ createdAt: '2023-05-16T06:12:30Z'
+ status:
+ code: OK
+ message: Clone is ready to accept Postgres connections.
+ db:
+ connStr: host=branching.aws.postgres.ai port=6004 user=tester dbname=postgres
+ host: branching.aws.postgres.ai
+ port: '6004'
+ username: tester
+ password: ''
+ dbName: postgres
+ metadata:
+ cloneDiffSize: 486400
+ logicalSize: 11518030336
+ cloningTime: 1.57552338
+ maxIdleMinutes: 120
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ 404:
+ description: Not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: NOT_FOUND
+ message: Requested object does not exist. Specify your request.
+ delete:
+ tags:
+ - Clones
+ summary: Delete a clone
+ description: Permanently delete the specified clone. It cannot be undone.
+ operationId: deleteClone
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: id
+ in: path
+ description: Clone ID
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Successfully deleted the specified clone
+ content:
+ application/json:
+ example:
+ "OK"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ 404:
+ description: Not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: NOT_FOUND
+ message: Requested object does not exist. Specify your request.
+ patch:
+ tags:
+ - Clones
+ summary: Update a clone
+ description: "Updates the specified clone by setting the values of the parameters passed.
+ Currently, only one paramater is supported: 'protected'."
+ operationId: updateClone
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: id
+ in: path
+ description: Clone ID
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: Clone object
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateClone'
+ required: true
+ responses:
+ 200:
+ description: Successfully updated the specified clone
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Clone'
+ example:
+ id: test-clone-2
+ snapshot:
+ id: dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711
+ createdAt: '2023-05-09T21:27:11Z'
+ dataStateAt: '2023-05-09T21:27:11Z'
+ physicalSize: 120832
+ logicalSize: 11518021632
+ pool: dblab_pool/dataset_2
+ numClones: 2
+ branch: ''
+ protected: true
+ deleteAt:
+ createdAt: '2023-05-16T06:12:52Z'
+ status:
+ code: OK
+ message: Clone is ready to accept Postgres connections.
+ db:
+ connStr: host=branching.aws.postgres.ai port=6005 user=tester dbname=postgres
+ host: branching.aws.postgres.ai
+ port: '6005'
+ username: tester
+ password: ''
+ dbName: postgres
+ metadata:
+ cloneDiffSize: 561664
+ logicalSize: 11518030336
+ cloningTime: 1.5250661829999999
+ maxIdleMinutes: 120
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ #404: # TODO: fix it in engine (currently returns 500)
+ # description: Not found
+ # content:
+ # application/json:
+ # schema:
+ # $ref: '#/components/schemas/Error'
+ # example:
+ # code: NOT_FOUND
+ # message: Requested object does not exist. Specify your request.
+ x-codegen-request-body-name: body
+ /clone/{id}/reset:
+ post:
+ tags:
+ - Clones
+ summary: Reset a clone
+ description: "Reset the specified clone to a previously stored state.
+ This can be done by specifying a particular snapshot ID or using the 'latest' flag.
+ All changes made after the snapshot are discarded during the reset, unless those
+ changes were preserved in a snapshot. All database connections will be reset,
+ requiring users and applications to reconnect. The duration of the reset operation
+ is comparable to the creation of a new clone. However, unlike creating a new clone,
+ the reset operation retains the database credentials and does not change the port.
+ Consequently, users and applications can continue to use the same database credentials
+ post-reset, though reconnection will be necessary. Please note that any unsaved changes
+ will be irretrievably lost during this operation, so ensure necessary data is backed up
+ in a snapshot prior to resetting the clone."
+ operationId: resetClone
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: id
+ in: path
+ description: Clone ID
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: Reset object
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ResetClone'
+ required: false
+ responses:
+ 200:
+ description: Successfully reset the state of the specified clone
+ content:
+ application/json:
+ example:
+ "OK"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ #404: # TODO: fix it in engine (currently returns 500)
+ # description: Not found
+ # content:
+ # application/json:
+ # schema:
+ # $ref: '#/components/schemas/Error'
+ x-codegen-request-body-name: body
+ /branches:
+ get:
+ tags:
+ - Branches
+ summary: List all branches
+ description: Return a list of all available branches (named pointers to snapshots).
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Returned a list of all available branches
+ content:
+ '*/*':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/Branch'
+ example:
+ - name: my-1
+ parent: main
+ dataStateAt: '20230224202652'
+ snapshotID: dblab_pool/dataset_2/main/20230224202652@20230224202652
+ - name: nik-test-branch
+ parent: "-"
+ dataStateAt: '20230509212711'
+ snapshotID: dblab_pool/dataset_2/nik-test-branch/20230509212711@20230509212711
+ - name: main
+ parent: "-"
+ dataStateAt: '20230224202652'
+ snapshotID: dblab_pool/dataset_2/main/20230224202652@20230224202652
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ /branch/snapshot/{id}:
+ get:
+ tags:
+ - Snapshots
+ summary: Retrieve a snapshot
+ description: Retrieves the information for the specified snapshot.
+ parameters:
+ - name: id
+ in: path
+ description: ID of the branch snapshot
+ required: true
+ schema:
+ type: string
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: OK
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/SnapshotDetails'
+ 400:
+ description: Bad request
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/Error'
+ /branch:
+ post:
+ tags:
+ - Branches
+ summary: Create a branch
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ requestBody:
+ content:
+ '*/*':
+ schema:
+ type: object
+ properties:
+ branchName:
+ type: string
+ description: The name of the new branch.
+ baseBranch:
+ type: string
+ description: "The name of parent branch user to create a new branch.
+ Must not be specified if 'snapshotID' is specified."
+ snapshotID:
+ type: string
+ description: "The ID of the snapshot used to create a new branch.
+ Must not be specified if 'baseBranch' is specified."
+ required: true
+ responses:
+ 200:
+ description: OK
+ content:
+ '*/*':
+ schema:
+ type: object
+ properties:
+ name:
+ type: string
+ 400:
+ description: Bad request
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/Error'
+ x-codegen-request-body-name: body
+ /branch/snapshot:
+ post:
+ tags:
+ - Snapshots
+ summary: Create a snapshot
+ description: "Create a new snapshot using the specified clone. After a snapshot
+ has been created, the original clone can be deleted in order to free up compute resources, if necessary.
+ The snapshot created by this endpoint can be used later to create one or more new clones."
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: "Parameters necessary for snapshot creation: 'cloneID' – the
+ ID of the clone, 'message' – description of the snapshot"
+ content:
+ '*/*':
+ schema:
+ type: object
+ properties:
+ cloneID:
+ type: string
+ message:
+ type: string
+ required: true
+ responses:
+ 200:
+ description: OK
+ content:
+ '*/*':
+ schema:
+ type: object
+ properties:
+ snapshotID:
+ type: string
+ 400:
+ description: Bad request
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/Error'
+ x-codegen-request-body-name: body
+ /branch/{branchName}:
+ delete:
+ tags:
+ - Branches
+ summary: Delete a branch
+ description: "Permanently delete the specified branch. It cannot be undone."
+ parameters:
+ - name: branchName
+ in: path
+ required: true
+ schema:
+ type: string
+ description: "The name of the branch to be deleted."
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: OK
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/ResponseStatus'
+ 400:
+ description: Bad request
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/Error'
+ x-codegen-request-body-name: body
+ /branch/{branchName}/log:
+ get:
+ tags:
+ - Branches
+ summary: Retrieve a branch log
+ description: Retrieve a log of the specified branch (history of snapshots).
+ parameters:
+ - name: branchName
+ in: path
+ required: true
+ schema:
+ type: string
+ description: The name of the branch.
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: OK
+ content:
+ '*/*':
+ schema:
+ type: array
+ items:
+ $ref: '#/components/schemas/SnapshotDetails'
+ x-codegen-request-body-name: body
+ /instance/retrieval:
+ get:
+ tags:
+ - Instance
+ summary: Data refresh status
+ description: 'Report a status of the data refresh subsystem (also known as
+ "data retrieval"): timestamps of the previous and next refresh runs, status, messages.'
+ operationId: instanceRetrieval
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Reported a status of the data retrieval subsystem
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Retrieving'
+ example:
+ mode: logical
+ status: pending
+ lastRefresh:
+ nextRefresh:
+ alerts: {}
+ activity:
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Instance'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ /healthz:
+ get:
+ tags:
+ - Instance
+ summary: Service health check
+ description: "Check the overall health and availability of the API system.
+ This endpoint does not require the 'Verification-Token' header."
+ operationId: healthz
+ responses:
+ 200:
+ description: Successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Engine'
+ example:
+ version: "v4.0.0-alpha.5-20230516-0224"
+ edition: "standard"
+ instanceID: "chhfqfcnvrvc73d0lij0"
+ /admin/config:
+ get:
+ tags:
+ - Admin
+ summary: Get config
+ description: "Retrieve the DBLab configuration. All sensitive values are masked.
+ Only limited set of configuration parameters is returned – only those that can be
+ changed via API (unless reconfiguration via API is disabled by admin). The result
+ is provided in JSON format."
+ operationId: getConfig
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Returned configuration
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Config'
+ example:
+ databaseConfigs:
+ configs:
+ shared_buffers: 1GB
+ shared_preload_libraries: pg_stat_statements, pg_stat_kcache, auto_explain, logerrors
+ databaseContainer:
+ dockerImage: registry.gitlab.com/postgres-ai/se-images/supabase:15
+ global:
+ debug: true
+ retrieval:
+ refresh:
+ timetable: 0 1 * * 0
+ spec:
+ logicalDump:
+ options:
+ customOptions: []
+ databases:
+ test_small: {}
+ parallelJobs: 4
+ source:
+ connection:
+ dbname: test_small
+ host: dev1.postgres.ai
+ port: 6666
+ username: john
+ logicalRestore:
+ options:
+ customOptions:
+ - "--no-tablespaces"
+ - "--no-privileges"
+ - "--no-owner"
+ - "--exit-on-error"
+ parallelJobs: 4
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Instance'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ post:
+ tags:
+ - Admin
+ summary: Set config
+ description: "Set specific configurations for the DBLab instance using this endpoint.
+ The returned configuration parameters are limited to those that can be modified
+ via the API (unless the API-based reconfiguration has been disabled by an administrator).
+ The result will be provided in JSON format."
+ operationId: setConfig
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: Set configuration object
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Config'
+ required: true
+ responses:
+ 200:
+ description: Successfully saved configuration parameters
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Config'
+ 400:
+ description: Bad request
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: BAD_REQUEST
+ message: configuration management via UI/API disabled by admin
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Instance'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ x-codegen-request-body-name: body
+ /admin/config.yaml:
+ get:
+ tags:
+ - Admin
+ summary: Get full config (YAML)
+ description: "Retrieve the DBLab configuration in YAML format. All sensitive values are masked.
+ This method allows seeing the entire configuration file and can be helpful for
+ reviewing configuration and setting up workflows to automate DBLab provisioning
+ and configuration."
+ operationId: getConfigYaml
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: "Returned configuration (YAML)"
+ content:
+ application/yaml:
+ schema:
+ $ref: '#/components/schemas/Config'
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Instance'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ /admin/test-db-source:
+ post:
+ tags:
+ - Admin
+ summary: Test source database
+ operationId: testDBConnection1
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: Connection DB object
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Connection'
+ required: true
+ responses:
+ 200:
+ description: Successful operation
+ content: {}
+ 400:
+ description: Bad request
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: BAD_REQUEST
+ message: configuration management via UI/API disabled by admin
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Instance'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ x-codegen-request-body-name: body
+ /admin/ws-auth:
+ post:
+ tags:
+ - Admin
+ summary: Test source database
+ operationId: testDBConnection2
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Successful operation
+ content:
+ '*/*':
+ schema:
+ $ref: '#/components/schemas/WSToken'
+ 400:
+ description: Bad request
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: BAD_REQUEST
+ message: configuration management via UI/API disabled by admin
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Instance'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ /observation/start:
+ post:
+ tags:
+ - Observation
+ summary: Start observing
+ description: "[EXPERIMENTAL] Start an observation session for the specified clone.
+ Observation sessions help detect dangerous (long-lasting, exclusive) locks in CI/CD pipelines.
+ One of common scenarios is using observation sessions to test schema changes (DB migrations)."
+ operationId: startObservation
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: Start observation object
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/StartObservationRequest'
+ required: true
+ responses:
+ 200:
+ description: Successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ObservationSession'
+ 404:
+ description: Not found
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: NOT_FOUND
+ message: Requested object does not exist. Specify your request.
+ x-codegen-request-body-name: body
+ /observation/stop:
+ post:
+ tags:
+ - Observation
+ summary: Stop observing
+ description: "[EXPERIMENTAL] Stop the previously started observation session."
+ operationId: stopObservation
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ requestBody:
+ description: Stop observation object
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/StopObservationRequest'
+ required: true
+ responses:
+ 200:
+ description: Successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ObservationSession'
+ 400:
+ description: Bad request
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ x-codegen-request-body-name: body
+ /observation/summary/{clone_id}/{session_id}:
+ get:
+ tags:
+ - Observation
+ summary: Get observation summary
+ description: "[EXPERIMENTAL] Collect the observation summary info."
+ operationId: summaryObservation
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: clone_id
+ in: path
+ description: Clone ID
+ required: true
+ schema:
+ type: string
+ - name: session_id
+ in: path
+ description: Session ID
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Successful operation
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ObservationSummaryArtifact'
+ 400:
+ description: Bad request
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ /observation/download:
+ get:
+ tags:
+ - Observation
+ summary: Download an observation artifact
+ description: "[EXPERIMENTAL] Download an artifact for the specified clone and observation session."
+ operationId: downloadObservationArtifact
+ parameters:
+ - name: Verification-Token
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: artifact_type
+ in: query
+ description: Type of the requested artifact
+ required: true
+ schema:
+ type: string
+ - name: clone_id
+ in: query
+ description: Clone ID
+ required: true
+ schema:
+ type: string
+ - name: session_id
+ in: query
+ description: Session ID
+ required: true
+ schema:
+ type: string
+ responses:
+ 200:
+ description: Successful operation
+ content: {}
+ 400:
+ description: Bad request
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+
+components:
+ schemas:
+ Instance:
+ type: object
+ properties:
+ status:
+ $ref: '#/components/schemas/Status'
+ engine:
+ $ref: '#/components/schemas/Engine'
+ pools:
+ type: array
+ items:
+ $ref: '#/components/schemas/PoolEntry'
+ cloning:
+ $ref: '#/components/schemas/Cloning'
+ retrieving:
+ $ref: '#/components/schemas/Retrieving'
+ provisioner:
+ $ref: '#/components/schemas/Provisioner'
+ synchronization:
+ $ref: '#/components/schemas/Synchronization'
+ Status:
+ required:
+ - code
+ - message
+ type: object
+ properties:
+ code:
+ type: string
+ description: Status code
+ message:
+ type: string
+ description: Status description
+ Engine:
+ type: object
+ properties:
+ version:
+ type: string
+ edition:
+ type: string
+ billingActive:
+ type: string
+ instanceID:
+ type: string
+ startedAt:
+ type: string
+ format: date-time
+ telemetry:
+ type: boolean
+ disableConfigModification:
+ type: boolean
+ PoolEntry:
+ type: object
+ properties:
+ name:
+ type: string
+ mode:
+ type: string
+ dataStateAt:
+ type: string
+ format: date-time
+ status:
+ type: string
+ cloneList:
+ type: array
+ items:
+ type: string
+ fileSystem:
+ $ref: '#/components/schemas/FileSystem'
+ FileSystem:
+ type: object
+ properties:
+ mode:
+ type: string
+ free:
+ type: integer
+ format: int64
+ size:
+ type: integer
+ format: int64
+ used:
+ type: integer
+ format: int64
+ dataSize:
+ type: integer
+ format: int64
+ usedBySnapshots:
+ type: integer
+ format: int64
+ usedByClones:
+ type: integer
+ format: int64
+ compressRatio:
+ type: integer
+ format: float64
+ Cloning:
+ type: object
+ properties:
+ expectedCloningTime:
+ type: integer
+ format: float64
+ numClones:
+ type: integer
+ format: int64
+ clones:
+ type: array
+ items:
+ $ref: '#/components/schemas/Clone'
+ Retrieving:
+ type: object
+ properties:
+ mode:
+ type: string
+ status:
+ type: string
+ lastRefresh:
+ type: string
+ format: date-time
+ nextRefresh:
+ type: string
+ format: date-time
+ alerts:
+ type: array
+ items:
+ type: string
+ activity:
+ $ref: '#/components/schemas/Activity'
+ Activity:
+ type: object
+ properties:
+ source:
+ type: array
+ items:
+ $ref: '#/components/schemas/PGActivityEvent'
+ target:
+ type: array
+ items:
+ $ref: '#/components/schemas/PGActivityEvent'
+ PGActivityEvent:
+ type: object
+ properties:
+ user:
+ type: string
+ query:
+ type: string
+ duration:
+ type: number
+ waitEventType:
+ type: string
+ waitEvent:
+ type: string
+ Provisioner:
+ type: object
+ properties:
+ dockerImage:
+ type: string
+ containerConfig:
+ type: object
+ properties: {}
+ Synchronization:
+ type: object
+ properties:
+ status:
+ $ref: '#/components/schemas/Status'
+ startedAt:
+ type: string
+ format: date-time
+ lastReplayedLsn:
+ type: string
+ lastReplayedLsnAt:
+ type: string
+ format: date-time
+ replicationLag:
+ type: string
+ replicationUptime:
+ type: integer
+ Snapshot:
+ type: object
+ properties:
+ id:
+ type: string
+ createdAt:
+ type: string
+ format: date-time
+ dataStateAt:
+ type: string
+ format: date-time
+ physicalSize:
+ type: integer
+ format: int64
+ logicalSize:
+ type: integer
+ format: int64
+ pool:
+ type: string
+ numClones:
+ type: integer
+ format: int
+ Database:
+ type: object
+ properties:
+ connStr:
+ type: string
+ host:
+ type: string
+ port:
+ type: string
+ username:
+ type: string
+ password:
+ type: string
+ Clone:
+ type: object
+ properties:
+ id:
+ type: string
+ name:
+ type: string
+ snapshot:
+ $ref: '#/components/schemas/Snapshot'
+ protected:
+ type: boolean
+ default: false
+ deleteAt:
+ type: string
+ format: date-time
+ createdAt:
+ type: string
+ format: date-time
+ status:
+ $ref: '#/components/schemas/Status'
+ db:
+ $ref: '#/components/schemas/Database'
+ metadata:
+ $ref: '#/components/schemas/CloneMetadata'
+ CloneMetadata:
+ type: object
+ properties:
+ cloneDiffSize:
+ type: integer
+ format: int64
+ logicalSize:
+ type: integer
+ format: int64
+ cloningTime:
+ type: integer
+ format: float64
+ maxIdleMinutes:
+ type: integer
+ format: int64
+ CreateClone:
+ type: object
+ properties:
+ id:
+ type: string
+ snapshot:
+ type: object
+ properties:
+ id:
+ type: string
+ branch:
+ type: string
+ protected:
+ type: boolean
+ default:
+ db:
+ type: object
+ properties:
+ username:
+ type: string
+ password:
+ type: string
+ restricted:
+ type: boolean
+ default:
+ db_name:
+ type: string
+ ResetClone:
+ type: object
+ properties:
+ snapshotID:
+ type: string
+ latest:
+ type: boolean
+ default: false
+ description: "Define what snapshot needs to be used when resetting the clone.
+ 'snapshotID' allows specifying the exact snapshot, while 'latest' allows using
+ the latest snapshot among all available snapshots. The latter method can be
+ helpful when the exact snapshot ID is not known."
+ UpdateClone:
+ type: object
+ properties:
+ protected:
+ type: boolean
+ default: false
+ StartObservationRequest:
+ type: object
+ properties:
+ clone_id:
+ type: string
+ config:
+ $ref: '#/components/schemas/ObservationConfig'
+ tags:
+ type: object
+ properties: {}
+ db_name:
+ type: string
+ ObservationConfig:
+ type: object
+ properties:
+ observation_interval:
+ type: integer
+ format: int64
+ max_lock_duration:
+ type: integer
+ format: int64
+ max_duration:
+ type: integer
+ format: int64
+ ObservationSession:
+ type: object
+ properties:
+ session_id:
+ type: integer
+ format: int64
+ started_at:
+ type: string
+ format: date-time
+ finished_at:
+ type: string
+ format: date-time
+ config:
+ $ref: '#/components/schemas/ObservationConfig'
+ tags:
+ type: object
+ properties: {}
+ artifacts:
+ type: array
+ items:
+ type: string
+ result:
+ $ref: '#/components/schemas/ObservationResult'
+ ObservationResult:
+ type: object
+ properties:
+ status:
+ type: string
+ intervals:
+ type: array
+ items:
+ $ref: '#/components/schemas/ObservationInterval'
+ summary:
+ $ref: '#/components/schemas/ObservationSummary'
+ ObservationInterval:
+ type: object
+ properties:
+ started_at:
+ type: string
+ format: date-time
+ duration:
+ type: integer
+ format: int64
+ warning:
+ type: string
+ ObservationSummary:
+ type: object
+ properties:
+ total_duration:
+ type: integer
+ format: float64
+ total_intervals:
+ type: integer
+ format: int
+ warning_intervals:
+ type: integer
+ format: int
+ checklist:
+ $ref: '#/components/schemas/ObservationChecklist'
+ ObservationChecklist:
+ type: object
+ properties:
+ overall_success:
+ type: boolean
+ session_duration_acceptable:
+ type: boolean
+ no_long_dangerous_locks:
+ type: boolean
+ StopObservationRequest:
+ type: object
+ properties:
+ clone_id:
+ type: string
+ overall_error:
+ type: boolean
+ SummaryObservationRequest:
+ type: object
+ properties:
+ clone_id:
+ type: string
+ session_id:
+ type: string
+ ObservationSummaryArtifact:
+ type: object
+ properties:
+ session_id:
+ type: integer
+ format: int64
+ clone_id:
+ type: string
+ duration:
+ type: object
+ properties: {}
+ db_size:
+ type: object
+ properties: {}
+ locks:
+ type: object
+ properties: {}
+ log_errors:
+ type: object
+ properties: {}
+ artifact_types:
+ type: array
+ items:
+ type: string
+ Error:
+ type: object
+ properties:
+ code:
+ type: string
+ message:
+ type: string
+ detail:
+ type: string
+ hint:
+ type: string
+ ResponseStatus:
+ type: object
+ properties:
+ status:
+ type: string
+ message:
+ type: string
+ Config:
+ type: object
+ Connection:
+ type: object
+ properties:
+ host:
+ type: string
+ port:
+ type: string
+ dbname:
+ type: string
+ username:
+ type: string
+ password:
+ type: string
+ db_list:
+ type: array
+ items:
+ type: string
+ WSToken:
+ type: object
+ properties:
+ token:
+ type: string
+ description: WebSocket token
+ Branch:
+ type: object
+ properties:
+ name:
+ type: string
+ parent:
+ type: string
+ dataStateAt:
+ type: string
+ format: date-time
+ snapshotID:
+ type: string
+ SnapshotDetails:
+ type: object
+ properties:
+ id:
+ type: string
+ parent:
+ type: string
+ child:
+ type: string
+ branch:
+ type: array
+ items:
+ type: string
+ root:
+ type: string
+ dataStateAt:
+ type: string
+ format: date-time
+ message:
+ type: string
+ FullRefresh:
+ type: object
+ properties:
+ status:
+ type: string
+ example: OK
+ message:
+ type: string
+ example: Full refresh started
diff --git a/engine/api/swagger-spec/dblab_server_swagger.yaml b/engine/api/swagger-spec/dblab_server_swagger.yaml
index ef02d701..8d44307a 100644
--- a/engine/api/swagger-spec/dblab_server_swagger.yaml
+++ b/engine/api/swagger-spec/dblab_server_swagger.yaml
@@ -1,883 +1,1353 @@
-swagger: "2.0"
+# OpenAPI spec for DBLab API
+# Useful links:
+# - validate and test: https://editor.swagger.io/
+# - GitHub (give us a ⭐️): https://github.com/postgres-ai/database-lab-engine
+
+openapi: 3.0.1
info:
- description: "This is a Database Lab Engine sample server."
- version: "2.5.0"
- title: "Database Lab"
+ title: DBLab API
+ description: This page provides the OpenAPI specification for the Database Lab (DBLab)
+ API, previously recognized as the DBLab API (Database Lab Engine API).
contact:
- email: "team@postgres.ai"
+ name: DBLab API Support
+ url: https://postgres.ai/contact
+ email: api@postgres.ai
license:
- name: "Database Lab License"
- url: "https://gitlab.com/postgres-ai/database-lab/blob/master/LICENSE"
-basePath: "/"
+ name: AGPL v3 / Database Lab License
+ url: https://github.com/postgres-ai/database-lab-engine/blob/master/LICENSE
+ version: 3.5.0
+externalDocs:
+ description: DBLab Docs
+ url: https://gitlab.com/postgres-ai/docs/tree/master/docs/database-lab
+
+servers:
+ - url: "https://demo.dblab.dev/api"
+ description: "DBLab demo server; token: 'demo-token'"
+ x-examples:
+ Verification-Token: "demo-token"
+ - url: "{scheme}://{host}:{port}/{basePath}"
+ description: "Any DBLab accessed locally / through SSH port forwarding"
+ variables:
+ scheme:
+ enum:
+ - "https"
+ - "http"
+ default: "http"
+ description: "'http' for local connections and SSH port forwarding;
+ 'https' for everything else."
+ host:
+ default: "127.0.0.1"
+ description: "Where DBLab server is installed. Use '127.0.0.1' to work locally
+ or when SSH port forwarding is used."
+ port:
+ default: "2345"
+ description: "Port to access DLE UI or API. Originally, '2345' is used for
+ direct work with API and '2346' – with UI. However, with UI, API is also available,
+ at ':2346/api'."
+ basePath:
+ default: ""
+ description: "'basePath' value to access API. Use empty when working with API port
+ (2345 by default), or '/api' when working with UI port ('2346' by default)."
+ x-examples:
+ Verification-Token: "custom_example_token"
+
tags:
- - name: "Database Lab Engine"
- description: "API Reference"
+ - name: "DBLab"
+ description: "DBLab API Reference"
externalDocs:
- description: "Database Lab Engine Docs"
+ description: "DBLab Docs - tutorials, howtos, references."
url: "https://postgres.ai/docs/database-lab"
-schemes:
- - "https"
- - "http"
paths:
/status:
get:
tags:
- - "instance"
- summary: "Get the status of the instance we are working with"
- description: ""
- operationId: "getInstanceStatus"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Instance
+ summary: "DBLab instance status, instance info, and list of clones"
+ description: "Retrieves detailed information about the DBLab instance:
+ status, version, etc. Additionally retrieves a list of all available clones."
+ operationId: getInstanceStatus
parameters:
- in: header
name: Verification-Token
- type: string
required: true
+ schema:
+ type: string
responses:
200:
- description: "Successful operation"
- schema:
- $ref: "#/definitions/Instance"
- 500:
- description: "Internal server error"
- schema:
- $ref: "#/definitions/Error"
+ description: Returned a list of snapshots.
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Instance"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
/snapshots:
get:
tags:
- - "instance"
- summary: "Get the list of snapshots"
- description: ""
- operationId: "getSnapshots"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Snapshots
+ summary: List all snapshots
+ description: Return a list of all available snapshots.
+ operationId: snapshots
parameters:
- in: header
name: Verification-Token
- type: string
+ schema:
+ type: string
required: true
responses:
200:
description: "Successful operation"
- schema:
- type: "array"
- items:
- $ref: "#/definitions/Snapshot"
- 500:
- description: "Internal server error"
- schema:
- $ref: "#/definitions/Error"
+ content:
+ application/json:
+ schema:
+ type: "array"
+ items:
+ $ref: "#/components/schemas/Snapshot"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
/clone:
post:
tags:
- - "clone"
- summary: "Create a clone"
- description: ""
- operationId: "createClone"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Clones
+ summary: Create a clone
+ operationId: createClone
parameters:
- in: header
name: Verification-Token
- type: string
- required: true
- - in: body
- name: body
- description: "Clone object"
- required: true
schema:
- $ref: '#/definitions/CreateClone'
+ type: string
+ required: true
+ requestBody:
+ description: "Clone object"
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/CreateClone'
responses:
201:
- description: "Successful operation"
- schema:
- $ref: "#/definitions/Clone"
+ description: Created a new clone
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Clone"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
404:
description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- 500:
- description: "Internal server error"
- schema:
- $ref: "#/definitions/Error"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
/clone/{id}:
get:
tags:
- - "clone"
- summary: "Get a clone status"
- description: ""
- operationId: "getClone"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Clones
+ summary: Retrieve a clone
+ description: Retrieves the information for the specified clone.
+ operationId: clones
parameters:
- in: header
name: Verification-Token
- type: string
+ schema:
+ type: string
required: true
- in: path
required: true
name: "id"
- type: "string"
+ schema:
+ type: "string"
description: "Clone ID"
responses:
200:
- description: "Successful operation"
- schema:
- $ref: "#/definitions/Clone"
+ description: Returned detailed information for the specified clone
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Clone"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
404:
description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- 500:
- description: "Internal server error"
- schema:
- $ref: "#/definitions/Error"
-
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
patch:
tags:
- - "clone"
- summary: "Update a clone"
- description: ""
- operationId: "patchClone"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Clones
+ summary: Update a clone
+ description: "Updates the specified clone by setting the values of the parameters passed.
+ Currently, only one paramater is supported: 'protected'."
+ operationId: patchClone
parameters:
- in: header
name: Verification-Token
- type: string
+ schema:
+ type: string
required: true
- in: path
required: true
name: "id"
- type: "string"
- description: "Clone ID"
- - in: body
- name: body
- description: "Clone object"
- required: true
schema:
- $ref: '#/definitions/UpdateClone'
+ type: "string"
+ description: "Clone ID"
+ requestBody:
+ description: "Clone object"
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/UpdateClone'
responses:
200:
- description: "Successful operation"
- schema:
- $ref: "#/definitions/Clone"
- 404:
- description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- 500:
- description: "Internal server error"
- schema:
- $ref: "#/definitions/Error"
+ description: Successfully updated the specified clone
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Clone"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ #404: # TODO: fix it in engine (currently returns 500)
+ # description: Not found
+ # content:
+ # application/json:
+ # schema:
+ # $ref: '#/components/schemas/Error'
+ # example:
+ # code: NOT_FOUND
+ # message: Requested object does not exist. Specify your request.
delete:
tags:
- - "clone"
- summary: "Delete a clone"
- description: ""
- operationId: "destroyClone"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Clones
+ summary: Delete a clone
+ description: Permanently delete the specified clone. It cannot be undone.
+ operationId: destroyClone
parameters:
- in: header
name: Verification-Token
- type: string
+ schema:
+ type: string
required: true
- in: path
required: true
name: "id"
- type: "string"
+ schema:
+ type: "string"
description: "Clone ID"
responses:
+ 200:
+ description: Successfully deleted the specified clone
+ content:
+ application/json:
+ example:
+ "OK"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
404:
description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- 500:
- description: "Internal server error"
- schema:
- $ref: "#/definitions/Error"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
/clone/{id}/reset:
post:
tags:
- - "clone"
- summary: "Reset a clone"
- description: ""
- operationId: "resetClone"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Clones
+ summary: Reset a clone
+ description: "Reset the specified clone to a previously stored state.
+ This can be done by specifying a particular snapshot ID or using the 'latest' flag.
+ All changes made after the snapshot are discarded during the reset, unless those
+ changes were preserved in a snapshot. All database connections will be reset,
+ requiring users and applications to reconnect. The duration of the reset operation
+ is comparable to the creation of a new clone. However, unlike creating a new clone,
+ the reset operation retains the database credentials and does not change the port.
+ Consequently, users and applications can continue to use the same database credentials
+ post-reset, though reconnection will be necessary. Please note that any unsaved changes
+ will be irretrievably lost during this operation, so ensure necessary data is backed up
+ in a snapshot prior to resetting the clone."
+ operationId: resetClone
parameters:
- in: header
name: Verification-Token
- type: string
+ schema:
+ type: string
required: true
- in: path
required: true
name: "id"
- type: "string"
- description: "Clone ID"
- - in: body
- name: body
- description: "Reset object"
- required: false
schema:
- $ref: '#/definitions/ResetClone'
+ type: "string"
+ description: "Clone ID"
+ requestBody:
+ description: "Reset object"
+ required: false
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/ResetClone'
responses:
+ 200:
+ description: Successfully reset the state of the specified clone
+ content:
+ application/json:
+ example:
+ "OK"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
404:
description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- 500:
- description: "Internal server error"
- schema:
- $ref: "#/definitions/Error"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
/observation/start:
post:
tags:
- - "observation"
- summary: "Start an observation session"
- description: ""
- operationId: "startObservation"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Observation
+ summary: Start observing
+ description: "[EXPERIMENTAL] Start an observation session for the specified clone.
+ Observation sessions help detect dangerous (long-lasting, exclusive) locks in CI/CD pipelines.
+ One of common scenarios is using observation sessions to test schema changes (DB migrations)."
+ operationId: startObservation
parameters:
- in: header
name: Verification-Token
- type: string
+ schema:
+ type: string
required: true
- - in: body
- name: body
+ requestBody:
description: "Start observation object"
required: true
- schema:
- $ref: '#/definitions/StartObservationRequest'
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/StartObservationRequest'
responses:
200:
- description: "Successful operation"
- schema:
- $ref: "#/definitions/ObservationSession"
+ description: Observation started
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ObservationSession"
400:
description: "Bad request"
- schema:
- $ref: "#/definitions/Error"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
404:
description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- 500:
- description: "Internal server error"
- schema:
- $ref: "#/definitions/Error"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
/observation/stop:
post:
tags:
- - "observation"
- summary: "Stop the observation session"
- description: ""
- operationId: "stopObservation"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Observation
+ summary: Stop observing
+ description: "[EXPERIMENTAL] Stop the previously started observation session."
+ operationId: stopObservation
parameters:
- in: header
name: Verification-Token
- type: string
- required: true
- - in: body
- name: body
- description: "Stop observation object"
- required: true
schema:
- $ref: '#/definitions/StopObservationRequest'
+ type: string
+ required: true
+ requestBody:
+ description: Stop observation object
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/StopObservationRequest'
+ required: true
responses:
200:
- description: "Successful operation"
- schema:
- $ref: "#/definitions/ObservationSession"
+ description: Observation stopped
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ObservationSession"
400:
description: "Bad request"
- schema:
- $ref: "#/definitions/Error"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
404:
description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- 500:
- description: "Internal server error"
- schema:
- $ref: "#/definitions/Error"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
/observation/summary/{clone_id}/{session_id}:
get:
tags:
- - "observation"
- summary: "Get the observation summary info"
- description: ""
- operationId: "summaryObservation"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Observation
+ summary: Get observation summary
+ description: "[EXPERIMENTAL] Collect the observation summary info."
+ operationId: summaryObservation
parameters:
- in: header
name: Verification-Token
- type: string
+ schema:
+ type: string
required: true
- in: path
required: true
name: "clone_id"
- type: "string"
+ schema:
+ type: "string"
description: "Clone ID"
- in: path
required: true
name: "session_id"
- type: "string"
+ schema:
+ type: "string"
description: "Session ID"
responses:
200:
- description: "Successful operation"
- schema:
- $ref: "#/definitions/ObservationSummaryArtifact"
+ description: Observation summary collected
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/ObservationSummaryArtifact"
400:
description: "Bad request"
- schema:
- $ref: "#/definitions/Error"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
404:
description: "Not found"
- schema:
- $ref: "#/definitions/Error"
- 500:
- description: "Internal server error"
- schema:
- $ref: "#/definitions/Error"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
/observation/download:
get:
tags:
- - "observation"
- summary: "Download the observation artifact"
- description: ""
- operationId: "downloadObservationArtifact"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Observation
+ summary: Download an observation artifact
+ description: "[EXPERIMENTAL] Download an artifact for the specified clone and observation session."
+ operationId: downloadObservationArtifact
parameters:
- in: header
name: Verification-Token
- type: string
+ schema:
+ type: string
required: true
- - in: path
+ - in: query
required: true
name: "artifact_type"
- type: "string"
+ schema:
+ type: "string"
description: "Type of the requested artifact"
- - in: path
+ - in: query
required: true
name: "clone_id"
- type: "string"
+ schema:
+ type: "string"
description: "Clone ID"
- - in: path
+ - in: query
required: true
name: "session_id"
- type: "string"
+ schema:
+ type: "string"
description: "Session ID"
responses:
200:
- description: "Successful operation"
+ description: Downloaded the specified artifact of the specified
+ observation session and clone
400:
description: "Bad request"
- schema:
- $ref: "#/definitions/Error"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
404:
description: "Not found"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+
+ /instance/retrieval:
+ get:
+ tags:
+ - Instance
+ summary: Data refresh status
+ description: 'Report a status of the data refresh subsystem (also known as
+ "data retrieval"): timestamps of the previous and next refresh runs, status, messages.'
+ operationId: instanceRetrieval
+ parameters:
+ - in: header
+ name: Verification-Token
schema:
- $ref: "#/definitions/Error"
+ type: string
+ required: true
+ responses:
+ 200:
+ description: Reported a status of the data retrieval subsystem
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Retrieving"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
- /estimate:
+ /healthz:
get:
tags:
- - "observation"
- summary: "Run clone estimator"
- description: ""
- operationId: "runEstimator"
- consumes:
- - "application/json"
- produces:
- - "application/json"
+ - Instance
+ summary: Service health check
+ description: "Check the overall health and availability of the API system.
+ This endpoint does not require the 'Verification-Token' header."
+ operationId: healthCheck
parameters:
- in: header
name: Verification-Token
- type: string
+ schema:
+ type: string
required: true
- - in: path
+ responses:
+ 200:
+ description: Returned general health status
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Engine"
+
+ /admin/config:
+ get:
+ tags:
+ - Admin
+ summary: Get config
+ description: "Retrieve the DBLab configuration. All sensitive values are masked.
+ Only limited set of configuration parameters is returned – only those that can be
+ changed via API (unless reconfiguration via API is disabled by admin). The result
+ is provided in JSON format."
+ operationId: getConfig
+ parameters:
+ - in: header
+ name: Verification-Token
+ schema:
+ type: string
required: true
- name: "clone_id"
- type: "string"
- description: "Clone ID"
- - in: path
+ responses:
+ 200:
+ description: "Successful operation"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Config"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ post:
+ tags:
+ - Admin
+ summary: Set config
+ description: "Set specific configurations for the DBLab instance using this endpoint.
+ The returned configuration parameters are limited to those that can be modified
+ via the API (unless the API-based reconfiguration has been disabled by an administrator).
+ The result will be provided in JSON format."
+ operationId: setConfig
+ parameters:
+ - in: header
+ name: Verification-Token
+ schema:
+ type: string
required: true
- name: "pid"
- type: "string"
- description: "Process ID"
+ requestBody:
+ description: "Set configuration object"
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Config'
responses:
200:
- description: "The estimation session has been finished successfully."
+ description: Successfully saved and applied configuration parameters
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Config"
400:
- description: "Bad request"
+ description: Bad request
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: BAD_REQUEST
+ message: configuration management via UI/API disabled by admin
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+
+ /admin/config.yaml:
+ get:
+ tags:
+ - Admin
+ summary: Get full config (YAML)
+ description: "Retrieve the DBLab configuration in YAML format. All sensitive values are masked.
+ This method allows seeing the entire configuration file and can be helpful for
+ reviewing configuration and setting up workflows to automate DBLab provisioning
+ and configuration."
+ operationId: getConfigYaml
+ parameters:
+ - in: header
+ name: Verification-Token
schema:
- $ref: "#/definitions/Error"
- 404:
- description: "Not found"
+ type: string
+ required: true
+ responses:
+ 200:
+ description: "Returned configuration (YAML)"
+ content:
+ application/yaml:
+ schema:
+ $ref: "#/components/schemas/Config"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ /admin/test-db-source:
+ post:
+ tags:
+ - Admin
+ summary: Test source database
+ description: ""
+ operationId: testDBConnection
+ parameters:
+ - in: header
+ name: Verification-Token
schema:
- $ref: "#/definitions/Error"
- 500:
- description: "Internal server error"
+ type: string
+ required: true
+ requestBody:
+ description: "Connection DB object"
+ required: true
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Connection'
+ responses:
+ 200:
+ description: "Successful operation"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/TestConnectionResponse"
+ 400:
+ description: Bad request
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Error'
+ example:
+ code: BAD_REQUEST
+ message: configuration management via UI/API disabled by admin
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ /admin/ws-auth:
+ post:
+ tags:
+ - Admin
+ summary: "TBD"
+ description: ""
+ operationId: testDBConnection2
+ parameters:
+ - in: header
+ name: Verification-Token
schema:
- $ref: "#/definitions/Error"
-
- /healthz:
+ type: string
+ required: true
+ responses:
+ 200:
+ description: "Successful operation"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/WSToken"
+ /admin/billing-status:
get:
tags:
- - "instance"
- summary: "Get the state of the instance we are working with"
+ - Admin
+ summary: Checks billing status
description: ""
- operationId: "healthCheck"
- produces:
- - "application/json"
+ operationId: billingStatus
parameters:
- in: header
name: Verification-Token
- type: string
+ schema:
+ type: string
required: true
responses:
200:
description: "Successful operation"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/BillingStatus"
+ 400:
+ description: "Bad request"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+ /admin/activate:
+ post:
+ tags:
+ - Admin
+ summary: "Activate billing"
+ description: "Activates billing and sends usage statistics of the instance"
+ operationId: activateBilling
+ parameters:
+ - in: header
+ name: Verification-Token
schema:
- $ref: "#/definitions/Engine"
- 500:
- description: "Internal server error"
- schema:
- $ref: "#/definitions/Error"
-
-
-definitions:
- Instance:
- type: "object"
- properties:
- status:
- $ref: "#/definitions/Status"
- engine:
- $ref: "#/definitions/Engine"
- pools:
- type: "array"
- items:
- $ref: "#/definitions/PoolEntry"
- cloning:
- $ref: "#/definitions/Cloning"
- retrieving:
- $ref: "#/definitions/Retrieving"
- provisioner:
- $ref: "#/definitions/Provisioner"
-
- Status:
- type: "object"
- required:
- - "code"
- - "message"
- properties:
- code:
- type: "string"
- description: "Status code"
- message:
- type: "string"
- description: "Status description"
-
- Engine:
- type: "object"
- properties:
- version:
- type: "string"
- startedAt:
- type: "string"
- format: "date-time"
- telemetry:
- type: boolean
-
- PoolEntry:
- type: "object"
- properties:
- name:
- type: "string"
- mode:
- type: "string"
- dataStateAt:
- type: "string"
- format: "date-time"
- status:
- type: "string"
- cloneList:
- type: "array"
- items:
- type: "string"
- fileSystem:
- $ref: "#/definitions/FileSystem"
-
- FileSystem:
- type: "object"
- properties:
- mode:
- type: "string"
- free:
- type: "integer"
- format: "int64"
- size:
- type: "integer"
- format: "int64"
- used:
- type: "integer"
- format: "int64"
- dataSize:
- type: "integer"
- format: "int64"
- usedBySnapshots:
- type: "integer"
- format: "int64"
- usedByClones:
- type: "integer"
- format: "int64"
- compressRatio:
- type: "integer"
- format: "float64"
-
- Cloning:
- type: "object"
- properties:
- expectedCloningTime:
- type: "integer"
- format: "float64"
- numClones:
- type: "integer"
- format: "int64"
- clones:
- type: "array"
- items:
- $ref: "#/definitions/Clone"
-
- Retrieving:
- type: "object"
- properties:
- mode:
- type: "string"
- status:
- type: "string"
- lastRefresh:
- type: "string"
- format: "date-time"
- nextRefresh:
- type: "string"
- format: "date-time"
-
- Provisioner:
- type: "object"
- properties:
- dockerImage:
- type: "string"
- containerConfig:
- type: "object"
-
- Snapshot:
- type: "object"
- properties:
- id:
- type: "string"
- createdAt:
- type: "string"
- format: "date-time"
- dataStateAt:
- type: "string"
- format: "date-time"
- physicalSize:
- type: "integer"
- format: "int64"
- logicalSize:
- type: "integer"
- format: "int64"
- pool:
- type: "string"
- numClones:
- type: "integer"
- format: "int"
-
- Database:
- type: "object"
- properties:
- connStr:
- type: "string"
- host:
- type: "string"
- port:
- type: "string"
- username:
- type: "string"
- password:
- type: "string"
-
- Clone:
- type: "object"
- properties:
- id:
- type: "string"
- name:
- type: "string"
- snapshot:
- $ref: "#/definitions/Snapshot"
- protected:
- type: "boolean"
- default: false
- deleteAt:
- type: "string"
- format: "date-time"
- createdAt:
- type: "string"
- format: "date-time"
- status:
- $ref: "#/definitions/Status"
- db:
- $ref: "#/definitions/Database"
- metadata:
- $ref: "#/definitions/CloneMetadata"
-
- CloneMetadata:
- type: "object"
- properties:
- cloneDiffSize:
- type: "integer"
- format: "int64"
- logicalSize:
- type: "integer"
- format: "int64"
- cloningTime:
- type: "integer"
- format: "float64"
- maxIdleMinutes:
- type: "integer"
- format: "int64"
-
- CreateClone:
- type: "object"
- properties:
- id:
- type: "string"
- snapshot:
- type: "object"
- properties:
- id:
+ type: string
+ required: true
+ responses:
+ 200:
+ description: "Successful operation"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Engine"
+ 400:
+ description: "Bad request"
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ 401:
+ description: Unauthorized access
+ content:
+ application/json:
+ schema:
+ $ref: "#/components/schemas/Error"
+ example:
+ code: "UNAUTHORIZED"
+ message: "Check your verification token."
+
+components:
+ schemas:
+
+ Instance:
+ type: "object"
+ properties:
+ status:
+ $ref: "#/components/schemas/Status"
+ engine:
+ $ref: "#/components/schemas/Engine"
+ pools:
+ type: "array"
+ items:
+ $ref: "#/components/schemas/PoolEntry"
+ cloning:
+ $ref: "#/components/schemas/Cloning"
+ retrieving:
+ $ref: "#/components/schemas/Retrieving"
+ provisioner:
+ $ref: "#/components/schemas/Provisioner"
+ synchronization:
+ $ref: "#/components/schemas/Synchronization"
+
+ Status:
+ type: "object"
+ required:
+ - "code"
+ - "message"
+ properties:
+ code:
+ type: "string"
+ description: "Status code"
+ message:
+ type: "string"
+ description: "Status description"
+
+ Engine:
+ type: "object"
+ properties:
+ version:
+ type: "string"
+ edition:
+ type: "string"
+ billingActive:
+ type: boolean
+ instanceID:
+ type: string
+ startedAt:
+ type: "string"
+ format: "date-time"
+ telemetry:
+ type: boolean
+ disableConfigModification:
+ type: boolean
+
+ PoolEntry:
+ type: "object"
+ properties:
+ name:
+ type: "string"
+ mode:
+ type: "string"
+ dataStateAt:
+ type: "string"
+ format: "date-time"
+ status:
+ type: "string"
+ cloneList:
+ type: "array"
+ items:
type: "string"
- protected:
- type: "boolean"
- default: false
- db:
- type: "object"
- properties:
- username:
+ fileSystem:
+ $ref: "#/components/schemas/FileSystem"
+
+ FileSystem:
+ type: "object"
+ properties:
+ mode:
+ type: "string"
+ free:
+ type: "integer"
+ format: "int64"
+ size:
+ type: "integer"
+ format: "int64"
+ used:
+ type: "integer"
+ format: "int64"
+ dataSize:
+ type: "integer"
+ format: "int64"
+ usedBySnapshots:
+ type: "integer"
+ format: "int64"
+ usedByClones:
+ type: "integer"
+ format: "int64"
+ compressRatio:
+ type: "integer"
+ format: "float64"
+
+ Cloning:
+ type: "object"
+ properties:
+ expectedCloningTime:
+ type: "integer"
+ format: "float64"
+ numClones:
+ type: "integer"
+ format: "int64"
+ clones:
+ type: "array"
+ items:
+ $ref: "#/components/schemas/Clone"
+
+ Retrieving:
+ type: "object"
+ properties:
+ mode:
+ type: "string"
+ status:
+ type: "string"
+ lastRefresh:
+ type: "string"
+ format: "date-time"
+ nextRefresh:
+ type: "string"
+ format: "date-time"
+ activity:
+ $ref: "#/components/schemas/Activity"
+
+ Activity:
+ type: "object"
+ properties:
+ source:
+ type: "array"
+ items:
+ $ref: "#/components/schemas/PGActivityEvent"
+ target:
+ type: "array"
+ items:
+ $ref: "#/components/schemas/PGActivityEvent"
+
+ PGActivityEvent:
+ type: "object"
+ properties:
+ user:
+ type: "string"
+ query:
+ type: "string"
+ duration:
+ type: "number"
+ waitEventType:
+ type: "string"
+ waitEvent:
+ type: "string"
+
+ Provisioner:
+ type: "object"
+ properties:
+ dockerImage:
+ type: "string"
+ containerConfig:
+ type: "object"
+
+ Synchronization:
+ type: "object"
+ properties:
+ status:
+ $ref: "#/components/schemas/Status"
+ startedAt:
+ type: "string"
+ format: "date-time"
+ lastReplayedLsn:
+ type: "string"
+ lastReplayedLsnAt:
+ type: "string"
+ format: "date-time"
+ replicationLag:
+ type: "string"
+ replicationUptime:
+ type: "integer"
+
+ Snapshot:
+ type: "object"
+ properties:
+ id:
+ type: "string"
+ createdAt:
+ type: "string"
+ format: "date-time"
+ dataStateAt:
+ type: "string"
+ format: "date-time"
+ physicalSize:
+ type: "integer"
+ format: "int64"
+ logicalSize:
+ type: "integer"
+ format: "int64"
+ pool:
+ type: "string"
+ numClones:
+ type: "integer"
+ format: "int"
+
+ Database:
+ type: "object"
+ properties:
+ connStr:
+ type: "string"
+ host:
+ type: "string"
+ port:
+ type: "string"
+ username:
+ type: "string"
+ password:
+ type: "string"
+
+ Clone:
+ type: "object"
+ properties:
+ id:
+ type: "string"
+ name:
+ type: "string"
+ snapshot:
+ $ref: "#/components/schemas/Snapshot"
+ protected:
+ type: "boolean"
+ default: false
+ deleteAt:
+ type: "string"
+ format: "date-time"
+ createdAt:
+ type: "string"
+ format: "date-time"
+ status:
+ $ref: "#/components/schemas/Status"
+ db:
+ $ref: "#/components/schemas/Database"
+ metadata:
+ $ref: "#/components/schemas/CloneMetadata"
+
+ CloneMetadata:
+ type: "object"
+ properties:
+ cloneDiffSize:
+ type: "integer"
+ format: "int64"
+ logicalSize:
+ type: "integer"
+ format: "int64"
+ cloningTime:
+ type: "integer"
+ format: "float64"
+ maxIdleMinutes:
+ type: "integer"
+ format: "int64"
+
+ CreateClone:
+ type: "object"
+ properties:
+ id:
+ type: "string"
+ snapshot:
+ type: "object"
+ properties:
+ id:
+ type: "string"
+ protected:
+ type: "boolean"
+ default: false
+ db:
+ type: "object"
+ properties:
+ username:
+ type: "string"
+ password:
+ type: "string"
+ restricted:
+ type: "boolean"
+ default: false
+ db_name:
+ type: "string"
+
+ ResetClone:
+ type: "object"
+ description: "Object defining specific snapshot used when resetting clone. Optional parameters `latest` and `snapshotID` must not be specified together"
+ properties:
+ snapshotID:
+ type: "string"
+ latest:
+ type: "boolean"
+ default: false
+
+ UpdateClone:
+ type: "object"
+ properties:
+ protected:
+ type: "boolean"
+ default: false
+
+ StartObservationRequest:
+ type: "object"
+ properties:
+ clone_id:
+ type: "string"
+ config:
+ $ref: "#/components/schemas/ObservationConfig"
+ tags:
+ type: "object"
+ db_name:
+ type: "string"
+
+ ObservationConfig:
+ type: "object"
+ properties:
+ observation_interval:
+ type: "integer"
+ format: "int64"
+ max_lock_duration:
+ type: "integer"
+ format: "int64"
+ max_duration:
+ type: "integer"
+ format: "int64"
+
+ ObservationSession:
+ type: "object"
+ properties:
+ session_id:
+ type: "integer"
+ format: "int64"
+ started_at:
+ type: "string"
+ format: "date-time"
+ finished_at:
+ type: "string"
+ format: "date-time"
+ config:
+ $ref: "#/components/schemas/ObservationConfig"
+ tags:
+ type: "object"
+ artifacts:
+ type: array
+ items:
+ type: string
+ result:
+ $ref: "#/components/schemas/ObservationResult"
+
+ ObservationResult:
+ type: "object"
+ properties:
+ status:
+ type: "string"
+ intervals:
+ type: array
+ items:
+ $ref: "#/components/schemas/ObservationInterval"
+ summary:
+ $ref: "#/components/schemas/ObservationSummary"
+
+ ObservationInterval:
+ type: "object"
+ properties:
+ started_at:
+ type: "string"
+ format: "date-time"
+ duration:
+ type: "integer"
+ format: "int64"
+ warning:
+ type: string
+
+ ObservationSummary:
+ type: "object"
+ properties:
+ total_duration:
+ type: "integer"
+ format: "float64"
+ total_intervals:
+ type: "integer"
+ format: "int"
+ warning_intervals:
+ type: "integer"
+ format: "int"
+ checklist:
+ $ref: "#/components/schemas/ObservationChecklist"
+
+ ObservationChecklist:
+ type: "object"
+ properties:
+ overall_success:
+ type: boolean
+ session_duration_acceptable:
+ type: boolean
+ no_long_dangerous_locks:
+ type: boolean
+
+ StopObservationRequest:
+ type: "object"
+ properties:
+ clone_id:
+ type: "string"
+ overall_error:
+ type: "boolean"
+
+ SummaryObservationRequest:
+ type: "object"
+ properties:
+ clone_id:
+ type: "string"
+ session_id:
+ type: "string"
+
+ ObservationSummaryArtifact:
+ type: "object"
+ properties:
+ session_id:
+ type: "integer"
+ format: "int64"
+ clone_id:
+ type: "string"
+ duration:
+ type: "object"
+ db_size:
+ type: "object"
+ locks:
+ type: "object"
+ log_errors:
+ type: "object"
+ artifact_types:
+ type: "array"
+ items:
type: "string"
- password:
+
+ Error:
+ type: "object"
+ properties:
+ code:
+ type: "string"
+ message:
+ type: "string"
+ detail:
+ type: "string"
+ hint:
+ type: "string"
+
+ Config:
+ type: object
+
+ Connection:
+ type: "object"
+ properties:
+ host:
+ type: "string"
+ port:
+ type: "string"
+ dbname:
+ type: "string"
+ username:
+ type: "string"
+ password:
+ type: "string"
+ db_list:
+ type: "array"
+ items:
type: "string"
- restricted:
- type: "boolean"
- default: false
- db_name:
+
+ TestConnectionResponse:
+ type: "object"
+ properties:
+ status:
+ type: "string"
+ result:
+ type: "string"
+ message:
+ type: "string"
+ dbVersion:
+ type: "integer"
+ tuningParams:
+ type: "object"
+ additionalProperties:
type: "string"
- ResetClone:
- type: "object"
- description: "Object defining specific snapshot used when resetting clone. Optional parameters `latest` and `snapshotID` must not be specified together"
- properties:
- snapshotID:
- type: "string"
- latest:
- type: "boolean"
- default: false
-
- UpdateClone:
- type: "object"
- properties:
- protected:
- type: "boolean"
- default: false
-
- StartObservationRequest:
- type: "object"
- properties:
- clone_id:
- type: "string"
- config:
- $ref: "#/definitions/ObservationConfig"
- tags:
- type: "object"
- db_name:
- type: "string"
-
- ObservationConfig:
- type: "object"
- properties:
- observation_interval:
- type: "integer"
- format: "int64"
- max_lock_duration:
- type: "integer"
- format: "int64"
- max_duration:
- type: "integer"
- format: "int64"
-
- ObservationSession:
- type: "object"
- properties:
- session_id:
- type: "integer"
- format: "int64"
- started_at:
- type: "string"
- format: "date-time"
- finished_at:
- type: "string"
- format: "date-time"
- config:
- $ref: "#/definitions/ObservationConfig"
- tags:
- type: "object"
- artifacts:
- type: array
- items:
+ WSToken:
+ type: "object"
+ properties:
+ token:
+ type: "string"
+ description: "WebSocket token"
+
+ BillingStatus:
+ type: "object"
+ properties:
+ result:
type: string
- result:
- $ref: "#/definitions/ObservationResult"
-
- ObservationResult:
- type: "object"
- properties:
- status:
- type: "string"
- intervals:
- type: array
- items:
- $ref: "#/definitions/ObservationInterval"
- summary:
- $ref: "#/definitions/ObservationSummary"
-
- ObservationInterval:
- type: "object"
- properties:
- started_at:
- type: "string"
- format: "date-time"
- duration:
- type: "integer"
- format: "int64"
- warning:
- type: string
-
- ObservationSummary:
- type: "object"
- properties:
- total_duration:
- type: "integer"
- format: "float64"
- total_intervals:
- type: "integer"
- format: "int"
- warning_intervals:
- type: "integer"
- format: "int"
- checklist:
- $ref: "#/definitions/ObservationChecklist"
-
- ObservationChecklist:
- type: "object"
- properties:
- overall_success:
- type: boolean
- session_duration_acceptable:
- type: boolean
- no_long_dangerous_locks:
- type: boolean
-
- StopObservationRequest:
- type: "object"
- properties:
- clone_id:
- type: "string"
- overall_error:
- type: "boolean"
-
- SummaryObservationRequest:
- type: "object"
- properties:
- clone_id:
- type: "string"
- session_id:
- type: "string"
-
- ObservationSummaryArtifact:
- type: "object"
- properties:
- session_id:
- type: "integer"
- format: "int64"
- clone_id:
- type: "string"
- duration:
- type: "object"
- db_size:
- type: "object"
- locks:
- type: "object"
- log_errors:
- type: "object"
- artifact_types:
- type: "array"
- items:
- type: "string"
-
- Error:
- type: "object"
- properties:
- code:
- type: "string"
- message:
- type: "string"
- detail:
- type: "string"
- hint:
- type: "string"
+ billing_active:
+ type: boolean
+ recognized_org:
+ $ref: "#/components/schemas/RecognizedOrg"
-externalDocs:
- description: "Database Lab Docs"
- url: "https://gitlab.com/postgres-ai/docs/tree/master/docs/database-lab"
+ RecognizedOrg:
+ type: object
+ properties:
+ id:
+ type: integer
+ name:
+ type: string
+ alias:
+ type: string
+ billing_page:
+ type: string
+ priveleged_until:
+ type: string
+ format: date-time
diff --git a/engine/api/swagger-ui/index.css b/engine/api/swagger-ui/index.css
new file mode 100644
index 00000000..f2376fda
--- /dev/null
+++ b/engine/api/swagger-ui/index.css
@@ -0,0 +1,16 @@
+html {
+ box-sizing: border-box;
+ overflow: -moz-scrollbars-vertical;
+ overflow-y: scroll;
+}
+
+*,
+*:before,
+*:after {
+ box-sizing: inherit;
+}
+
+body {
+ margin: 0;
+ background: #fafafa;
+}
diff --git a/engine/api/swagger-ui/index.html b/engine/api/swagger-ui/index.html
index ebb550b3..84ae62d3 100644
--- a/engine/api/swagger-ui/index.html
+++ b/engine/api/swagger-ui/index.html
@@ -5,56 +5,15 @@
Swagger UI
+
-
-
-
+