diff --git a/common/types/admin.go b/common/types/admin.go index e743757f5a3..e18ca617a63 100644 --- a/common/types/admin.go +++ b/common/types/admin.go @@ -41,6 +41,8 @@ type DescribeClusterResponse struct { SupportedClientVersions *SupportedClientVersions `json:"supportedClientVersions,omitempty"` MembershipInfo *MembershipInfo `json:"membershipInfo,omitempty"` PersistenceInfo map[string]*PersistenceInfo `json:"persistenceInfo,omitempty"` + SchemaVersion string `json:"schemaVersion,omitempty"` + StaticConfig Any `json:"staticConfig,omitempty"` // Dont know what type to return here , should I make a new type for this? } // AdminDescribeWorkflowExecutionRequest is an internal type (TBD...) diff --git a/service/frontend/admin/handler.go b/service/frontend/admin/handler.go index 6122e96d517..045be6922f7 100644 --- a/service/frontend/admin/handler.go +++ b/service/frontend/admin/handler.go @@ -38,6 +38,7 @@ import ( "github.com/uber/cadence/common/client" "github.com/uber/cadence/common/clock" "github.com/uber/cadence/common/codec" + "github.com/uber/cadence/common/config" "github.com/uber/cadence/common/definition" "github.com/uber/cadence/common/domain" dc "github.com/uber/cadence/common/dynamicconfig" @@ -899,6 +900,24 @@ func (adh *adminHandlerImpl) DescribeCluster( membershipInfo.Rings = rings } + __ := &config.Persistence{ + DefaultStore: "nosql", + DataStores: map[string]config.DataStore{ + "nosql": { + NoSQL: &config.NoSQL{}, + }, + }, + // All configs + } + + /* db = db.connection and read schema version from there + db, err := sql.NewSQLAdminDB(cfg) + if err != nil { + return nil, err + } + */ + + return &types.DescribeClusterResponse{ SupportedClientVersions: &types.SupportedClientVersions{ GoSdk: client.SupportedGoSDKVersion, @@ -909,6 +928,8 @@ func (adh *adminHandlerImpl) DescribeCluster( "visibilityStore": &visibilityStoreInfo, "historyStore": &historyStoreInfo, }, + SchemaVersion: "1", + StaticConfig: types.Any{}, }, nil } @@ -1844,3 +1865,11 @@ func convertFilterListToMap(filters []*types.DynamicConfigFilter) (map[dc.Filter } return newFilters, nil } + +func (adh *adminHandlerImpl) getPersistenceInfo() *PersistenceInfo { + // Fetch schema version from the persistence layer + schemaVer, _ := adh.persistenceManager.GetSchemaVersion() + return &PersistenceInfo{ + Version: schemaVer, + } +} \ No newline at end of file