jfjoch_writer: Remove pistache HTTP server
This commit is contained in:
@@ -32,14 +32,12 @@ wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/${OPE
|
||||
SRC=' version:.*'
|
||||
DST=" version: $VERSION"
|
||||
sed -i -e "s/$SRC/$DST/" broker/jfjoch_api.yaml
|
||||
sed -i -e "s/$SRC/$DST/" writer/writer_api.yaml
|
||||
|
||||
|
||||
git rm broker/gen/model/*.cpp broker/gen/model/*.h frontend/src/openapi/models/*.ts docs/python_client/* docs/python_client/docs/*
|
||||
|
||||
java -jar openapi-generator-cli.jar generate -i broker/jfjoch_api.yaml -o python-client/ -g python --git-host=git.psi.ch --git-repo-id jungfraujoch --git-user-id jungfraujoch --additional-properties=packageName=jfjoch_client,packageVersion=$VERSION
|
||||
java -jar openapi-generator-cli.jar generate -i broker/jfjoch_api.yaml -o broker/gen -g cpp-pistache-server
|
||||
java -jar openapi-generator-cli.jar generate -i writer/writer_api.yaml -o writer/gen -g cpp-pistache-server
|
||||
|
||||
cd frontend
|
||||
sed -i s/\".*\"/\"$VERSION\"/g src/version.ts
|
||||
|
||||
@@ -29,14 +29,6 @@ ADD_LIBRARY(JFJochWriter STATIC
|
||||
|
||||
TARGET_LINK_LIBRARIES(JFJochWriter JFJochPreview JFJochImagePuller JFJochLogger JFJochHDF5Wrappers CBORStream2FrameSerialize)
|
||||
|
||||
AUX_SOURCE_DIRECTORY(gen/model MODEL_SOURCES)
|
||||
ADD_LIBRARY(WriterAPI STATIC ${MODEL_SOURCES} gen/api/DefaultApi.cpp gen/api/DefaultApi.h JFJochWriterHttp.h JFJochWriterHttp.cpp)
|
||||
|
||||
TARGET_LINK_LIBRARIES(WriterAPI JFJochWriter pistache_static)
|
||||
TARGET_INCLUDE_DIRECTORIES(WriterAPI PUBLIC gen/model gen/api)
|
||||
|
||||
ADD_EXECUTABLE(jfjoch_writer jfjoch_writer.cpp JFJochWriterHttp.h JFJochWriterHttp.cpp
|
||||
HDF5DataFilePluginReflection.cpp
|
||||
HDF5DataFilePluginReflection.h)
|
||||
TARGET_LINK_LIBRARIES(jfjoch_writer JFJochWriter WriterAPI)
|
||||
ADD_EXECUTABLE(jfjoch_writer jfjoch_writer.cpp)
|
||||
TARGET_LINK_LIBRARIES(jfjoch_writer JFJochWriter)
|
||||
INSTALL(TARGETS jfjoch_writer RUNTIME COMPONENT writer)
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include "../common/GitInfo.h"
|
||||
#include "JFJochWriterHttp.h"
|
||||
#include "gen/model/Writer_statistics.h"
|
||||
|
||||
void JFJochWriterHttp::status_get(Pistache::Http::ResponseWriter &response) {
|
||||
auto stat = writer.GetStatistics();
|
||||
org::openapitools::server::model::Writer_statistics resp_struct;
|
||||
resp_struct.setNimages(stat.processed_images);
|
||||
resp_struct.setPerformanceMBs(stat.performance_MBs);
|
||||
resp_struct.setPerformanceHz(stat.performance_Hz);
|
||||
resp_struct.setFilePrefix(stat.file_prefix);
|
||||
resp_struct.setRunName(stat.run_name);
|
||||
resp_struct.setRunNumber(stat.run_number);
|
||||
resp_struct.setSocketNumber(stat.socket_number);
|
||||
switch (stat.state) {
|
||||
case StreamWriterState::Idle:
|
||||
resp_struct.setState("idle");
|
||||
break;
|
||||
case StreamWriterState::Started:
|
||||
resp_struct.setState("started");
|
||||
break;
|
||||
case StreamWriterState::Receiving:
|
||||
resp_struct.setState("receiving");
|
||||
break;
|
||||
case StreamWriterState::Error:
|
||||
resp_struct.setState("error");
|
||||
break;
|
||||
}
|
||||
|
||||
nlohmann::json j = resp_struct;
|
||||
response.send(Pistache::Http::Code::Ok, j.dump(), MIME(Application, Json));
|
||||
}
|
||||
|
||||
void JFJochWriterHttp::cancel_post(Pistache::Http::ResponseWriter &response) {
|
||||
writer.Cancel();
|
||||
response.send(Pistache::Http::Code::Ok);
|
||||
}
|
||||
|
||||
JFJochWriterHttp::JFJochWriterHttp(StreamWriter &in_writer, std::shared_ptr<Pistache::Rest::Router> &rtr)
|
||||
: DefaultApi(rtr), writer(in_writer){
|
||||
init();
|
||||
}
|
||||
|
||||
void JFJochWriterHttp::version_get(Pistache::Http::ResponseWriter &response) {
|
||||
response.send(Pistache::Http::Code::Ok, jfjoch_version(), MIME(Text, Plain));
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#ifndef JUNGFRAUJOCH_JFJOCHWRITERHTTP_H
|
||||
#define JUNGFRAUJOCH_JFJOCHWRITERHTTP_H
|
||||
|
||||
#include <pistache/endpoint.h>
|
||||
#include <pistache/router.h>
|
||||
#include <pistache/client.h>
|
||||
|
||||
#include "../common/Logger.h"
|
||||
#include "StreamWriter.h"
|
||||
#include "gen/api/DefaultApi.h"
|
||||
|
||||
class JFJochWriterHttp : public org::openapitools::server::api::DefaultApi {
|
||||
StreamWriter& writer;
|
||||
|
||||
void status_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void version_get(Pistache::Http::ResponseWriter &response) override;
|
||||
|
||||
void cancel_post(Pistache::Http::ResponseWriter &response) override;
|
||||
public:
|
||||
JFJochWriterHttp(StreamWriter& writer, std::shared_ptr<Pistache::Rest::Router> &rtr);
|
||||
};
|
||||
|
||||
|
||||
#endif //JUNGFRAUJOCH_JFJOCHWRITERHTTP_H
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch writer
|
||||
* Jungfraujoch Writer Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.116
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* ApiBase.h
|
||||
*
|
||||
* Generalization of the Api classes
|
||||
*/
|
||||
|
||||
#ifndef ApiBase_H_
|
||||
#define ApiBase_H_
|
||||
|
||||
#include <pistache/router.h>
|
||||
#include <memory>
|
||||
|
||||
namespace org::openapitools::server::api
|
||||
{
|
||||
|
||||
class ApiBase {
|
||||
public:
|
||||
explicit ApiBase(const std::shared_ptr<Pistache::Rest::Router>& rtr) : router(rtr) {};
|
||||
virtual ~ApiBase() = default;
|
||||
virtual void init() = 0;
|
||||
|
||||
protected:
|
||||
const std::shared_ptr<Pistache::Rest::Router> router;
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::api
|
||||
|
||||
#endif /* ApiBase_H_ */
|
||||
@@ -1,137 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch writer
|
||||
* Jungfraujoch Writer Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.116
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
#include "DefaultApi.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
namespace org::openapitools::server::api
|
||||
{
|
||||
|
||||
using namespace org::openapitools::server::helpers;
|
||||
using namespace org::openapitools::server::model;
|
||||
|
||||
const std::string DefaultApi::base = "";
|
||||
|
||||
DefaultApi::DefaultApi(const std::shared_ptr<Pistache::Rest::Router>& rtr)
|
||||
: ApiBase(rtr)
|
||||
{
|
||||
}
|
||||
|
||||
void DefaultApi::init() {
|
||||
setupRoutes();
|
||||
}
|
||||
|
||||
void DefaultApi::setupRoutes() {
|
||||
using namespace Pistache::Rest;
|
||||
|
||||
Routes::Post(*router, base + "/cancel", Routes::bind(&DefaultApi::cancel_post_handler, this));
|
||||
Routes::Get(*router, base + "/status", Routes::bind(&DefaultApi::status_get_handler, this));
|
||||
Routes::Get(*router, base + "/version", Routes::bind(&DefaultApi::version_get_handler, this));
|
||||
|
||||
// Default handler, called when a route is not found
|
||||
router->addCustomHandler(Routes::bind(&DefaultApi::default_api_default_handler, this));
|
||||
}
|
||||
|
||||
void DefaultApi::handleParsingException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept
|
||||
{
|
||||
std::pair<Pistache::Http::Code, std::string> codeAndError = handleParsingException(ex);
|
||||
response.send(codeAndError.first, codeAndError.second);
|
||||
}
|
||||
|
||||
std::pair<Pistache::Http::Code, std::string> DefaultApi::handleParsingException(const std::exception& ex) const noexcept
|
||||
{
|
||||
try {
|
||||
throw;
|
||||
} catch (nlohmann::detail::exception &e) {
|
||||
return std::make_pair(Pistache::Http::Code::Bad_Request, e.what());
|
||||
} catch (org::openapitools::server::helpers::ValidationException &e) {
|
||||
return std::make_pair(Pistache::Http::Code::Bad_Request, e.what());
|
||||
} catch (std::exception &e) {
|
||||
return std::make_pair(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
}
|
||||
|
||||
void DefaultApi::handleOperationException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept
|
||||
{
|
||||
std::pair<Pistache::Http::Code, std::string> codeAndError = handleOperationException(ex);
|
||||
response.send(codeAndError.first, codeAndError.second);
|
||||
}
|
||||
|
||||
std::pair<Pistache::Http::Code, std::string> DefaultApi::handleOperationException(const std::exception& ex) const noexcept
|
||||
{
|
||||
return std::make_pair(Pistache::Http::Code::Internal_Server_Error, ex.what());
|
||||
}
|
||||
|
||||
void DefaultApi::cancel_post_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->cancel_post(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::status_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->status_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
void DefaultApi::version_get_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
try {
|
||||
|
||||
|
||||
try {
|
||||
this->version_get(response);
|
||||
} catch (Pistache::Http::HttpError &e) {
|
||||
response.send(static_cast<Pistache::Http::Code>(e.code()), e.what());
|
||||
return;
|
||||
} catch (std::exception &e) {
|
||||
this->handleOperationException(e, response);
|
||||
return;
|
||||
}
|
||||
|
||||
} catch (std::exception &e) {
|
||||
response.send(Pistache::Http::Code::Internal_Server_Error, e.what());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void DefaultApi::default_api_default_handler(const Pistache::Rest::Request &, Pistache::Http::ResponseWriter response) {
|
||||
response.send(Pistache::Http::Code::Not_Found, "The requested method does not exist");
|
||||
}
|
||||
|
||||
} // namespace org::openapitools::server::api
|
||||
|
||||
@@ -1,108 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch writer
|
||||
* Jungfraujoch Writer Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.116
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* DefaultApi.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef DefaultApi_H_
|
||||
#define DefaultApi_H_
|
||||
|
||||
|
||||
#include "ApiBase.h"
|
||||
|
||||
#include <pistache/http.h>
|
||||
#include <pistache/router.h>
|
||||
#include <pistache/http_headers.h>
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "Writer_statistics.h"
|
||||
#include <string>
|
||||
|
||||
namespace org::openapitools::server::api
|
||||
{
|
||||
|
||||
class DefaultApi : public ApiBase {
|
||||
public:
|
||||
explicit DefaultApi(const std::shared_ptr<Pistache::Rest::Router>& rtr);
|
||||
~DefaultApi() override = default;
|
||||
void init() override;
|
||||
|
||||
static const std::string base;
|
||||
|
||||
private:
|
||||
void setupRoutes();
|
||||
|
||||
void cancel_post_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void status_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void version_get_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
void default_api_default_handler(const Pistache::Rest::Request &request, Pistache::Http::ResponseWriter response);
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during Parameter parsing and validation.
|
||||
/// May be overridden to return custom error formats. This is called inside a catch block.
|
||||
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
||||
/// </summary>
|
||||
virtual void handleParsingException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during Parameter parsing and validation.
|
||||
/// May be overridden to return custom error formats. This is called inside a catch block.
|
||||
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
||||
/// </summary>
|
||||
virtual std::pair<Pistache::Http::Code, std::string> handleParsingException(const std::exception& ex) const noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during processing of the request in handler functions.
|
||||
/// May be overridden to return custom error formats. This is called inside a catch block.
|
||||
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
||||
/// </summary>
|
||||
virtual void handleOperationException(const std::exception& ex, Pistache::Http::ResponseWriter &response) const noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Helper function to handle unexpected Exceptions during processing of the request in handler functions.
|
||||
/// May be overridden to return custom error formats. This is called inside a catch block.
|
||||
/// Important: When overriding, do not call `throw ex;`, but instead use `throw;`.
|
||||
/// </summary>
|
||||
virtual std::pair<Pistache::Http::Code, std::string> handleOperationException(const std::exception& ex) const noexcept;
|
||||
|
||||
/// <summary>
|
||||
/// Cancel running data collection
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// It only instructs writer to cancel, but doesn't wait for cancellation actually happening. It still requires to call `/wait_till_done`
|
||||
/// </remarks>
|
||||
virtual void cancel_post(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
/// Get writer status
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
virtual void status_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
///
|
||||
/// </remarks>
|
||||
virtual void version_get(Pistache::Http::ResponseWriter &response) = 0;
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::api
|
||||
|
||||
#endif /* DefaultApi_H_ */
|
||||
|
||||
@@ -1,148 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch writer
|
||||
* Jungfraujoch Writer Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.116
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
#include "Helpers.h"
|
||||
#include <regex>
|
||||
|
||||
namespace org::openapitools::server::helpers
|
||||
{
|
||||
|
||||
const std::regex regexRfc3339_date(R"(^(\d{4})\-(\d{2})\-(\d{2})$)");
|
||||
const std::regex regexRfc3339_date_time(
|
||||
R"(^(\d{4})\-(\d{2})\-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(\.\d+)?([Zz]|([\+\-])(\d{2}):(\d{2}))$)"
|
||||
);
|
||||
|
||||
|
||||
namespace
|
||||
{
|
||||
// Determine if given year is a leap year
|
||||
// See RFC 3339, Appendix C https://tools.ietf.org/html/rfc3339#appendix-C
|
||||
bool isLeapYear(const uint16_t year) {
|
||||
return (year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0));
|
||||
}
|
||||
|
||||
bool validateDateValues(const uint16_t year, const uint16_t month, const uint16_t day) {
|
||||
return !(
|
||||
(month == 0 || month > 12)
|
||||
|| (day == 0)
|
||||
|| (month == 2 && day > (28 + (isLeapYear(year) ? 1 : 0)))
|
||||
|| (month <= 7 && day > (30 + month % 2))
|
||||
|| (month >= 8 && day > (31 - month % 2))
|
||||
);
|
||||
}
|
||||
|
||||
bool validateTimeValues(const uint16_t hours, const uint16_t minutes, const uint16_t seconds) {
|
||||
return (hours <= 23) && (minutes <= 59) && (seconds <= 60);
|
||||
}
|
||||
}
|
||||
|
||||
bool validateRfc3339_date(const std::string& str) {
|
||||
std::smatch match;
|
||||
const bool found = std::regex_search(str, match, regexRfc3339_date);
|
||||
return found && validateDateValues(static_cast<uint16_t>(std::stoi(match[1])),
|
||||
static_cast<uint16_t>(std::stoi(match[2])),
|
||||
static_cast<uint16_t>(std::stoi(match[3])));
|
||||
}
|
||||
|
||||
bool validateRfc3339_date_time(const std::string& str) {
|
||||
std::smatch match;
|
||||
const bool found = std::regex_search(str, match, regexRfc3339_date_time);
|
||||
return found
|
||||
&& validateDateValues(static_cast<uint16_t>(std::stoi(match[1])),
|
||||
static_cast<uint16_t>(std::stoi(match[2])),
|
||||
static_cast<uint16_t>(std::stoi(match[3])))
|
||||
&& validateTimeValues(static_cast<uint16_t>(std::stoi(match[4])),
|
||||
static_cast<uint16_t>(std::stoi(match[5])),
|
||||
static_cast<uint16_t>(std::stoi(match[6])));
|
||||
}
|
||||
|
||||
std::string toStringValue(const std::string &value){
|
||||
return std::string(value);
|
||||
}
|
||||
|
||||
std::string toStringValue(const int32_t value){
|
||||
return std::to_string(value);
|
||||
}
|
||||
|
||||
std::string toStringValue(const int64_t value){
|
||||
return std::to_string(value);
|
||||
}
|
||||
|
||||
std::string toStringValue(const bool value){
|
||||
return value ? std::string("true") : std::string("false");
|
||||
}
|
||||
|
||||
std::string toStringValue(const float value){
|
||||
return std::to_string(value);
|
||||
}
|
||||
|
||||
std::string toStringValue(const double value){
|
||||
return std::to_string(value);
|
||||
}
|
||||
|
||||
bool fromStringValue(const std::string &inStr, std::string &value){
|
||||
value = std::string(inStr);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool fromStringValue(const std::string &inStr, int32_t &value){
|
||||
try {
|
||||
value = std::stoi( inStr );
|
||||
}
|
||||
catch (const std::invalid_argument&) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool fromStringValue(const std::string &inStr, int64_t &value){
|
||||
try {
|
||||
value = std::stol( inStr );
|
||||
}
|
||||
catch (const std::invalid_argument&) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool fromStringValue(const std::string &inStr, bool &value){
|
||||
if (inStr == "true") {
|
||||
value = true;
|
||||
return true;
|
||||
}
|
||||
if (inStr == "false") {
|
||||
value = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool fromStringValue(const std::string &inStr, float &value){
|
||||
try {
|
||||
value = std::stof( inStr );
|
||||
}
|
||||
catch (const std::invalid_argument&) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool fromStringValue(const std::string &inStr, double &value){
|
||||
try {
|
||||
value = std::stod( inStr );
|
||||
}
|
||||
catch (const std::invalid_argument&) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace org::openapitools::server::helpers
|
||||
@@ -1,146 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch writer
|
||||
* Jungfraujoch Writer Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.116
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Helpers.h
|
||||
*
|
||||
* This is the helper class for models and primitives
|
||||
*/
|
||||
|
||||
#ifndef Helpers_H_
|
||||
#define Helpers_H_
|
||||
|
||||
#include <ctime>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
namespace org::openapitools::server::helpers
|
||||
{
|
||||
|
||||
class ValidationException : public std::runtime_error
|
||||
{
|
||||
public:
|
||||
explicit ValidationException(const std::string& what)
|
||||
: std::runtime_error(what)
|
||||
{ }
|
||||
~ValidationException() override = default;
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// Validate a string against the full-date definition of RFC 3339, section 5.6.
|
||||
/// </summary>
|
||||
bool validateRfc3339_date(const std::string& str);
|
||||
|
||||
/// <summary>
|
||||
/// Validate a string against the date-time definition of RFC 3339, section 5.6.
|
||||
/// </summary>
|
||||
bool validateRfc3339_date_time(const std::string& str);
|
||||
|
||||
namespace sfinae_helpers
|
||||
{
|
||||
struct NoType {};
|
||||
template <typename T1, typename T2> NoType operator==(const T1&, const T2&);
|
||||
|
||||
template <typename T1, typename T2> class EqualsOperatorAvailable
|
||||
{
|
||||
public:
|
||||
enum
|
||||
{
|
||||
value = !std::is_same< decltype(std::declval<T1>() == std::declval<T2>()), NoType >::value
|
||||
};
|
||||
};
|
||||
} // namespace sfinae_helpers
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Determine if the given vector<T> only has unique elements. T must provide the == operator.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
bool hasOnlyUniqueItems(const std::vector<T>& vec)
|
||||
{
|
||||
static_assert(sfinae_helpers::EqualsOperatorAvailable<T, T>::value,
|
||||
"hasOnlyUniqueItems<T> cannot be called, passed template type does not provide == operator.");
|
||||
if (vec.size() <= 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Compare every element of vec to every other element of vec.
|
||||
// This isn't an elegant way to do this, since it's O(n^2),
|
||||
// but it's the best solution working only with the == operator.
|
||||
// This could be greatly improved if our models provided a valid hash
|
||||
// and/or the < operator
|
||||
for (size_t i = 0; i < vec.size() - 1; i++)
|
||||
{
|
||||
for (size_t j = i + 1; j < vec.size(); j++)
|
||||
{
|
||||
if (vec[i] == vec[j])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Determine if the given set<T> only has unique elements.
|
||||
/// </summary>
|
||||
template <typename T>
|
||||
bool hasOnlyUniqueItems(const std::set<T>&)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string toStringValue(const std::string &value);
|
||||
std::string toStringValue(const int32_t value);
|
||||
std::string toStringValue(const int64_t value);
|
||||
std::string toStringValue(const bool value);
|
||||
std::string toStringValue(const float value);
|
||||
std::string toStringValue(const double value);
|
||||
|
||||
bool fromStringValue(const std::string &inStr, std::string &value);
|
||||
bool fromStringValue(const std::string &inStr, int32_t &value);
|
||||
bool fromStringValue(const std::string &inStr, int64_t &value);
|
||||
bool fromStringValue(const std::string &inStr, bool &value);
|
||||
bool fromStringValue(const std::string &inStr, float &value);
|
||||
bool fromStringValue(const std::string &inStr, double &value);
|
||||
template<typename T>
|
||||
bool fromStringValue(const std::vector<std::string> &inStr, std::vector<T> &value){
|
||||
try{
|
||||
for(auto & item : inStr){
|
||||
T itemValue;
|
||||
if(fromStringValue(item, itemValue)){
|
||||
value.push_back(itemValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(...){
|
||||
return false;
|
||||
}
|
||||
return value.size() > 0;
|
||||
}
|
||||
template<typename T>
|
||||
bool fromStringValue(const std::string &inStr, std::vector<T> &value, char separator = ','){
|
||||
std::vector<std::string> inStrings;
|
||||
std::istringstream f(inStr);
|
||||
std::string s;
|
||||
while (std::getline(f, s, separator)) {
|
||||
inStrings.push_back(s);
|
||||
}
|
||||
return fromStringValue(inStrings, value);
|
||||
}
|
||||
|
||||
} // namespace org::openapitools::server::helpers
|
||||
|
||||
#endif // Helpers_H_
|
||||
@@ -1,309 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch writer
|
||||
* Jungfraujoch Writer Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.116
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
#include "Writer_statistics.h"
|
||||
#include "Helpers.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
Writer_statistics::Writer_statistics()
|
||||
{
|
||||
m_Nimages = 0L;
|
||||
m_NimagesIsSet = false;
|
||||
m_Performance_MBs = 0.0f;
|
||||
m_Performance_MBsIsSet = false;
|
||||
m_Performance_Hz = 0.0f;
|
||||
m_Performance_HzIsSet = false;
|
||||
m_Run_number = 0L;
|
||||
m_Run_numberIsSet = false;
|
||||
m_Run_name = "";
|
||||
m_Run_nameIsSet = false;
|
||||
m_File_prefix = "";
|
||||
m_File_prefixIsSet = false;
|
||||
m_Socket_number = 0L;
|
||||
m_Socket_numberIsSet = false;
|
||||
m_State = "";
|
||||
m_StateIsSet = false;
|
||||
|
||||
}
|
||||
|
||||
void Writer_statistics::validate() const
|
||||
{
|
||||
std::stringstream msg;
|
||||
if (!validate(msg))
|
||||
{
|
||||
throw org::openapitools::server::helpers::ValidationException(msg.str());
|
||||
}
|
||||
}
|
||||
|
||||
bool Writer_statistics::validate(std::stringstream& msg) const
|
||||
{
|
||||
return validate(msg, "");
|
||||
}
|
||||
|
||||
bool Writer_statistics::validate(std::stringstream& msg, const std::string& pathPrefix) const
|
||||
{
|
||||
bool success = true;
|
||||
const std::string _pathPrefix = pathPrefix.empty() ? "Writer_statistics" : pathPrefix;
|
||||
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
bool Writer_statistics::operator==(const Writer_statistics& rhs) const
|
||||
{
|
||||
return
|
||||
|
||||
|
||||
|
||||
((!nimagesIsSet() && !rhs.nimagesIsSet()) || (nimagesIsSet() && rhs.nimagesIsSet() && getNimages() == rhs.getNimages())) &&
|
||||
|
||||
|
||||
((!performanceMBsIsSet() && !rhs.performanceMBsIsSet()) || (performanceMBsIsSet() && rhs.performanceMBsIsSet() && getPerformanceMBs() == rhs.getPerformanceMBs())) &&
|
||||
|
||||
|
||||
((!performanceHzIsSet() && !rhs.performanceHzIsSet()) || (performanceHzIsSet() && rhs.performanceHzIsSet() && getPerformanceHz() == rhs.getPerformanceHz())) &&
|
||||
|
||||
|
||||
((!runNumberIsSet() && !rhs.runNumberIsSet()) || (runNumberIsSet() && rhs.runNumberIsSet() && getRunNumber() == rhs.getRunNumber())) &&
|
||||
|
||||
|
||||
((!runNameIsSet() && !rhs.runNameIsSet()) || (runNameIsSet() && rhs.runNameIsSet() && getRunName() == rhs.getRunName())) &&
|
||||
|
||||
|
||||
((!filePrefixIsSet() && !rhs.filePrefixIsSet()) || (filePrefixIsSet() && rhs.filePrefixIsSet() && getFilePrefix() == rhs.getFilePrefix())) &&
|
||||
|
||||
|
||||
((!socketNumberIsSet() && !rhs.socketNumberIsSet()) || (socketNumberIsSet() && rhs.socketNumberIsSet() && getSocketNumber() == rhs.getSocketNumber())) &&
|
||||
|
||||
|
||||
((!stateIsSet() && !rhs.stateIsSet()) || (stateIsSet() && rhs.stateIsSet() && getState() == rhs.getState()))
|
||||
|
||||
;
|
||||
}
|
||||
|
||||
bool Writer_statistics::operator!=(const Writer_statistics& rhs) const
|
||||
{
|
||||
return !(*this == rhs);
|
||||
}
|
||||
|
||||
void to_json(nlohmann::json& j, const Writer_statistics& o)
|
||||
{
|
||||
j = nlohmann::json::object();
|
||||
if(o.nimagesIsSet())
|
||||
j["nimages"] = o.m_Nimages;
|
||||
if(o.performanceMBsIsSet())
|
||||
j["performance_MBs"] = o.m_Performance_MBs;
|
||||
if(o.performanceHzIsSet())
|
||||
j["performance_Hz"] = o.m_Performance_Hz;
|
||||
if(o.runNumberIsSet())
|
||||
j["run_number"] = o.m_Run_number;
|
||||
if(o.runNameIsSet())
|
||||
j["run_name"] = o.m_Run_name;
|
||||
if(o.filePrefixIsSet())
|
||||
j["file_prefix"] = o.m_File_prefix;
|
||||
if(o.socketNumberIsSet())
|
||||
j["socket_number"] = o.m_Socket_number;
|
||||
if(o.stateIsSet())
|
||||
j["state"] = o.m_State;
|
||||
|
||||
}
|
||||
|
||||
void from_json(const nlohmann::json& j, Writer_statistics& o)
|
||||
{
|
||||
if(j.find("nimages") != j.end())
|
||||
{
|
||||
j.at("nimages").get_to(o.m_Nimages);
|
||||
o.m_NimagesIsSet = true;
|
||||
}
|
||||
if(j.find("performance_MBs") != j.end())
|
||||
{
|
||||
j.at("performance_MBs").get_to(o.m_Performance_MBs);
|
||||
o.m_Performance_MBsIsSet = true;
|
||||
}
|
||||
if(j.find("performance_Hz") != j.end())
|
||||
{
|
||||
j.at("performance_Hz").get_to(o.m_Performance_Hz);
|
||||
o.m_Performance_HzIsSet = true;
|
||||
}
|
||||
if(j.find("run_number") != j.end())
|
||||
{
|
||||
j.at("run_number").get_to(o.m_Run_number);
|
||||
o.m_Run_numberIsSet = true;
|
||||
}
|
||||
if(j.find("run_name") != j.end())
|
||||
{
|
||||
j.at("run_name").get_to(o.m_Run_name);
|
||||
o.m_Run_nameIsSet = true;
|
||||
}
|
||||
if(j.find("file_prefix") != j.end())
|
||||
{
|
||||
j.at("file_prefix").get_to(o.m_File_prefix);
|
||||
o.m_File_prefixIsSet = true;
|
||||
}
|
||||
if(j.find("socket_number") != j.end())
|
||||
{
|
||||
j.at("socket_number").get_to(o.m_Socket_number);
|
||||
o.m_Socket_numberIsSet = true;
|
||||
}
|
||||
if(j.find("state") != j.end())
|
||||
{
|
||||
j.at("state").get_to(o.m_State);
|
||||
o.m_StateIsSet = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int64_t Writer_statistics::getNimages() const
|
||||
{
|
||||
return m_Nimages;
|
||||
}
|
||||
void Writer_statistics::setNimages(int64_t const value)
|
||||
{
|
||||
m_Nimages = value;
|
||||
m_NimagesIsSet = true;
|
||||
}
|
||||
bool Writer_statistics::nimagesIsSet() const
|
||||
{
|
||||
return m_NimagesIsSet;
|
||||
}
|
||||
void Writer_statistics::unsetNimages()
|
||||
{
|
||||
m_NimagesIsSet = false;
|
||||
}
|
||||
float Writer_statistics::getPerformanceMBs() const
|
||||
{
|
||||
return m_Performance_MBs;
|
||||
}
|
||||
void Writer_statistics::setPerformanceMBs(float const value)
|
||||
{
|
||||
m_Performance_MBs = value;
|
||||
m_Performance_MBsIsSet = true;
|
||||
}
|
||||
bool Writer_statistics::performanceMBsIsSet() const
|
||||
{
|
||||
return m_Performance_MBsIsSet;
|
||||
}
|
||||
void Writer_statistics::unsetPerformance_MBs()
|
||||
{
|
||||
m_Performance_MBsIsSet = false;
|
||||
}
|
||||
float Writer_statistics::getPerformanceHz() const
|
||||
{
|
||||
return m_Performance_Hz;
|
||||
}
|
||||
void Writer_statistics::setPerformanceHz(float const value)
|
||||
{
|
||||
m_Performance_Hz = value;
|
||||
m_Performance_HzIsSet = true;
|
||||
}
|
||||
bool Writer_statistics::performanceHzIsSet() const
|
||||
{
|
||||
return m_Performance_HzIsSet;
|
||||
}
|
||||
void Writer_statistics::unsetPerformance_Hz()
|
||||
{
|
||||
m_Performance_HzIsSet = false;
|
||||
}
|
||||
int64_t Writer_statistics::getRunNumber() const
|
||||
{
|
||||
return m_Run_number;
|
||||
}
|
||||
void Writer_statistics::setRunNumber(int64_t const value)
|
||||
{
|
||||
m_Run_number = value;
|
||||
m_Run_numberIsSet = true;
|
||||
}
|
||||
bool Writer_statistics::runNumberIsSet() const
|
||||
{
|
||||
return m_Run_numberIsSet;
|
||||
}
|
||||
void Writer_statistics::unsetRun_number()
|
||||
{
|
||||
m_Run_numberIsSet = false;
|
||||
}
|
||||
std::string Writer_statistics::getRunName() const
|
||||
{
|
||||
return m_Run_name;
|
||||
}
|
||||
void Writer_statistics::setRunName(std::string const& value)
|
||||
{
|
||||
m_Run_name = value;
|
||||
m_Run_nameIsSet = true;
|
||||
}
|
||||
bool Writer_statistics::runNameIsSet() const
|
||||
{
|
||||
return m_Run_nameIsSet;
|
||||
}
|
||||
void Writer_statistics::unsetRun_name()
|
||||
{
|
||||
m_Run_nameIsSet = false;
|
||||
}
|
||||
std::string Writer_statistics::getFilePrefix() const
|
||||
{
|
||||
return m_File_prefix;
|
||||
}
|
||||
void Writer_statistics::setFilePrefix(std::string const& value)
|
||||
{
|
||||
m_File_prefix = value;
|
||||
m_File_prefixIsSet = true;
|
||||
}
|
||||
bool Writer_statistics::filePrefixIsSet() const
|
||||
{
|
||||
return m_File_prefixIsSet;
|
||||
}
|
||||
void Writer_statistics::unsetFile_prefix()
|
||||
{
|
||||
m_File_prefixIsSet = false;
|
||||
}
|
||||
int64_t Writer_statistics::getSocketNumber() const
|
||||
{
|
||||
return m_Socket_number;
|
||||
}
|
||||
void Writer_statistics::setSocketNumber(int64_t const value)
|
||||
{
|
||||
m_Socket_number = value;
|
||||
m_Socket_numberIsSet = true;
|
||||
}
|
||||
bool Writer_statistics::socketNumberIsSet() const
|
||||
{
|
||||
return m_Socket_numberIsSet;
|
||||
}
|
||||
void Writer_statistics::unsetSocket_number()
|
||||
{
|
||||
m_Socket_numberIsSet = false;
|
||||
}
|
||||
std::string Writer_statistics::getState() const
|
||||
{
|
||||
return m_State;
|
||||
}
|
||||
void Writer_statistics::setState(std::string const& value)
|
||||
{
|
||||
m_State = value;
|
||||
m_StateIsSet = true;
|
||||
}
|
||||
bool Writer_statistics::stateIsSet() const
|
||||
{
|
||||
return m_StateIsSet;
|
||||
}
|
||||
void Writer_statistics::unsetState()
|
||||
{
|
||||
m_StateIsSet = false;
|
||||
}
|
||||
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
@@ -1,142 +0,0 @@
|
||||
/**
|
||||
* Jungfraujoch writer
|
||||
* Jungfraujoch Writer Web API
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0.0-rc.116
|
||||
* Contact: filip.leonarski@psi.ch
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
/*
|
||||
* Writer_statistics.h
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef Writer_statistics_H_
|
||||
#define Writer_statistics_H_
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
namespace org::openapitools::server::model
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
class Writer_statistics
|
||||
{
|
||||
public:
|
||||
Writer_statistics();
|
||||
virtual ~Writer_statistics() = default;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Throws a ValidationException on failure.
|
||||
/// </summary>
|
||||
void validate() const;
|
||||
|
||||
/// <summary>
|
||||
/// Validate the current data in the model. Returns false on error and writes an error
|
||||
/// message into the given stringstream.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg) const;
|
||||
|
||||
/// <summary>
|
||||
/// Helper overload for validate. Used when one model stores another model and calls it's validate.
|
||||
/// Not meant to be called outside that case.
|
||||
/// </summary>
|
||||
bool validate(std::stringstream& msg, const std::string& pathPrefix) const;
|
||||
|
||||
bool operator==(const Writer_statistics& rhs) const;
|
||||
bool operator!=(const Writer_statistics& rhs) const;
|
||||
|
||||
/////////////////////////////////////////////
|
||||
/// Writer_statistics members
|
||||
|
||||
/// <summary>
|
||||
/// Number of images written
|
||||
/// </summary>
|
||||
int64_t getNimages() const;
|
||||
void setNimages(int64_t const value);
|
||||
bool nimagesIsSet() const;
|
||||
void unsetNimages();
|
||||
/// <summary>
|
||||
/// Performance in MB/s
|
||||
/// </summary>
|
||||
float getPerformanceMBs() const;
|
||||
void setPerformanceMBs(float const value);
|
||||
bool performanceMBsIsSet() const;
|
||||
void unsetPerformance_MBs();
|
||||
/// <summary>
|
||||
/// Performance in images/s
|
||||
/// </summary>
|
||||
float getPerformanceHz() const;
|
||||
void setPerformanceHz(float const value);
|
||||
bool performanceHzIsSet() const;
|
||||
void unsetPerformance_Hz();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
int64_t getRunNumber() const;
|
||||
void setRunNumber(int64_t const value);
|
||||
bool runNumberIsSet() const;
|
||||
void unsetRun_number();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getRunName() const;
|
||||
void setRunName(std::string const& value);
|
||||
bool runNameIsSet() const;
|
||||
void unsetRun_name();
|
||||
/// <summary>
|
||||
/// File prefix for the last written dataset
|
||||
/// </summary>
|
||||
std::string getFilePrefix() const;
|
||||
void setFilePrefix(std::string const& value);
|
||||
bool filePrefixIsSet() const;
|
||||
void unsetFile_prefix();
|
||||
/// <summary>
|
||||
/// Number of socket on `jfjoch_broker` side for the current/last data collection
|
||||
/// </summary>
|
||||
int64_t getSocketNumber() const;
|
||||
void setSocketNumber(int64_t const value);
|
||||
bool socketNumberIsSet() const;
|
||||
void unsetSocket_number();
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
std::string getState() const;
|
||||
void setState(std::string const& value);
|
||||
bool stateIsSet() const;
|
||||
void unsetState();
|
||||
|
||||
friend void to_json(nlohmann::json& j, const Writer_statistics& o);
|
||||
friend void from_json(const nlohmann::json& j, Writer_statistics& o);
|
||||
protected:
|
||||
int64_t m_Nimages;
|
||||
bool m_NimagesIsSet;
|
||||
float m_Performance_MBs;
|
||||
bool m_Performance_MBsIsSet;
|
||||
float m_Performance_Hz;
|
||||
bool m_Performance_HzIsSet;
|
||||
int64_t m_Run_number;
|
||||
bool m_Run_numberIsSet;
|
||||
std::string m_Run_name;
|
||||
bool m_Run_nameIsSet;
|
||||
std::string m_File_prefix;
|
||||
bool m_File_prefixIsSet;
|
||||
int64_t m_Socket_number;
|
||||
bool m_Socket_numberIsSet;
|
||||
std::string m_State;
|
||||
bool m_StateIsSet;
|
||||
|
||||
};
|
||||
|
||||
} // namespace org::openapitools::server::model
|
||||
|
||||
#endif /* Writer_statistics_H_ */
|
||||
@@ -1,18 +1,16 @@
|
||||
// SPDX-FileCopyrightText: 2024 Filip Leonarski, Paul Scherrer Institute <filip.leonarski@psi.ch>
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
|
||||
#include <getopt.h>
|
||||
#include <filesystem>
|
||||
#include <csignal>
|
||||
#include "../common/Logger.h"
|
||||
#include "JFJochWriterHttp.h"
|
||||
#include "StreamWriter.h"
|
||||
#include "../common/print_license.h"
|
||||
#include "../image_puller/ZMQImagePuller.h"
|
||||
#include <getopt.h>
|
||||
#include <filesystem>
|
||||
|
||||
static Logger logger("jfjoch_writer");
|
||||
|
||||
static Pistache::Http::Endpoint *httpEndpoint;
|
||||
static StreamWriter *writer;
|
||||
volatile static bool quitok = false;
|
||||
|
||||
@@ -20,8 +18,7 @@ void print_usage() {
|
||||
logger.Info("Usage ./jfjoch_writer {options} <address of the ZeroMQ data source>");
|
||||
logger.Info("");
|
||||
logger.Info("Available options:");
|
||||
logger.Info("-R<int> | --root_dir=<int> Root directory for file writing");
|
||||
logger.Info("-H<int> | --http_port=<int> HTTP port for statistics");
|
||||
logger.Info("-d<int> | --root_dir=<int> Root directory for file writing");
|
||||
logger.Info("-r<int> | --zmq_repub_port=<int> ZeroMQ port for PUSH socket to republish images");
|
||||
logger.Info("-f<int> | --zmq_file_port=<int> ZeroMQ port for PUB socket to inform about finalized files");
|
||||
logger.Info("-w<int> | --rcv_watermark=<int> Receiving ZeroMQ socket watermark (default = 100)");
|
||||
@@ -37,7 +34,6 @@ static void sigHandler (int sig){
|
||||
case SIGTERM:
|
||||
case SIGHUP:
|
||||
default:
|
||||
httpEndpoint->shutdown();
|
||||
quitok = true;
|
||||
writer->Cancel();
|
||||
break;
|
||||
@@ -64,7 +60,6 @@ int main(int argc, char **argv) {
|
||||
|
||||
print_license("jfjoch_writer");
|
||||
|
||||
int32_t http_port = 5234;
|
||||
int32_t zmq_repub_port = -1;
|
||||
int32_t zmq_file_port = -1;
|
||||
std::string root_dir = "";
|
||||
@@ -73,7 +68,7 @@ int main(int argc, char **argv) {
|
||||
bool verbose = false;
|
||||
|
||||
static struct option long_options[] = {
|
||||
{"root_dir", required_argument, 0, 'R'},
|
||||
{"root_dir", required_argument, 0, 'd'},
|
||||
{"http_port", required_argument, 0, 'H'},
|
||||
{"zmq_repub_port", required_argument, 0, 'r'},
|
||||
{"zmq_file_port", required_argument, 0, 'f'},
|
||||
@@ -85,13 +80,13 @@ int main(int argc, char **argv) {
|
||||
|
||||
int option_index = 0;
|
||||
int opt;
|
||||
while ((opt = getopt_long(argc, argv, "?hH:r:f:R:W:w:v",long_options, &option_index)) != -1 ) {
|
||||
while ((opt = getopt_long(argc, argv, "?hH:r:f:R:d:W:w:v",long_options, &option_index)) != -1 ) {
|
||||
switch (opt) {
|
||||
case 'v':
|
||||
verbose = true;
|
||||
break;
|
||||
case 'H':
|
||||
http_port = atoi(optarg);
|
||||
// For back compatibility
|
||||
break;
|
||||
case 'r':
|
||||
zmq_repub_port = atoi(optarg);
|
||||
@@ -113,7 +108,8 @@ int main(int argc, char **argv) {
|
||||
case 'f':
|
||||
zmq_file_port = atoi(optarg);
|
||||
break;
|
||||
case 'R':
|
||||
case 'R': // back compatibility
|
||||
case 'd':
|
||||
root_dir = std::string(optarg);
|
||||
break;
|
||||
case '?':
|
||||
@@ -133,12 +129,6 @@ int main(int argc, char **argv) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if ((http_port <= 0) || (http_port >= UINT16_MAX)) {
|
||||
logger.Error("Http port must be between 1 - 65534");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
logger.Info("HTTP service listening on port {}", http_port);
|
||||
|
||||
if (!root_dir.empty()) {
|
||||
try {
|
||||
std::filesystem::current_path(root_dir);
|
||||
@@ -162,32 +152,15 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
|
||||
ZMQContext context;
|
||||
Pistache::Address addr(Pistache::Ipv4::any(), Pistache::Port(http_port));
|
||||
|
||||
ZMQImagePuller puller(argv[first_argc], repub_zmq_addr, rcv_watermark, repub_watermark);
|
||||
writer = new StreamWriter(logger,puller,file_done_zmq_addr, verbose);
|
||||
|
||||
httpEndpoint = new Pistache::Http::Endpoint(addr);
|
||||
|
||||
auto router = std::make_shared<Pistache::Rest::Router>();
|
||||
|
||||
auto opts = Pistache::Http::Endpoint::options().threads(4);
|
||||
opts.flags(Pistache::Tcp::Options::ReuseAddr);
|
||||
httpEndpoint->init(opts);
|
||||
|
||||
std::vector<int> sigs{SIGQUIT, SIGINT, SIGTERM, SIGHUP};
|
||||
setUpUnixSignals(sigs);
|
||||
|
||||
std::thread writer_thread([] {
|
||||
while (!quitok)
|
||||
writer->Run();
|
||||
});
|
||||
while (!quitok)
|
||||
writer->Run();
|
||||
|
||||
JFJochWriterHttp writer_http(*writer, router);
|
||||
|
||||
httpEndpoint->setHandler(router->handler());
|
||||
httpEndpoint->serve();
|
||||
writer_thread.join();
|
||||
logger.Info("Clean stop");
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -1,311 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="utf8" />
|
||||
<title>Jungfraujoch writer</title>
|
||||
<!-- needed for adaptive design -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style>
|
||||
body {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<script src="https://cdn.redoc.ly/redoc/v2.1.3/bundles/redoc.standalone.js"></script><style data-styled="true" data-styled-version="6.1.8">.gikxZY{width:calc(100% - 40%);padding:0 40px;}/*!sc*/
|
||||
@media print,screen and (max-width: 75rem){.gikxZY{width:100%;padding:40px 40px;}}/*!sc*/
|
||||
data-styled.g4[id="sc-hLQSwg"]{content:"gikxZY,"}/*!sc*/
|
||||
.hNzKJC{padding:40px 0;}/*!sc*/
|
||||
.hNzKJC:last-child{min-height:calc(100vh + 1px);}/*!sc*/
|
||||
.hNzKJC>.hNzKJC:last-child{min-height:initial;}/*!sc*/
|
||||
@media print,screen and (max-width: 75rem){.hNzKJC{padding:0;}}/*!sc*/
|
||||
.cSNAXN{padding:40px 0;position:relative;}/*!sc*/
|
||||
.cSNAXN:last-child{min-height:calc(100vh + 1px);}/*!sc*/
|
||||
.cSNAXN>.cSNAXN:last-child{min-height:initial;}/*!sc*/
|
||||
@media print,screen and (max-width: 75rem){.cSNAXN{padding:0;}}/*!sc*/
|
||||
.cSNAXN:not(:last-of-type):after{position:absolute;bottom:0;width:100%;display:block;content:'';border-bottom:1px solid rgba(0, 0, 0, 0.2);}/*!sc*/
|
||||
data-styled.g5[id="sc-eDLKkx"]{content:"hNzKJC,cSNAXN,"}/*!sc*/
|
||||
.imiXRU{width:40%;color:#ffffff;background-color:#263238;padding:0 40px;}/*!sc*/
|
||||
@media print,screen and (max-width: 75rem){.imiXRU{width:100%;padding:40px 40px;}}/*!sc*/
|
||||
data-styled.g6[id="sc-jTQCzO"]{content:"imiXRU,"}/*!sc*/
|
||||
.jGdkPR{background-color:#263238;}/*!sc*/
|
||||
data-styled.g7[id="sc-gLLuof"]{content:"jGdkPR,"}/*!sc*/
|
||||
.fsPUig{display:flex;width:100%;padding:0;}/*!sc*/
|
||||
@media print,screen and (max-width: 75rem){.fsPUig{flex-direction:column;}}/*!sc*/
|
||||
data-styled.g8[id="sc-iBdnpw"]{content:"fsPUig,"}/*!sc*/
|
||||
.gqLiaw{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.85714em;line-height:1.6em;color:#333333;}/*!sc*/
|
||||
data-styled.g9[id="sc-fsYfdN"]{content:"gqLiaw,"}/*!sc*/
|
||||
.gwJLUj{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.57143em;line-height:1.6em;color:#333333;margin:0 0 20px;}/*!sc*/
|
||||
data-styled.g10[id="sc-qZrbh"]{content:"gwJLUj,"}/*!sc*/
|
||||
.klfnyk{color:#ffffff;}/*!sc*/
|
||||
data-styled.g12[id="sc-kFCroH"]{content:"klfnyk,"}/*!sc*/
|
||||
.fNhImz{cursor:pointer;margin-left:-20px;padding:0;line-height:1;width:20px;display:inline-block;outline:0;}/*!sc*/
|
||||
.fNhImz:before{content:'';width:15px;height:15px;background-size:contain;background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbDkwLjUtOTAuNWMyNS0yNSAyNS02NS42IDAtOTAuNSAtMjQuOS0yNS02NS41LTI1LTkwLjUgMGwtMzIuMiAzMi4yYy0yNi4xLTEwLjItNTQuMi0xMi45LTgxLjYtOC45bDY4LjYtNjguNmM1MC01MCAxMzEtNTAgMTgxIDBDNTA5LjYgMTAyLjMgNTA5LjYgMTgzLjQgNDU5LjcgMjMzLjR6TTIyMC4zIDM4Mi4ybC0zMi4yIDMyLjJjLTI1IDI0LjktNjUuNiAyNC45LTkwLjUgMCAtMjUtMjUtMjUtNjUuNiAwLTkwLjVsOTAuNS05MC41YzI1LTI1IDY1LjUtMjUgOTAuNSAwIDcuOCA3LjggMTIuOSAxNy4yIDE1LjggMjcuMSAyLjQtMS40IDQuOC0yLjUgNi44LTQuNWw0Mi4xLTQyYy01LjQtOS4yLTExLjYtMTgtMTkuNC0yNS44IC01MC01MC0xMzEtNTAtMTgxIDBsLTkwLjUgOTAuNWMtNTAgNTAtNTAgMTMxIDAgMTgxIDUwIDUwIDEzMSA1MCAxODEgMGw2OC42LTY4LjZDMjc0LjYgMzk1LjEgMjQ2LjQgMzkyLjMgMjIwLjMgMzgyLjJ6Ii8+PC9zdmc+Cg==');opacity:0.5;visibility:hidden;display:inline-block;vertical-align:middle;}/*!sc*/
|
||||
h1:hover>.fNhImz::before,h2:hover>.fNhImz::before,.fNhImz:hover::before{visibility:visible;}/*!sc*/
|
||||
data-styled.g14[id="sc-csKJxZ"]{content:"fNhImz,"}/*!sc*/
|
||||
.hUWsvg{height:1.5em;width:1.5em;min-width:1.5em;vertical-align:middle;float:left;transition:transform 0.2s ease-out;transform:rotateZ(-90deg);}/*!sc*/
|
||||
.hUWsvg polygon{fill:#1d8127;}/*!sc*/
|
||||
.exoGJA{height:20px;width:20px;min-width:20px;vertical-align:middle;float:right;transition:transform 0.2s ease-out;transform:rotateZ(0);}/*!sc*/
|
||||
.exoGJA polygon{fill:white;}/*!sc*/
|
||||
data-styled.g15[id="sc-eTNRI"]{content:"hUWsvg,exoGJA,"}/*!sc*/
|
||||
.jSWvqu >ul{list-style:none;padding:0;margin:0;margin:0 -5px;}/*!sc*/
|
||||
.jSWvqu >ul >li{padding:5px 10px;display:inline-block;background-color:#11171a;border-bottom:1px solid rgba(0, 0, 0, 0.5);cursor:pointer;text-align:center;outline:none;color:#ccc;margin:0 5px 5px 5px;border:1px solid #07090b;border-radius:5px;min-width:60px;font-size:0.9em;font-weight:bold;}/*!sc*/
|
||||
.jSWvqu >ul >li.react-tabs__tab--selected{color:#333333;background:#ffffff;}/*!sc*/
|
||||
.jSWvqu >ul >li.react-tabs__tab--selected:focus{outline:auto;}/*!sc*/
|
||||
.jSWvqu >ul >li:only-child{flex:none;min-width:100px;}/*!sc*/
|
||||
.jSWvqu >ul >li.tab-success{color:#1d8127;}/*!sc*/
|
||||
.jSWvqu >ul >li.tab-redirect{color:#ffa500;}/*!sc*/
|
||||
.jSWvqu >ul >li.tab-info{color:#87ceeb;}/*!sc*/
|
||||
.jSWvqu >ul >li.tab-error{color:#d41f1c;}/*!sc*/
|
||||
.jSWvqu >.react-tabs__tab-panel{background:#11171a;}/*!sc*/
|
||||
.jSWvqu >.react-tabs__tab-panel>div,.jSWvqu >.react-tabs__tab-panel>pre{padding:20px;margin:0;}/*!sc*/
|
||||
.jSWvqu >.react-tabs__tab-panel>div>pre{padding:0;}/*!sc*/
|
||||
data-styled.g30[id="sc-cyZbeP"]{content:"jSWvqu,"}/*!sc*/
|
||||
.WVNwY code[class*='language-'],.WVNwY pre[class*='language-']{text-shadow:0 -0.1em 0.2em black;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;}/*!sc*/
|
||||
@media print{.WVNwY code[class*='language-'],.WVNwY pre[class*='language-']{text-shadow:none;}}/*!sc*/
|
||||
.WVNwY pre[class*='language-']{padding:1em;margin:0.5em 0;overflow:auto;}/*!sc*/
|
||||
.WVNwY .token.comment,.WVNwY .token.prolog,.WVNwY .token.doctype,.WVNwY .token.cdata{color:hsl(30, 20%, 50%);}/*!sc*/
|
||||
.WVNwY .token.punctuation{opacity:0.7;}/*!sc*/
|
||||
.WVNwY .namespace{opacity:0.7;}/*!sc*/
|
||||
.WVNwY .token.property,.WVNwY .token.tag,.WVNwY .token.number,.WVNwY .token.constant,.WVNwY .token.symbol{color:#4a8bb3;}/*!sc*/
|
||||
.WVNwY .token.boolean{color:#e64441;}/*!sc*/
|
||||
.WVNwY .token.selector,.WVNwY .token.attr-name,.WVNwY .token.string,.WVNwY .token.char,.WVNwY .token.builtin,.WVNwY .token.inserted{color:#a0fbaa;}/*!sc*/
|
||||
.WVNwY .token.selector+a,.WVNwY .token.attr-name+a,.WVNwY .token.string+a,.WVNwY .token.char+a,.WVNwY .token.builtin+a,.WVNwY .token.inserted+a,.WVNwY .token.selector+a:visited,.WVNwY .token.attr-name+a:visited,.WVNwY .token.string+a:visited,.WVNwY .token.char+a:visited,.WVNwY .token.builtin+a:visited,.WVNwY .token.inserted+a:visited{color:#4ed2ba;text-decoration:underline;}/*!sc*/
|
||||
.WVNwY .token.property.string{color:white;}/*!sc*/
|
||||
.WVNwY .token.operator,.WVNwY .token.entity,.WVNwY .token.url,.WVNwY .token.variable{color:hsl(40, 90%, 60%);}/*!sc*/
|
||||
.WVNwY .token.atrule,.WVNwY .token.attr-value,.WVNwY .token.keyword{color:hsl(350, 40%, 70%);}/*!sc*/
|
||||
.WVNwY .token.regex,.WVNwY .token.important{color:#e90;}/*!sc*/
|
||||
.WVNwY .token.important,.WVNwY .token.bold{font-weight:bold;}/*!sc*/
|
||||
.WVNwY .token.italic{font-style:italic;}/*!sc*/
|
||||
.WVNwY .token.entity{cursor:help;}/*!sc*/
|
||||
.WVNwY .token.deleted{color:red;}/*!sc*/
|
||||
data-styled.g32[id="sc-iKOmoZ"]{content:"WVNwY,"}/*!sc*/
|
||||
.iwAAMv{opacity:0.7;transition:opacity 0.3s ease;text-align:right;}/*!sc*/
|
||||
.iwAAMv:focus-within{opacity:1;}/*!sc*/
|
||||
.iwAAMv >button{background-color:transparent;border:0;color:inherit;padding:2px 10px;font-family:Roboto,sans-serif;font-size:14px;line-height:1.5em;cursor:pointer;outline:0;}/*!sc*/
|
||||
.iwAAMv >button :hover,.iwAAMv >button :focus{background:rgba(255, 255, 255, 0.1);}/*!sc*/
|
||||
data-styled.g33[id="sc-gjLLEI"]{content:"iwAAMv,"}/*!sc*/
|
||||
.kIqtpW{position:relative;}/*!sc*/
|
||||
data-styled.g37[id="sc-kMzELR"]{content:"kIqtpW,"}/*!sc*/
|
||||
.VEBGS{font-family:Roboto,sans-serif;font-weight:400;line-height:1.5em;}/*!sc*/
|
||||
.VEBGS p:last-child{margin-bottom:0;}/*!sc*/
|
||||
.VEBGS h1{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.85714em;line-height:1.6em;color:#32329f;margin-top:0;}/*!sc*/
|
||||
.VEBGS h2{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.57143em;line-height:1.6em;color:#333333;}/*!sc*/
|
||||
.VEBGS code{color:#e53935;background-color:rgba(38, 50, 56, 0.05);font-family:Courier,monospace;border-radius:2px;border:1px solid rgba(38, 50, 56, 0.1);padding:0 5px;font-size:13px;font-weight:400;word-break:break-word;}/*!sc*/
|
||||
.VEBGS pre{font-family:Courier,monospace;white-space:pre;background-color:#11171a;color:white;padding:20px;overflow-x:auto;line-height:normal;border-radius:0;border:1px solid rgba(38, 50, 56, 0.1);}/*!sc*/
|
||||
.VEBGS pre code{background-color:transparent;color:white;padding:0;}/*!sc*/
|
||||
.VEBGS pre code:before,.VEBGS pre code:after{content:none;}/*!sc*/
|
||||
.VEBGS blockquote{margin:0;margin-bottom:1em;padding:0 15px;color:#777;border-left:4px solid #ddd;}/*!sc*/
|
||||
.VEBGS img{max-width:100%;box-sizing:content-box;}/*!sc*/
|
||||
.VEBGS ul,.VEBGS ol{padding-left:2em;margin:0;margin-bottom:1em;}/*!sc*/
|
||||
.VEBGS ul ul,.VEBGS ol ul,.VEBGS ul ol,.VEBGS ol ol{margin-bottom:0;margin-top:0;}/*!sc*/
|
||||
.VEBGS table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all;border-collapse:collapse;border-spacing:0;margin-top:1.5em;margin-bottom:1.5em;}/*!sc*/
|
||||
.VEBGS table tr{background-color:#fff;border-top:1px solid #ccc;}/*!sc*/
|
||||
.VEBGS table tr:nth-child(2n){background-color:#fafafa;}/*!sc*/
|
||||
.VEBGS table th,.VEBGS table td{padding:6px 13px;border:1px solid #ddd;}/*!sc*/
|
||||
.VEBGS table th{text-align:left;font-weight:bold;}/*!sc*/
|
||||
.VEBGS .share-link{cursor:pointer;margin-left:-20px;padding:0;line-height:1;width:20px;display:inline-block;outline:0;}/*!sc*/
|
||||
.VEBGS .share-link:before{content:'';width:15px;height:15px;background-size:contain;background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbDkwLjUtOTAuNWMyNS0yNSAyNS02NS42IDAtOTAuNSAtMjQuOS0yNS02NS41LTI1LTkwLjUgMGwtMzIuMiAzMi4yYy0yNi4xLTEwLjItNTQuMi0xMi45LTgxLjYtOC45bDY4LjYtNjguNmM1MC01MCAxMzEtNTAgMTgxIDBDNTA5LjYgMTAyLjMgNTA5LjYgMTgzLjQgNDU5LjcgMjMzLjR6TTIyMC4zIDM4Mi4ybC0zMi4yIDMyLjJjLTI1IDI0LjktNjUuNiAyNC45LTkwLjUgMCAtMjUtMjUtMjUtNjUuNiAwLTkwLjVsOTAuNS05MC41YzI1LTI1IDY1LjUtMjUgOTAuNSAwIDcuOCA3LjggMTIuOSAxNy4yIDE1LjggMjcuMSAyLjQtMS40IDQuOC0yLjUgNi44LTQuNWw0Mi4xLTQyYy01LjQtOS4yLTExLjYtMTgtMTkuNC0yNS44IC01MC01MC0xMzEtNTAtMTgxIDBsLTkwLjUgOTAuNWMtNTAgNTAtNTAgMTMxIDAgMTgxIDUwIDUwIDEzMSA1MCAxODEgMGw2OC42LTY4LjZDMjc0LjYgMzk1LjEgMjQ2LjQgMzkyLjMgMjIwLjMgMzgyLjJ6Ii8+PC9zdmc+Cg==');opacity:0.5;visibility:hidden;display:inline-block;vertical-align:middle;}/*!sc*/
|
||||
.VEBGS h1:hover>.share-link::before,.VEBGS h2:hover>.share-link::before,.VEBGS .share-link:hover::before{visibility:visible;}/*!sc*/
|
||||
.VEBGS a{text-decoration:auto;color:#32329f;}/*!sc*/
|
||||
.VEBGS a:visited{color:#32329f;}/*!sc*/
|
||||
.VEBGS a:hover{color:#6868cf;text-decoration:auto;}/*!sc*/
|
||||
.jaVotg{font-family:Roboto,sans-serif;font-weight:400;line-height:1.5em;}/*!sc*/
|
||||
.jaVotg p:last-child{margin-bottom:0;}/*!sc*/
|
||||
.jaVotg p:first-child{margin-top:0;}/*!sc*/
|
||||
.jaVotg p:last-child{margin-bottom:0;}/*!sc*/
|
||||
.jaVotg h1{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.85714em;line-height:1.6em;color:#32329f;margin-top:0;}/*!sc*/
|
||||
.jaVotg h2{font-family:Montserrat,sans-serif;font-weight:400;font-size:1.57143em;line-height:1.6em;color:#333333;}/*!sc*/
|
||||
.jaVotg code{color:#e53935;background-color:rgba(38, 50, 56, 0.05);font-family:Courier,monospace;border-radius:2px;border:1px solid rgba(38, 50, 56, 0.1);padding:0 5px;font-size:13px;font-weight:400;word-break:break-word;}/*!sc*/
|
||||
.jaVotg pre{font-family:Courier,monospace;white-space:pre;background-color:#11171a;color:white;padding:20px;overflow-x:auto;line-height:normal;border-radius:0;border:1px solid rgba(38, 50, 56, 0.1);}/*!sc*/
|
||||
.jaVotg pre code{background-color:transparent;color:white;padding:0;}/*!sc*/
|
||||
.jaVotg pre code:before,.jaVotg pre code:after{content:none;}/*!sc*/
|
||||
.jaVotg blockquote{margin:0;margin-bottom:1em;padding:0 15px;color:#777;border-left:4px solid #ddd;}/*!sc*/
|
||||
.jaVotg img{max-width:100%;box-sizing:content-box;}/*!sc*/
|
||||
.jaVotg ul,.jaVotg ol{padding-left:2em;margin:0;margin-bottom:1em;}/*!sc*/
|
||||
.jaVotg ul ul,.jaVotg ol ul,.jaVotg ul ol,.jaVotg ol ol{margin-bottom:0;margin-top:0;}/*!sc*/
|
||||
.jaVotg table{display:block;width:100%;overflow:auto;word-break:normal;word-break:keep-all;border-collapse:collapse;border-spacing:0;margin-top:1.5em;margin-bottom:1.5em;}/*!sc*/
|
||||
.jaVotg table tr{background-color:#fff;border-top:1px solid #ccc;}/*!sc*/
|
||||
.jaVotg table tr:nth-child(2n){background-color:#fafafa;}/*!sc*/
|
||||
.jaVotg table th,.jaVotg table td{padding:6px 13px;border:1px solid #ddd;}/*!sc*/
|
||||
.jaVotg table th{text-align:left;font-weight:bold;}/*!sc*/
|
||||
.jaVotg .share-link{cursor:pointer;margin-left:-20px;padding:0;line-height:1;width:20px;display:inline-block;outline:0;}/*!sc*/
|
||||
.jaVotg .share-link:before{content:'';width:15px;height:15px;background-size:contain;background-image:url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiIHZpZXdCb3g9IjAgMCA1MTIgNTEyIiBlbmFibGUtYmFja2dyb3VuZD0ibmV3IDAgMCA1MTIgNTEyIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBmaWxsPSIjMDEwMTAxIiBkPSJNNDU5LjcgMjMzLjRsLTkwLjUgOTAuNWMtNTAgNTAtMTMxIDUwLTE4MSAwIC03LjktNy44LTE0LTE2LjctMTkuNC0yNS44bDQyLjEtNDIuMWMyLTIgNC41LTMuMiA2LjgtNC41IDIuOSA5LjkgOCAxOS4zIDE1LjggMjcuMiAyNSAyNSA2NS42IDI0LjkgOTAuNSAwbDkwLjUtOTAuNWMyNS0yNSAyNS02NS42IDAtOTAuNSAtMjQuOS0yNS02NS41LTI1LTkwLjUgMGwtMzIuMiAzMi4yYy0yNi4xLTEwLjItNTQuMi0xMi45LTgxLjYtOC45bDY4LjYtNjguNmM1MC01MCAxMzEtNTAgMTgxIDBDNTA5LjYgMTAyLjMgNTA5LjYgMTgzLjQgNDU5LjcgMjMzLjR6TTIyMC4zIDM4Mi4ybC0zMi4yIDMyLjJjLTI1IDI0LjktNjUuNiAyNC45LTkwLjUgMCAtMjUtMjUtMjUtNjUuNiAwLTkwLjVsOTAuNS05MC41YzI1LTI1IDY1LjUtMjUgOTAuNSAwIDcuOCA3LjggMTIuOSAxNy4yIDE1LjggMjcuMSAyLjQtMS40IDQuOC0yLjUgNi44LTQuNWw0Mi4xLTQyYy01LjQtOS4yLTExLjYtMTgtMTkuNC0yNS44IC01MC01MC0xMzEtNTAtMTgxIDBsLTkwLjUgOTAuNWMtNTAgNTAtNTAgMTMxIDAgMTgxIDUwIDUwIDEzMSA1MCAxODEgMGw2OC42LTY4LjZDMjc0LjYgMzk1LjEgMjQ2LjQgMzkyLjMgMjIwLjMgMzgyLjJ6Ii8+PC9zdmc+Cg==');opacity:0.5;visibility:hidden;display:inline-block;vertical-align:middle;}/*!sc*/
|
||||
.jaVotg h1:hover>.share-link::before,.jaVotg h2:hover>.share-link::before,.jaVotg .share-link:hover::before{visibility:visible;}/*!sc*/
|
||||
.jaVotg a{text-decoration:auto;color:#32329f;}/*!sc*/
|
||||
.jaVotg a:visited{color:#32329f;}/*!sc*/
|
||||
.jaVotg a:hover{color:#6868cf;text-decoration:auto;}/*!sc*/
|
||||
data-styled.g42[id="sc-cCzLxZ"]{content:"VEBGS,jaVotg,"}/*!sc*/
|
||||
.LxEPk{display:inline;}/*!sc*/
|
||||
data-styled.g43[id="sc-ckdEwu"]{content:"LxEPk,"}/*!sc*/
|
||||
.krcPXE{position:relative;}/*!sc*/
|
||||
data-styled.g44[id="sc-jdHILj"]{content:"krcPXE,"}/*!sc*/
|
||||
.fOJBdW:hover>.sc-gjLLEI{opacity:1;}/*!sc*/
|
||||
data-styled.g49[id="sc-cSxRuM"]{content:"fOJBdW,"}/*!sc*/
|
||||
.DqFKH{font-family:Courier,monospace;font-size:13px;white-space:pre;contain:content;overflow-x:auto;}/*!sc*/
|
||||
.DqFKH .redoc-json code>.collapser{display:none;pointer-events:none;}/*!sc*/
|
||||
.DqFKH .callback-function{color:gray;}/*!sc*/
|
||||
.DqFKH .collapser:after{content:'-';cursor:pointer;}/*!sc*/
|
||||
.DqFKH .collapsed>.collapser:after{content:'+';cursor:pointer;}/*!sc*/
|
||||
.DqFKH .ellipsis:after{content:' … ';}/*!sc*/
|
||||
.DqFKH .collapsible{margin-left:2em;}/*!sc*/
|
||||
.DqFKH .hoverable{padding-top:1px;padding-bottom:1px;padding-left:2px;padding-right:2px;border-radius:2px;}/*!sc*/
|
||||
.DqFKH .hovered{background-color:rgba(235, 238, 249, 1);}/*!sc*/
|
||||
.DqFKH .collapser{background-color:transparent;border:0;color:#fff;font-family:Courier,monospace;font-size:13px;padding-right:6px;padding-left:6px;padding-top:0;padding-bottom:0;display:flex;align-items:center;justify-content:center;width:15px;height:15px;position:absolute;top:4px;left:-1.5em;cursor:default;user-select:none;-webkit-user-select:none;padding:2px;}/*!sc*/
|
||||
.DqFKH .collapser:focus{outline-color:#fff;outline-style:dotted;outline-width:1px;}/*!sc*/
|
||||
.DqFKH ul{list-style-type:none;padding:0px;margin:0px 0px 0px 26px;}/*!sc*/
|
||||
.DqFKH li{position:relative;display:block;}/*!sc*/
|
||||
.DqFKH .hoverable{display:inline-block;}/*!sc*/
|
||||
.DqFKH .selected{outline-style:solid;outline-width:1px;outline-style:dotted;}/*!sc*/
|
||||
.DqFKH .collapsed>.collapsible{display:none;}/*!sc*/
|
||||
.DqFKH .ellipsis{display:none;}/*!sc*/
|
||||
.DqFKH .collapsed>.ellipsis{display:inherit;}/*!sc*/
|
||||
data-styled.g50[id="sc-jMbVJB"]{content:"DqFKH,"}/*!sc*/
|
||||
.jCmKdj{padding:0.9em;background-color:rgba(38,50,56,0.4);margin:0 0 10px 0;display:block;font-family:Montserrat,sans-serif;font-size:0.929em;line-height:1.5em;}/*!sc*/
|
||||
data-styled.g51[id="sc-dQmiwx"]{content:"jCmKdj,"}/*!sc*/
|
||||
.eTZsJr{font-family:Montserrat,sans-serif;font-size:12px;position:absolute;z-index:1;top:-11px;left:12px;font-weight:600;color:rgba(255,255,255,0.7);}/*!sc*/
|
||||
data-styled.g52[id="sc-bCvmQg"]{content:"eTZsJr,"}/*!sc*/
|
||||
.jBjImi{position:relative;}/*!sc*/
|
||||
data-styled.g53[id="sc-cPtzlb"]{content:"jBjImi,"}/*!sc*/
|
||||
.jeLSWq{margin-top:15px;}/*!sc*/
|
||||
data-styled.g56[id="sc-hVcFVo"]{content:"jeLSWq,"}/*!sc*/
|
||||
.ObWVe{margin-top:0;margin-bottom:0.5em;}/*!sc*/
|
||||
data-styled.g91[id="sc-eFyDpN"]{content:"ObWVe,"}/*!sc*/
|
||||
.iGcmRf{border:1px solid #32329f;color:#32329f;font-weight:normal;margin-left:0.5em;padding:4px 8px 4px;display:inline-block;text-decoration:none;cursor:pointer;}/*!sc*/
|
||||
data-styled.g92[id="sc-crHHJw"]{content:"iGcmRf,"}/*!sc*/
|
||||
.gxSVta{width:9ex;display:inline-block;height:13px;line-height:13px;background-color:#333;border-radius:3px;background-repeat:no-repeat;background-position:6px 4px;font-size:7px;font-family:Verdana,sans-serif;color:white;text-transform:uppercase;text-align:center;font-weight:bold;vertical-align:middle;margin-right:6px;margin-top:2px;}/*!sc*/
|
||||
.gxSVta.get{background-color:#2F8132;}/*!sc*/
|
||||
.gxSVta.post{background-color:#186FAF;}/*!sc*/
|
||||
.gxSVta.put{background-color:#95507c;}/*!sc*/
|
||||
.gxSVta.options{background-color:#947014;}/*!sc*/
|
||||
.gxSVta.patch{background-color:#bf581d;}/*!sc*/
|
||||
.gxSVta.delete{background-color:#cc3333;}/*!sc*/
|
||||
.gxSVta.basic{background-color:#707070;}/*!sc*/
|
||||
.gxSVta.link{background-color:#07818F;}/*!sc*/
|
||||
.gxSVta.head{background-color:#A23DAD;}/*!sc*/
|
||||
.gxSVta.hook{background-color:#32329f;}/*!sc*/
|
||||
.gxSVta.schema{background-color:#707070;}/*!sc*/
|
||||
data-styled.g99[id="sc-dmcoYd"]{content:"gxSVta,"}/*!sc*/
|
||||
.fTlmpg{margin:0;padding:0;}/*!sc*/
|
||||
.fTlmpg:first-child{padding-bottom:32px;}/*!sc*/
|
||||
.sc-YltrM .sc-YltrM{font-size:0.929em;}/*!sc*/
|
||||
data-styled.g100[id="sc-YltrM"]{content:"fTlmpg,"}/*!sc*/
|
||||
.kIUuLW{list-style:none inside none;overflow:hidden;text-overflow:ellipsis;padding:0;}/*!sc*/
|
||||
data-styled.g101[id="sc-imiRDh"]{content:"kIUuLW,"}/*!sc*/
|
||||
.gvinAL{cursor:pointer;color:#333333;margin:0;padding:12.5px 20px;display:flex;justify-content:space-between;font-family:Montserrat,sans-serif;background-color:#fafafa;}/*!sc*/
|
||||
.gvinAL:hover{color:#32329f;background-color:#ededed;}/*!sc*/
|
||||
.gvinAL .sc-eTNRI{height:1.5em;width:1.5em;}/*!sc*/
|
||||
.gvinAL .sc-eTNRI polygon{fill:#333333;}/*!sc*/
|
||||
data-styled.g102[id="sc-vIyEI"]{content:"gvinAL,"}/*!sc*/
|
||||
.fXgHFV{display:inline-block;vertical-align:middle;width:calc(100% - 38px);overflow:hidden;text-overflow:ellipsis;}/*!sc*/
|
||||
data-styled.g103[id="sc-bjUHJT"]{content:"fXgHFV,"}/*!sc*/
|
||||
.dWVQcL{font-size:0.8em;margin-top:10px;text-align:center;position:fixed;width:260px;bottom:0;background:#fafafa;}/*!sc*/
|
||||
.dWVQcL a,.dWVQcL a:visited,.dWVQcL a:hover{color:#333333!important;padding:5px 0;border-top:1px solid #e1e1e1;text-decoration:none;display:flex;align-items:center;justify-content:center;}/*!sc*/
|
||||
.dWVQcL img{width:15px;margin-right:5px;}/*!sc*/
|
||||
@media screen and (max-width: 50rem){.dWVQcL{width:100%;}}/*!sc*/
|
||||
data-styled.g104[id="sc-eIPYkq"]{content:"dWVQcL,"}/*!sc*/
|
||||
.cIsduN{cursor:pointer;position:relative;margin-bottom:5px;}/*!sc*/
|
||||
data-styled.g110[id="sc-bPrlCs"]{content:"cIsduN,"}/*!sc*/
|
||||
.gllLir{font-family:Courier,monospace;margin-left:10px;flex:1;overflow-x:hidden;text-overflow:ellipsis;}/*!sc*/
|
||||
data-styled.g111[id="sc-fYrVWQ"]{content:"gllLir,"}/*!sc*/
|
||||
.bclCVA{outline:0;color:inherit;width:100%;text-align:left;cursor:pointer;padding:10px 30px 10px 20px;border-radius:4px 4px 0 0;background-color:#11171a;display:flex;white-space:nowrap;align-items:center;border:1px solid transparent;border-bottom:0;transition:border-color 0.25s ease;}/*!sc*/
|
||||
.bclCVA ..sc-fYrVWQ{color:#ffffff;}/*!sc*/
|
||||
.bclCVA:focus{box-shadow:inset 0 2px 2px rgba(0, 0, 0, 0.45),0 2px 0 rgba(128, 128, 128, 0.25);}/*!sc*/
|
||||
data-styled.g112[id="sc-GkLId"]{content:"bclCVA,"}/*!sc*/
|
||||
.eIFDdZ{font-size:0.929em;line-height:20px;background-color:#2F8132;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/
|
||||
.jBKVIL{font-size:0.929em;line-height:20px;background-color:#186FAF;color:#ffffff;padding:3px 10px;text-transform:uppercase;font-family:Montserrat,sans-serif;margin:0;}/*!sc*/
|
||||
data-styled.g113[id="sc-jYnQyy"]{content:"eIFDdZ,jBKVIL,"}/*!sc*/
|
||||
.hsEiws{position:absolute;width:100%;z-index:100;background:#fafafa;color:#263238;box-sizing:border-box;box-shadow:0 0 6px rgba(0, 0, 0, 0.33);overflow:hidden;border-bottom-left-radius:4px;border-bottom-right-radius:4px;transition:all 0.25s ease;visibility:hidden;transform:translateY(-50%) scaleY(0);}/*!sc*/
|
||||
data-styled.g114[id="sc-eGgGjL"]{content:"hsEiws,"}/*!sc*/
|
||||
.jerStl{padding:10px;}/*!sc*/
|
||||
data-styled.g115[id="sc-fnpiog"]{content:"jerStl,"}/*!sc*/
|
||||
.etvaCd{padding:5px;border:1px solid #ccc;background:#fff;word-break:break-all;color:#32329f;}/*!sc*/
|
||||
.etvaCd >span{color:#333333;}/*!sc*/
|
||||
data-styled.g116[id="sc-lkDHyp"]{content:"etvaCd,"}/*!sc*/
|
||||
.fIqGlH{display:block;border:0;width:100%;text-align:left;padding:10px;border-radius:2px;margin-bottom:4px;line-height:1.5em;cursor:pointer;color:#1d8127;background-color:rgba(29,129,39,0.07);}/*!sc*/
|
||||
.fIqGlH:focus{outline:auto #1d8127;}/*!sc*/
|
||||
.iSOCsR{display:block;border:0;width:100%;text-align:left;padding:10px;border-radius:2px;margin-bottom:4px;line-height:1.5em;cursor:pointer;color:#1d8127;background-color:rgba(29,129,39,0.07);cursor:default;}/*!sc*/
|
||||
.iSOCsR:focus{outline:auto #1d8127;}/*!sc*/
|
||||
.iSOCsR::before{content:"—";font-weight:bold;width:1.5em;text-align:center;display:inline-block;vertical-align:top;}/*!sc*/
|
||||
.iSOCsR:focus{outline:0;}/*!sc*/
|
||||
data-styled.g119[id="sc-hsaIUA"]{content:"fIqGlH,iSOCsR,"}/*!sc*/
|
||||
.ePkkgX{vertical-align:top;}/*!sc*/
|
||||
data-styled.g122[id="sc-gWQvRS"]{content:"ePkkgX,"}/*!sc*/
|
||||
.duKVDl{font-size:1.3em;padding:0.2em 0;margin:3em 0 1.1em;color:#333333;font-weight:normal;}/*!sc*/
|
||||
data-styled.g123[id="sc-fYitVF"]{content:"duKVDl,"}/*!sc*/
|
||||
.dZbpPF{margin-bottom:30px;}/*!sc*/
|
||||
data-styled.g128[id="sc-eYFTNc"]{content:"dZbpPF,"}/*!sc*/
|
||||
.bUvUmx{user-select:none;width:20px;height:20px;align-self:center;display:flex;flex-direction:column;color:#32329f;}/*!sc*/
|
||||
data-styled.g129[id="sc-iEYVpv"]{content:"bUvUmx,"}/*!sc*/
|
||||
.hHYXMN{width:260px;background-color:#fafafa;overflow:hidden;display:flex;flex-direction:column;backface-visibility:hidden;height:100vh;position:sticky;position:-webkit-sticky;top:0;}/*!sc*/
|
||||
@media screen and (max-width: 50rem){.hHYXMN{position:fixed;z-index:20;width:100%;background:#fafafa;display:none;}}/*!sc*/
|
||||
@media print{.hHYXMN{display:none;}}/*!sc*/
|
||||
data-styled.g130[id="sc-iqziPC"]{content:"hHYXMN,"}/*!sc*/
|
||||
.kHszPm{outline:none;user-select:none;background-color:#f2f2f2;color:#32329f;display:none;cursor:pointer;position:fixed;right:20px;z-index:100;border-radius:50%;box-shadow:0 0 20px rgba(0, 0, 0, 0.3);bottom:44px;width:60px;height:60px;padding:0 20px;}/*!sc*/
|
||||
@media screen and (max-width: 50rem){.kHszPm{display:flex;}}/*!sc*/
|
||||
.kHszPm svg{color:#0065FB;}/*!sc*/
|
||||
@media print{.kHszPm{display:none;}}/*!sc*/
|
||||
data-styled.g131[id="sc-eXzmLu"]{content:"kHszPm,"}/*!sc*/
|
||||
.cSYMrW{font-family:Roboto,sans-serif;font-size:14px;font-weight:400;line-height:1.5em;color:#333333;display:flex;position:relative;text-align:left;-webkit-font-smoothing:antialiased;font-smoothing:antialiased;text-rendering:optimizeSpeed!important;tap-highlight-color:rgba(0, 0, 0, 0);text-size-adjust:100%;}/*!sc*/
|
||||
.cSYMrW *{box-sizing:border-box;-webkit-tap-highlight-color:rgba(255, 255, 255, 0);}/*!sc*/
|
||||
data-styled.g132[id="sc-kUNLVD"]{content:"cSYMrW,"}/*!sc*/
|
||||
.cOuMek{z-index:1;position:relative;overflow:hidden;width:calc(100% - 260px);contain:layout;}/*!sc*/
|
||||
@media print,screen and (max-width: 50rem){.cOuMek{width:100%;}}/*!sc*/
|
||||
data-styled.g133[id="sc-dxfTlo"]{content:"cOuMek,"}/*!sc*/
|
||||
.bsunyy{background:#263238;position:absolute;top:0;bottom:0;right:0;width:calc((100% - 260px) * 0.4);}/*!sc*/
|
||||
@media print,screen and (max-width: 75rem){.bsunyy{display:none;}}/*!sc*/
|
||||
data-styled.g134[id="sc-juusvx"]{content:"bsunyy,"}/*!sc*/
|
||||
.cUtpgV{padding:5px 0;}/*!sc*/
|
||||
data-styled.g135[id="sc-emwzcK"]{content:"cUtpgV,"}/*!sc*/
|
||||
.iiRHzu{width:calc(100% - 40px);box-sizing:border-box;margin:0 20px;padding:5px 10px 5px 20px;border:0;border-bottom:1px solid #e1e1e1;font-family:Roboto,sans-serif;font-weight:bold;font-size:13px;color:#333333;background-color:transparent;outline:none;}/*!sc*/
|
||||
data-styled.g136[id="sc-kjKYmT"]{content:"iiRHzu,"}/*!sc*/
|
||||
.dvQijr{position:absolute;left:20px;height:1.8em;width:0.9em;}/*!sc*/
|
||||
.dvQijr path{fill:#333333;}/*!sc*/
|
||||
data-styled.g137[id="sc-cMdfCE"]{content:"dvQijr,"}/*!sc*/
|
||||
</style>
|
||||
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel="stylesheet">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="redoc"><div class="sc-kUNLVD cSYMrW redoc-wrap"><div class="sc-iqziPC hHYXMN menu-content" style="top:0px;height:calc(100vh - 0px)"><div role="search" class="sc-emwzcK cUtpgV"><svg class="sc-cMdfCE dvQijr search-icon" version="1.1" viewBox="0 0 1000 1000" x="0px" xmlns="http://www.w3.org/2000/svg" y="0px"><path d="M968.2,849.4L667.3,549c83.9-136.5,66.7-317.4-51.7-435.6C477.1-25,252.5-25,113.9,113.4c-138.5,138.3-138.5,362.6,0,501C219.2,730.1,413.2,743,547.6,666.5l301.9,301.4c43.6,43.6,76.9,14.9,104.2-12.4C981,928.3,1011.8,893,968.2,849.4z M524.5,522c-88.9,88.7-233,88.7-321.8,0c-88.9-88.7-88.9-232.6,0-321.3c88.9-88.7,233-88.7,321.8,0C613.4,289.4,613.4,433.3,524.5,522z"></path></svg><input placeholder="Search..." aria-label="Search" type="text" class="sc-kjKYmT iiRHzu search-input" value=""/></div><div class="sc-kMzELR kIqtpW scrollbar-container undefined"><ul role="menu" class="sc-YltrM fTlmpg"><li tabindex="0" depth="2" data-item-id="/paths/~1status/get" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="get" class="sc-dmcoYd gxSVta operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Get writer status</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1cancel/post" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="post" class="sc-dmcoYd gxSVta operation-type post">post</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">Cancel running data collection</span></label></li><li tabindex="0" depth="2" data-item-id="/paths/~1version/get" role="menuitem" class="sc-imiRDh kIUuLW"><label class="sc-vIyEI gvinAL -depth2"><span type="get" class="sc-dmcoYd gxSVta operation-type get">get</span><span tabindex="0" width="calc(100% - 38px)" class="sc-bjUHJT fXgHFV">/version</span></label></li></ul><div class="sc-eIPYkq dWVQcL"><a target="_blank" rel="noopener noreferrer" href="https://redocly.com/redoc/">API docs by Redocly</a></div></div></div><div class="sc-eXzmLu kHszPm"><div class="sc-iEYVpv bUvUmx"><svg class="" style="transform:translate(2px, -4px) rotate(180deg);transition:transform 0.2s ease" viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="15" height="15"><g transform="translate(904.92214,-879.1482)"><path d="
|
||||
m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
|
||||
-55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
|
||||
0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,
|
||||
-174.6858 c 96.079,-96.07721 175.253196,-174.68583 175.942696,
|
||||
-174.68583 0.6895,0 26.281,25.03215 56.8701,
|
||||
55.627 l 55.6165,55.627 -231.245496,231.24803 c -127.185,127.1864
|
||||
-231.5279,231.248 -231.873,231.248 -0.3451,0 -104.688,
|
||||
-104.0616 -231.873,-231.248 z
|
||||
" fill="currentColor"></path></g></svg><svg class="" style="transform:translate(2px, 4px);transition:transform 0.2s ease" viewBox="0 0 926.23699 573.74994" version="1.1" x="0px" y="0px" width="15" height="15"><g transform="translate(904.92214,-879.1482)"><path d="
|
||||
m -673.67664,1221.6502 -231.2455,-231.24803 55.6165,
|
||||
-55.627 c 30.5891,-30.59485 56.1806,-55.627 56.8701,-55.627 0.6894,
|
||||
0 79.8637,78.60862 175.9427,174.68583 l 174.6892,174.6858 174.6892,
|
||||
-174.6858 c 96.079,-96.07721 175.253196,-174.68583 175.942696,
|
||||
-174.68583 0.6895,0 26.281,25.03215 56.8701,
|
||||
55.627 l 55.6165,55.627 -231.245496,231.24803 c -127.185,127.1864
|
||||
-231.5279,231.248 -231.873,231.248 -0.3451,0 -104.688,
|
||||
-104.0616 -231.873,-231.248 z
|
||||
" fill="currentColor"></path></g></svg></div></div><div class="sc-dxfTlo cOuMek api-content"><div class="sc-eDLKkx hNzKJC"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY api-info"><h1 class="sc-fsYfdN sc-eFyDpN gqLiaw ObWVe">Jungfraujoch writer<!-- --> <span>(<!-- -->1.0.0.rc_11<!-- -->)</span></h1><p>Download OpenAPI specification<!-- -->:<a download="openapi.json" target="_blank" class="sc-crHHJw iGcmRf">Download</a></p><div class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"></div><div data-role="redoc-summary" html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"></div><div data-role="redoc-description" html="<p>Jungfraujoch Writer Web API</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"><p>Jungfraujoch Writer Web API</p>
|
||||
</div></div></div></div><div id="/paths/~1status/get" data-section-id="/paths/~1status/get" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1status/get" aria-label="/paths/~1status/get"></a>Get writer status<!-- --> </h2><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA fIqGlH"><svg class="sc-eTNRI hUWsvg" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>Statistics of the last measurement</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Statistics of the last measurement</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="get" class="sc-jYnQyy eIFDdZ http-verb get">get</span><span class="sc-fYrVWQ gllLir">/status</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/status</div></div></div></div></div><div><h3 class="sc-kFCroH klfnyk"> <!-- -->Response samples<!-- --> </h3><div class="sc-cyZbeP jSWvqu" data-rttabs="true"><ul class="react-tabs__tab-list" role="tablist"><li class="tab-success react-tabs__tab--selected" role="tab" id="react-tabs-0" aria-selected="true" aria-disabled="false" aria-controls="react-tabs-1" tabindex="0" data-rttab="true">200</li></ul><div class="react-tabs__tab-panel react-tabs__tab-panel--selected" role="tabpanel" id="react-tabs-1" aria-labelledby="react-tabs-0"><div><div class="sc-cPtzlb jBjImi"><span class="sc-bCvmQg eTZsJr">Content type</span><div class="sc-dQmiwx jCmKdj">application/json</div></div><div class="sc-hVcFVo jeLSWq"><div class="sc-cSxRuM fOJBdW"><div class="sc-gjLLEI iwAAMv"><button><div class="sc-jdHILj krcPXE">Copy</div></button></div><div class="sc-iKOmoZ WVNwY sc-jMbVJB DqFKH"><div class="redoc-json"><code><button class="collapser" aria-label="collapse"></button><span class="token punctuation">{</span><span class="ellipsis"></span><ul class="obj collapsible"><li><div class="hoverable "><span class="property token string">"nimages"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"performance_MBs"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"performance_Hz"</span>: <span class="token number">0.1</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"run_number"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"run_name"</span>: <span class="token string">"string"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"file_prefix"</span>: <span class="token string">"string"</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"socket_number"</span>: <span class="token number">0</span><span class="token punctuation">,</span></div></li><li><div class="hoverable "><span class="property token string">"state"</span>: <span class="token string">"idle"</span></div></li></ul><span class="token punctuation">}</span></code></div></div></div></div></div></div></div></div></div></div></div><div id="/paths/~1cancel/post" data-section-id="/paths/~1cancel/post" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1cancel/post" aria-label="/paths/~1cancel/post"></a>Cancel running data collection<!-- --> </h2><div class="sc-eYFTNc dZbpPF"><div html="<p>It only instructs writer to cancel, but doesn&#39;t wait for cancellation actually happening.
|
||||
It still requires to call <code>/wait_till_done</code></p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS"><p>It only instructs writer to cancel, but doesn't wait for cancellation actually happening.
|
||||
It still requires to call <code>/wait_till_done</code></p>
|
||||
</div></div><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA iSOCsR" disabled=""><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>Cancel message acknowledged</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Cancel message acknowledged</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="post" class="sc-jYnQyy jBKVIL http-verb post">post</span><span class="sc-fYrVWQ gllLir">/cancel</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/cancel</div></div></div></div></div></div></div></div><div id="/paths/~1version/get" data-section-id="/paths/~1version/get" class="sc-eDLKkx cSNAXN"><div class="sc-iBdnpw fsPUig"><div class="sc-hLQSwg gikxZY"><h2 class="sc-qZrbh gwJLUj"><a class="sc-csKJxZ fNhImz" href="#/paths/~1version/get" aria-label="/paths/~1version/get"></a>/version<!-- --> </h2><div><h3 class="sc-fYitVF duKVDl">Responses</h3><div><button class="sc-hsaIUA fIqGlH"><svg class="sc-eTNRI hUWsvg" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg><strong class="sc-gWQvRS ePkkgX">200<!-- --> </strong><div html="<p>Release number of Jungfraujoch</p>
|
||||
" class="sc-iKOmoZ sc-cCzLxZ WVNwY VEBGS sc-ckdEwu LxEPk"><p>Release number of Jungfraujoch</p>
|
||||
</div></button></div></div></div><div class="sc-jTQCzO sc-gLLuof imiXRU jGdkPR"><div class="sc-bPrlCs cIsduN"><button class="sc-GkLId bclCVA"><span type="get" class="sc-jYnQyy eIFDdZ http-verb get">get</span><span class="sc-fYrVWQ gllLir">/version</span><svg class="sc-eTNRI exoGJA" style="margin-right:-25px" version="1.1" viewBox="0 0 24 24" x="0" xmlns="http://www.w3.org/2000/svg" y="0" aria-hidden="true"><polygon points="17.3 8.3 12 13.6 6.7 8.3 5.3 9.7 12 16.4 18.7 9.7 "></polygon></svg></button><div aria-hidden="true" class="sc-eGgGjL hsEiws"><div class="sc-fnpiog jerStl"><div html="" class="sc-iKOmoZ sc-cCzLxZ WVNwY jaVotg"></div><div tabindex="0" role="button"><div class="sc-lkDHyp etvaCd"><span></span>/version</div></div></div></div></div></div></div></div></div><div class="sc-juusvx bsunyy"></div></div></div>
|
||||
<script>
|
||||
const __redoc_state = {"menu":{"activeItemIdx":-1},"spec":{"data":{"openapi":"3.0.3","info":{"title":"Jungfraujoch writer","description":"Jungfraujoch Writer Web API","version":"1.0.0.rc_11"},"components":{"schemas":{"writer_statistics":{"type":"object","properties":{"nimages":{"type":"integer","format":"int64","description":"Number of images written"},"performance_MBs":{"type":"number","format":"float","description":"Performance in MB/s"},"performance_Hz":{"type":"number","format":"float","description":"Performance in images/s"},"run_number":{"type":"integer","format":"int64"},"run_name":{"type":"string"},"file_prefix":{"type":"string","description":"File prefix for the last written dataset"},"socket_number":{"type":"integer","format":"int64","description":"Number of socket on `jfjoch_broker` side for the current/last data collection"},"state":{"type":"string","enum":["idle","started","receiving","error"]}}}}},"paths":{"/status":{"get":{"summary":"Get writer status","responses":{"200":{"description":"Statistics of the last measurement","content":{"application/json":{"schema":{"$ref":"#/components/schemas/writer_statistics"}}}}}}},"/cancel":{"post":{"summary":"Cancel running data collection","description":"It only instructs writer to cancel, but doesn't wait for cancellation actually happening.\nIt still requires to call `/wait_till_done`\n","responses":{"200":{"description":"Cancel message acknowledged"}}}},"/version":{"get":{"responses":{"200":{"description":"Release number of Jungfraujoch","content":{"text/plain":{"schema":{"type":"string","example":"1.0.0"}}}}}}}}}},"searchIndex":{"store":["/paths/~1status/get","/paths/~1cancel/post","/paths/~1version/get"],"index":{"version":"2.3.9","fields":["title","description"],"fieldVectors":[["title/0",[0,0.499,1,0.499]],["description/0",[1,0.699]],["title/1",[2,0.364,3,0.759,4,0.759,5,0.759]],["description/1",[0,0.284,2,0.55,6,0.593,7,0.593,8,0.593,9,0.593,10,0.593,11,0.593,12,0.593,13,0.593,14,0.593]],["title/2",[15,0.613]],["description/2",[15,0.699]]],"invertedIndex":[["actual",{"_index":9,"title":{},"description":{"1":{}}}],["call",{"_index":13,"title":{},"description":{"1":{}}}],["cancel",{"_index":2,"title":{"1":{}},"description":{"1":{}}}],["collect",{"_index":5,"title":{"1":{}},"description":{}}],["data",{"_index":4,"title":{"1":{}},"description":{}}],["doesn't",{"_index":7,"title":{},"description":{"1":{}}}],["happen",{"_index":10,"title":{},"description":{"1":{}}}],["instruct",{"_index":6,"title":{},"description":{"1":{}}}],["requir",{"_index":12,"title":{},"description":{"1":{}}}],["run",{"_index":3,"title":{"1":{}},"description":{}}],["statu",{"_index":1,"title":{"0":{}},"description":{"0":{}}}],["still",{"_index":11,"title":{},"description":{"1":{}}}],["version",{"_index":15,"title":{"2":{}},"description":{"2":{}}}],["wait",{"_index":8,"title":{},"description":{"1":{}}}],["wait_till_don",{"_index":14,"title":{},"description":{"1":{}}}],["writer",{"_index":0,"title":{"0":{}},"description":{"1":{}}}]],"pipeline":[]}},"options":{}};
|
||||
|
||||
var container = document.getElementById('redoc');
|
||||
Redoc.hydrate(__redoc_state, container);
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -1,77 +0,0 @@
|
||||
openapi: 3.0.3
|
||||
info:
|
||||
title: Jungfraujoch writer
|
||||
description: Jungfraujoch Writer Web API
|
||||
version: 1.0.0-rc.116
|
||||
contact:
|
||||
name: Filip Leonarski (Paul Scherrer Institute)
|
||||
email: filip.leonarski@psi.ch
|
||||
license:
|
||||
name: GPL-3.0
|
||||
url: https://www.gnu.org/licenses/gpl-3.0.html
|
||||
components:
|
||||
schemas:
|
||||
writer_statistics:
|
||||
type: object
|
||||
properties:
|
||||
nimages:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Number of images written
|
||||
performance_MBs:
|
||||
type: number
|
||||
format: float
|
||||
description: Performance in MB/s
|
||||
performance_Hz:
|
||||
type: number
|
||||
format: float
|
||||
description: Performance in images/s
|
||||
run_number:
|
||||
type: integer
|
||||
format: int64
|
||||
run_name:
|
||||
type: string
|
||||
file_prefix:
|
||||
type: string
|
||||
description: File prefix for the last written dataset
|
||||
socket_number:
|
||||
type: integer
|
||||
format: int64
|
||||
description: Number of socket on `jfjoch_broker` side for the current/last data collection
|
||||
state:
|
||||
type: string
|
||||
enum:
|
||||
- idle
|
||||
- started
|
||||
- receiving
|
||||
- error
|
||||
paths:
|
||||
/status:
|
||||
get:
|
||||
summary: Get writer status
|
||||
responses:
|
||||
"200":
|
||||
description: Statistics of the last measurement
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/writer_statistics'
|
||||
/cancel:
|
||||
post:
|
||||
summary: Cancel running data collection
|
||||
description: |
|
||||
It only instructs writer to cancel, but doesn't wait for cancellation actually happening.
|
||||
It still requires to call `/wait_till_done`
|
||||
responses:
|
||||
"200":
|
||||
description: Cancel message acknowledged
|
||||
/version:
|
||||
get:
|
||||
responses:
|
||||
"200":
|
||||
description: Release number of Jungfraujoch
|
||||
content:
|
||||
text/plain:
|
||||
schema:
|
||||
type: string
|
||||
example: 1.0.0
|
||||
Reference in New Issue
Block a user