Couchbase C++ SDK 1.0.2 (rev. 51f4775)
Loading...
Searching...
No Matches
diagnostics_result.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2/*
3 * Copyright 2023-Present Couchbase, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#pragma once
19
22
23#include <cstdint>
24#include <map>
25#include <string>
26#include <utility>
27#include <vector>
28
29namespace couchbase
30{
32{
33public:
38 diagnostics_result() = default;
39
44 diagnostics_result(std::string id,
45 std::uint16_t version,
46 std::string sdk,
47 std::map<service_type, std::vector<endpoint_diagnostics>> endpoints)
48 : id_{ std::move(id) }
49 , version_{ version }
50 , sdk_{ std::move(sdk) }
51 , endpoints_{ std::move(endpoints) }
52 {
53 }
54
63 [[nodiscard]] auto id() const -> std::string
64 {
65 return id_;
66 }
67
76 [[nodiscard]] auto version() const -> std::uint16_t
77 {
78 return version_;
79 }
80
89 [[nodiscard]] auto sdk() const -> std::string
90 {
91 return sdk_;
92 }
93
102 [[nodiscard]] auto endpoints() const -> std::map<service_type, std::vector<endpoint_diagnostics>>
103 {
104 return endpoints_;
105 }
106
115 [[nodiscard]] auto as_json() const -> std::string;
116
117private:
118 std::string id_{};
119 std::uint16_t version_{};
120 std::string sdk_{};
121 std::map<service_type, std::vector<endpoint_diagnostics>> endpoints_{};
122};
123} // namespace couchbase
Definition diagnostics_result.hxx:32
diagnostics_result(std::string id, std::uint16_t version, std::string sdk, std::map< service_type, std::vector< endpoint_diagnostics > > endpoints)
Definition diagnostics_result.hxx:44
auto as_json() const -> std::string
Exports the diagnostics report as JSON.
auto id() const -> std::string
Returns the ID of this report.
Definition diagnostics_result.hxx:63
auto version() const -> std::uint16_t
Returns the version of this report (useful when exporting to JSON).
Definition diagnostics_result.hxx:76
auto endpoints() const -> std::map< service_type, std::vector< endpoint_diagnostics > >
Returns the diagnostics for each individual endpoint, organised by service type.
Definition diagnostics_result.hxx:102
auto sdk() const -> std::string
Returns the identifier of this SDK (useful when exporting to JSON).
Definition diagnostics_result.hxx:89
Definition endpoint_diagnostics.hxx:64
Represents a single item from the result of collection::scan()
Definition allow_querying_search_index_options.hxx:28
service_type
Definition service_type.hxx:22