-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
84 changed files
with
2,605 additions
and
2,857 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,47 @@ | ||
#include "json_handlers.h" | ||
#include <library/cpp/yaml/as/tstring.h> | ||
|
||
namespace NKikimr::NViewer { | ||
|
||
TSimpleYamlBuilder::TSimpleYamlBuilder(TInitializer initializer) { | ||
Method = Root[TString(initializer.Method)]; | ||
if (initializer.Url) { | ||
Method["tags"].push_back(TString(initializer.Url.After('/').Before('/'))); | ||
} | ||
if (initializer.Tag) { | ||
Method["tags"].push_back(TString(initializer.Tag)); | ||
} | ||
if (initializer.Summary) { | ||
Method["summary"] = TString(initializer.Summary); | ||
} | ||
if (initializer.Description) { | ||
Method["description"] = TString(initializer.Description); | ||
} | ||
} | ||
|
||
void TSimpleYamlBuilder::SetParameters(YAML::Node parameters) { | ||
Method["parameters"] = parameters; | ||
} | ||
|
||
void TSimpleYamlBuilder::AddParameter(TParameter parameter) { | ||
YAML::Node param; | ||
param["in"] = "query"; | ||
param["name"] = TString(parameter.Name); | ||
if (parameter.Description) { | ||
param["description"] = TString(parameter.Description); | ||
} | ||
if (parameter.Type) { | ||
param["type"] = TString(parameter.Type); | ||
} | ||
if (parameter.Default) { | ||
param["default"] = TString(parameter.Default); | ||
} | ||
param["required"] = parameter.Required; | ||
Method["parameters"].push_back(param); | ||
} | ||
|
||
void TSimpleYamlBuilder::SetResponseSchema(YAML::Node schema) { | ||
Method["responses"]["200"]["content"]["application/json"]["schema"] = schema; | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
#include "json_handlers.h" | ||
|
||
#include "operation_get.h" | ||
#include "operation_list.h" | ||
#include "operation_cancel.h" | ||
#include "operation_forget.h" | ||
|
||
namespace NKikimr::NViewer { | ||
|
||
void InitOperationGetJsonHandler(TJsonHandlers& handlers); | ||
void InitOperationListJsonHandler(TJsonHandlers& handlers); | ||
void InitOperationCancelJsonHandler(TJsonHandlers& handlers); | ||
void InitOperationForgetJsonHandler(TJsonHandlers& handlers); | ||
|
||
void InitOperationJsonHandlers(TJsonHandlers& jsonHandlers) { | ||
jsonHandlers.AddHandler("/operation/get", new TJsonHandler<TOperationGet>); | ||
jsonHandlers.AddHandler("/operation/list", new TJsonHandler<TOperationList>); | ||
jsonHandlers.AddHandler("/operation/cancel", new TJsonHandler<TOperationCancel>); | ||
jsonHandlers.AddHandler("/operation/forget", new TJsonHandler<TOperationForget>); | ||
InitOperationGetJsonHandler(jsonHandlers); | ||
InitOperationListJsonHandler(jsonHandlers); | ||
InitOperationCancelJsonHandler(jsonHandlers); | ||
InitOperationForgetJsonHandler(jsonHandlers); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,19 +1,15 @@ | ||
#include <ydb/core/blobstorage/vdisk/common/vdisk_events.h> | ||
#include <ydb/core/blobstorage/base/blobstorage_events.h> | ||
|
||
#include "json_handlers.h" | ||
|
||
#include "json_pdisk_restart.h" | ||
#include "pdisk_info.h" | ||
#include "pdisk_status.h" | ||
|
||
|
||
namespace NKikimr::NViewer { | ||
|
||
void InitPDiskInfoJsonHandler(TJsonHandlers& handlers); | ||
void InitPDiskRestartJsonHandler(TJsonHandlers& handlers); | ||
void InitPDiskStatusJsonHandler(TJsonHandlers& handlers); | ||
|
||
void InitPDiskJsonHandlers(TJsonHandlers& jsonHandlers) { | ||
jsonHandlers.AddHandler("/pdisk/info", new TJsonHandler<TPDiskInfo>); | ||
jsonHandlers.AddHandler("/pdisk/restart", new TJsonHandler<TJsonPDiskRestart>); | ||
jsonHandlers.AddHandler("/pdisk/status", new TJsonHandler<TPDiskStatus>); | ||
InitPDiskInfoJsonHandler(jsonHandlers); | ||
InitPDiskRestartJsonHandler(jsonHandlers); | ||
InitPDiskStatusJsonHandler(jsonHandlers); | ||
} | ||
|
||
} |
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,29 @@ | ||
#include "viewer.h" | ||
#include "browse_pq.h" | ||
|
||
namespace NKikimr::NViewer { | ||
|
||
void SetupPQVirtualHandlers(IViewer* viewer) { | ||
viewer->RegisterVirtualHandler( | ||
NKikimrViewer::EObjectType::Root, | ||
[] (const TActorId& owner, const IViewer::TBrowseContext& browseContext) -> IActor* { | ||
return new NViewerPQ::TBrowseRoot(owner, browseContext); | ||
}); | ||
viewer->RegisterVirtualHandler( | ||
NKikimrViewer::EObjectType::Consumers, | ||
[] (const TActorId& owner, const IViewer::TBrowseContext& browseContext) -> IActor* { | ||
return new NViewerPQ::TBrowseConsumers(owner, browseContext); | ||
}); | ||
viewer->RegisterVirtualHandler( | ||
NKikimrViewer::EObjectType::Consumer, | ||
[] (const TActorId& owner, const IViewer::TBrowseContext& browseContext) -> IActor* { | ||
return new NViewerPQ::TBrowseConsumer(owner, browseContext); | ||
}); | ||
viewer->RegisterVirtualHandler( | ||
NKikimrViewer::EObjectType::Topic, | ||
[] (const TActorId& owner, const IViewer::TBrowseContext& browseContext) -> IActor* { | ||
return new NViewerPQ::TBrowseTopic(owner, browseContext); | ||
}); | ||
} | ||
|
||
} |
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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
#include "json_handlers.h" | ||
|
||
#include "scheme_directory.h" | ||
|
||
namespace NKikimr::NViewer { | ||
|
||
void InitSchemeDirectoryHandler(TJsonHandlers& handlers); | ||
|
||
void InitSchemeJsonHandlers(TJsonHandlers& jsonHandlers) { | ||
jsonHandlers.AddHandler("/scheme/directory", new TJsonSchemeDirectoryHandler()); | ||
InitSchemeDirectoryHandler(jsonHandlers); | ||
} | ||
|
||
} |
Oops, something went wrong.