From 8a77a298f2cfaa22ea9aa1637134d2eda4456677 Mon Sep 17 00:00:00 2001 From: Krishnan Parthasarathi Date: Tue, 19 Mar 2019 16:12:24 +0530 Subject: [PATCH] Add deploymentID to ServerInfo (#7372) --- cmd/admin-handlers.go | 22 ++++++++++++---------- pkg/madmin/info-commands.go | 11 ++++++----- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/cmd/admin-handlers.go b/cmd/admin-handlers.go index 5ba0651ae..9d3d8ba41 100644 --- a/cmd/admin-handlers.go +++ b/cmd/admin-handlers.go @@ -177,11 +177,12 @@ func (a adminAPIHandlers) ServiceStopNRestartHandler(w http.ResponseWriter, r *h // ServerProperties holds some server information such as, version, region // uptime, etc.. type ServerProperties struct { - Uptime time.Duration `json:"uptime"` - Version string `json:"version"` - CommitID string `json:"commitID"` - Region string `json:"region"` - SQSARN []string `json:"sqsARN"` + Uptime time.Duration `json:"uptime"` + Version string `json:"version"` + CommitID string `json:"commitID"` + DeploymentID string `json:"deploymentID"` + Region string `json:"region"` + SQSARN []string `json:"sqsARN"` } // ServerConnStats holds transferred bytes from/to the server @@ -256,11 +257,12 @@ func (a adminAPIHandlers) ServerInfoHandler(w http.ResponseWriter, r *http.Reque ConnStats: globalConnStats.toServerConnStats(), HTTPStats: globalHTTPStats.toServerHTTPStats(), Properties: ServerProperties{ - Uptime: UTCNow().Sub(globalBootTime), - Version: Version, - CommitID: CommitID, - SQSARN: globalNotificationSys.GetARNList(), - Region: globalServerConfig.GetRegion(), + Uptime: UTCNow().Sub(globalBootTime), + Version: Version, + CommitID: CommitID, + DeploymentID: globalDeploymentID, + SQSARN: globalNotificationSys.GetARNList(), + Region: globalServerConfig.GetRegion(), }, }, }) diff --git a/pkg/madmin/info-commands.go b/pkg/madmin/info-commands.go index 12479c3ff..1684be2b6 100644 --- a/pkg/madmin/info-commands.go +++ b/pkg/madmin/info-commands.go @@ -72,11 +72,12 @@ type StorageInfo struct { // ServerProperties holds some of the server's information such as uptime, // version, region, .. type ServerProperties struct { - Uptime time.Duration `json:"uptime"` - Version string `json:"version"` - CommitID string `json:"commitID"` - Region string `json:"region"` - SQSARN []string `json:"sqsARN"` + Uptime time.Duration `json:"uptime"` + Version string `json:"version"` + CommitID string `json:"commitID"` + DeploymentID string `json:"deploymentID"` + Region string `json:"region"` + SQSARN []string `json:"sqsARN"` } // ServerConnStats holds network information