The response entity type (XML or JSON) may be specified as the 'format' option in the
request and defaults to JSON if not specified.
+Info
+====
+
+Get RGW cluster/endpoint information.
+
+:caps: info=read
+
+
+Syntax
+~~~~~~
+
+::
+
+ GET /{admin}/info?format=json HTTP/1.1
+ Host: {fqdn}
+
+
+Request Parameters
+~~~~~~~~~~~~~~~~~~
+
+None.
+
+
+Response Entities
+~~~~~~~~~~~~~~~~~
+
+If successful, the response contains an ``info`` section.
+
+``info``
+
+:Description: A container for all returned information.
+:Type: Container
+
+``cluster_id``
+
+:Description: The (typically unique) identifier for the controlling
+ backing store for the RGW cluster. In the typical case,
+ this is value returned from librados::rados::cluster_fsid().
+:Type: String
+:Parent: ``info``
+
+
+Special Error Responses
+~~~~~~~~~~~~~~~~~~~~~~~
+
+None.
+
+
Get Usage
=========
rgw_rest_realm.cc
rgw_rest_swift.cc
rgw_rest_usage.cc
+ rgw_rest_info.cc
rgw_rest_user.cc
rgw_swift_auth.cc
rgw_usage.cc
"users",
"buckets",
"metadata",
+ "info",
"usage",
"zone",
"bilog",
#include "rgw_rest_s3.h"
#include "rgw_rest_swift.h"
#include "rgw_rest_admin.h"
+#include "rgw_rest_info.h"
#include "rgw_rest_usage.h"
#include "rgw_rest_user.h"
#include "rgw_rest_bucket.h"
if (apis_map.count("admin") > 0) {
RGWRESTMgr_Admin *admin_resource = new RGWRESTMgr_Admin;
+ admin_resource->register_resource("info", new RGWRESTMgr_Info);
admin_resource->register_resource("usage", new RGWRESTMgr_Usage);
admin_resource->register_resource("user", new RGWRESTMgr_User);
/* XXX dang part of this is RADOS specific */
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab ft=cpp
+
+#include "rgw_op.h"
+#include "rgw_rest_info.h"
+#include "rgw_sal.h"
+
+#define dout_subsys ceph_subsys_rgw
+
+class RGWOp_Info_Get : public RGWRESTOp {
+
+public:
+ RGWOp_Info_Get() {}
+
+ int check_caps(const RGWUserCaps& caps) override {
+ return caps.check_cap("info", RGW_CAP_READ);
+ }
+ void execute(optional_yield y) override;
+
+ const char* name() const override { return "get_info"; }
+};
+
+void RGWOp_Info_Get::execute(optional_yield y) {
+ Formatter *formatter = flusher.get_formatter();
+ flusher.start(0);
+
+ // extensible array of general info sections
+ formatter->open_object_section("dummy");
+ formatter->open_object_section("info");
+ formatter->dump_string("cluster_id", store->get_cluster_id(this, y));
+ formatter->close_section();
+ formatter->close_section();
+
+ flusher.flush();
+} /* RGWOp_Info_Get::execute */
+
+RGWOp *RGWHandler_Info::op_get()
+{
+ return new RGWOp_Info_Get;
+}
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab ft=cpp
+
+#pragma once
+
+#include "rgw_rest.h"
+#include "rgw_rest_s3.h"
+
+
+class RGWHandler_Info : public RGWHandler_Auth_S3 {
+protected:
+ RGWOp *op_get() override;
+public:
+ using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
+ ~RGWHandler_Info() override = default;
+
+ int read_permissions(RGWOp*, optional_yield) override {
+ return 0;
+ }
+};
+
+class RGWRESTMgr_Info : public RGWRESTMgr {
+public:
+ RGWRESTMgr_Info() = default;
+ ~RGWRESTMgr_Info() override = default;
+
+ RGWHandler_REST* get_handler(rgw::sal::Store* store,
+ struct req_state*,
+ const rgw::auth::StrategyRegistry& auth_registry,
+ const std::string&) override {
+ return new RGWHandler_Info(auth_registry);
+ }
+};