-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add endpoint for REST version and capabilities. (#5429)
This adds the REST capabilities endpoint to `RestClientRemote` and serialization for the `RestCapabilities` response. The endpoint is currently not in use internally and there is no way to make the request using public APIs. The `RestCapabilities` response currently provides the TileDB core version deployed to REST, and the minimum TileDB core client version supported by the REST server. The response may be updated in the future to add more information as needed - [discussion in shortcut](https://app.shortcut.com/tiledb-inc/story/61403/rest-route-to-check-server-side-libtiledb-version-and-capabilities#activity-62215) and [design document](https://www.notion.so/Design-REST-route-to-check-server-side-libtiledb-version-181326501175800ea184eb6909b65d20?pvs=4) --- TYPE: FEATURE DESC: Add endpoint for REST version and capabilities. --------- Co-authored-by: Theodore Tsirpanis <[email protected]>
- Loading branch information
Showing
11 changed files
with
977 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/** | ||
* @file rest_capabilities.h | ||
* | ||
* @section LICENSE | ||
* | ||
* The MIT License | ||
* | ||
* @copyright Copyright (c) 2025 TileDB, Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
* THE SOFTWARE. | ||
* | ||
* @section DESCRIPTION | ||
* | ||
* Helper struct to encapsulate REST supported versions and capabilities. | ||
*/ | ||
|
||
namespace tiledb::sm { | ||
|
||
struct RestCapabilities { | ||
struct TileDBVersion { | ||
TileDBVersion() = default; | ||
|
||
TileDBVersion(int major, int minor, int patch) | ||
: major_(major) | ||
, minor_(minor) | ||
, patch_(patch) { | ||
} | ||
|
||
bool operator==(const TileDBVersion& rhs) const = default; | ||
|
||
uint16_t major_, minor_, patch_; | ||
}; | ||
|
||
/** | ||
* Default constructor allows the class to be constructed without submitting | ||
* a REST request to initialize member variables. | ||
*/ | ||
RestCapabilities() = default; | ||
|
||
~RestCapabilities() = default; | ||
|
||
/** | ||
* Fully initialized constructor contains all REST version and capabilities | ||
* information required for handling edge cases between client & server | ||
* releases. | ||
*/ | ||
RestCapabilities( | ||
TileDBVersion rest_version, TileDBVersion rest_minimum_version) | ||
: detected_(true) | ||
, rest_tiledb_version_(rest_version) | ||
, rest_minimum_supported_version_(rest_minimum_version) { | ||
} | ||
|
||
bool operator==(const RestCapabilities& rhs) const = default; | ||
|
||
/// Whether or not the REST capabilities have been initialized. | ||
bool detected_ = false; | ||
|
||
/// The currently deployed TileDB version available on the REST server. | ||
TileDBVersion rest_tiledb_version_{}; | ||
|
||
/// The minimum TileDB version supported by the REST server. | ||
TileDBVersion rest_minimum_supported_version_{}; | ||
}; | ||
|
||
} // namespace tiledb::sm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.