PLT-2899 adding clustering of app servers (#3682)
* PLT-2899 adding clustering of app servers * PLT-2899 base framework * PLT-2899 HA backend * PLT-2899 Fixing config file * PLT-2899 adding config syncing * PLT-2899 set System console to readonly when clustering enabled. * PLT-2899 Fixing publish API * PLT-2899 fixing strings
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
ac90f5b389
Коммит
59d971dc75
@@ -4,6 +4,7 @@
|
||||
import request from 'superagent';
|
||||
|
||||
const HEADER_X_VERSION_ID = 'x-version-id';
|
||||
const HEADER_X_CLUSTER_ID = 'x-cluster-id';
|
||||
const HEADER_TOKEN = 'token';
|
||||
const HEADER_BEARER = 'BEARER';
|
||||
const HEADER_AUTH = 'Authorization';
|
||||
@@ -12,6 +13,7 @@ export default class Client {
|
||||
constructor() {
|
||||
this.teamId = '';
|
||||
this.serverVersion = '';
|
||||
this.clusterId = '';
|
||||
this.logToConsole = false;
|
||||
this.useToken = false;
|
||||
this.token = '';
|
||||
@@ -152,6 +154,11 @@ export default class Client {
|
||||
if (res.header[HEADER_X_VERSION_ID]) {
|
||||
this.serverVersion = res.header[HEADER_X_VERSION_ID];
|
||||
}
|
||||
|
||||
this.clusterId = res.header[HEADER_X_CLUSTER_ID];
|
||||
if (res.header[HEADER_X_CLUSTER_ID]) {
|
||||
this.clusterId = res.header[HEADER_X_CLUSTER_ID];
|
||||
}
|
||||
}
|
||||
|
||||
if (err) {
|
||||
@@ -295,6 +302,15 @@ export default class Client {
|
||||
end(this.handleResponse.bind(this, 'getLogs', success, error));
|
||||
}
|
||||
|
||||
getClusterStatus(success, error) {
|
||||
return request.
|
||||
get(`${this.getAdminRoute()}/cluster_status`).
|
||||
set(this.defaultHeaders).
|
||||
type('application/json').
|
||||
accept('application/json').
|
||||
end(this.handleResponse.bind(this, 'getClusterStatus', success, error));
|
||||
}
|
||||
|
||||
getServerAudits(success, error) {
|
||||
return request.
|
||||
get(`${this.getAdminRoute()}/audits`).
|
||||
|
||||
Ссылка в новой задаче
Block a user