forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure_snitch.hh
37 lines (29 loc) · 972 Bytes
/
azure_snitch.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
*/
/*
* SPDX-License-Identifier: (AGPL-3.0-or-later and Apache-2.0)
*/
/*
* Modified by ScyllaDB
* Copyright (C) 2021-present ScyllaDB
*/
#pragma once
#include "locator/production_snitch_base.hh"
namespace locator {
class azure_snitch : public production_snitch_base {
public:
static constexpr auto AZURE_SERVER_ADDR = "169.254.169.254";
static constexpr auto AZURE_QUERY_PATH_TEMPLATE = "/metadata/instance/compute/{}?api-version=2020-09-01&format=text";
static const std::string REGION_NAME_QUERY_PATH;
static const std::string ZONE_NAME_QUERY_PATH;
explicit azure_snitch(const sstring& fname = "", unsigned io_cpu_id = 0);
virtual future<> start() override;
virtual sstring get_name() const override {
return "org.apache.cassandra.locator.AzureSnitch";
}
protected:
future<> load_config();
future<sstring> azure_api_call(sstring path);
future<sstring> read_property_file();
};
} // namespace locator