iceberg-cpp
Loading...
Searching...
No Matches
resource_paths.h
Go to the documentation of this file.
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 */
19
20#pragma once
21
22#include <memory>
23#include <optional>
24#include <string>
25
27#include "iceberg/result.h"
28#include "iceberg/type_fwd.h"
29
32
33namespace iceberg::rest {
34
38class ICEBERG_REST_EXPORT ResourcePaths {
39 public:
46 std::string base_uri, const std::string& prefix,
47 const std::string& namespace_separator);
48
51
54
57
60
63
66
69
72
75
79
83
86
90 std::optional<std::string> plan_id = std::nullopt) const;
91
95
96 private:
97 ResourcePaths(std::string base_uri, const std::string& prefix,
98 std::string namespace_separator);
99
100 std::string base_uri_; // required
101 const std::string prefix_; // optional
102 const std::string namespace_separator_;
103};
104
105} // namespace iceberg::rest
Resource path builder for Iceberg REST catalog endpoints.
Definition resource_paths.h:38
Result< std::string > Credentials(const TableIdentifier &ident) const
Get the /v1/{prefix}/namespaces/{namespace}/tables/{table}/credentials endpoint path.
Result< std::string > Config() const
Get the /v1/config endpoint path.
static Result< std::unique_ptr< ResourcePaths > > Make(std::string base_uri, const std::string &prefix, const std::string &namespace_separator)
Construct a ResourcePaths with base URI and optional prefix.
Result< std::string > NamespaceProperties(const Namespace &ns) const
Get the /v1/{prefix}/namespaces/{namespace}/properties endpoint path.
Result< std::string > Table(const TableIdentifier &ident) const
Get the /v1/{prefix}/namespaces/{namespace}/tables/{table} endpoint path.
Result< std::string > Namespace_(const Namespace &ns) const
Get the /v1/{prefix}/namespaces/{namespace} endpoint path.
Result< std::string > Register(const Namespace &ns) const
Get the /v1/{prefix}/namespaces/{namespace}/register endpoint path.
Result< std::string > Namespaces() const
Get the /v1/{prefix}/namespaces endpoint path.
Result< std::string > FetchScanTasks(const TableIdentifier &ident) const
Get the /v1/{prefix}/namespaces/{namespace}/tables/{table}/tasks endpoint path.
Result< std::string > Tables(const Namespace &ns) const
Get the /v1/{prefix}/namespaces/{namespace}/tables endpoint path.
Result< std::string > OAuth2Tokens() const
Get the /v1/oauth/tokens endpoint path.
Result< std::string > Metrics(const TableIdentifier &ident) const
Get the /v1/{prefix}/namespaces/{namespace}/tables/{table}/metrics endpoint path.
Result< std::string > Rename() const
Get the /v1/{prefix}/tables/rename endpoint path.
Result< std::string > CommitTransaction() const
Get the /v1/{prefix}/transactions/commit endpoint path.
Result< std::string > Plan(const TableIdentifier &ident, std::optional< std::string > plan_id=std::nullopt) const
Get the /v1/{prefix}/namespaces/{namespace}/tables/{table}/plan endpoint path, or /plan/{plan_id} if ...
Define symbol visibility macros for the REST catalog library.
REST catalog APIs.
Definition auth_manager.h:34
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.
A namespace in a catalog.
Definition table_identifier.h:35
Identifies a table in iceberg catalog.
Definition table_identifier.h:46