cosmium/api/handlers/server_info.go

43 lines
1.9 KiB
Go
Raw Normal View History

2024-02-10 15:17:34 +00:00
package handlers
import (
2024-02-27 18:27:51 +00:00
"fmt"
2024-02-10 15:17:34 +00:00
"net/http"
"github.com/gin-gonic/gin"
2024-02-27 18:27:51 +00:00
"github.com/pikami/cosmium/api/config"
2024-02-10 15:17:34 +00:00
)
func GetServerInfo(c *gin.Context) {
2024-02-27 18:27:51 +00:00
c.IndentedJSON(http.StatusOK, gin.H{
"_self": "",
"id": config.Config.DatabaseAccount,
"_rid": fmt.Sprintf("%s.%s", config.Config.DatabaseAccount, config.Config.DatabaseDomain),
"media": "//media/",
"addresses": "//addresses/",
"_dbs": "//dbs/",
"writableLocations": []map[string]interface{}{
{
"name": "South Central US",
"databaseAccountEndpoint": config.Config.DatabaseEndpoint,
},
},
"readableLocations": []map[string]interface{}{
{
"name": "South Central US",
"databaseAccountEndpoint": config.Config.DatabaseEndpoint,
},
},
"enableMultipleWriteLocations": false,
"userReplicationPolicy": map[string]interface{}{
"asyncReplication": false,
"minReplicaSetSize": 1,
"maxReplicasetSize": 4,
},
"userConsistencyPolicy": map[string]interface{}{"defaultConsistencyLevel": "Session"},
"systemReplicationPolicy": map[string]interface{}{"minReplicaSetSize": 1, "maxReplicasetSize": 4},
"readPolicy": map[string]interface{}{"primaryReadCoefficient": 1, "secondaryReadCoefficient": 1},
"queryEngineConfiguration": "{\"allowNewKeywords\":true,\"maxJoinsPerSqlQuery\":10,\"maxQueryRequestTimeoutFraction\":0.9,\"maxSqlQueryInputLength\":524288,\"maxUdfRefPerSqlQuery\":10,\"queryMaxInMemorySortDocumentCount\":-1000,\"spatialMaxGeometryPointCount\":256,\"sqlAllowNonFiniteNumbers\":false,\"sqlDisableOptimizationFlags\":0,\"enableSpatialIndexing\":true,\"maxInExpressionItemsCount\":2147483647,\"maxLogicalAndPerSqlQuery\":2147483647,\"maxLogicalOrPerSqlQuery\":2147483647,\"maxSpatialQueryCells\":2147483647,\"sqlAllowAggregateFunctions\":true,\"sqlAllowGroupByClause\":true,\"sqlAllowLike\":true,\"sqlAllowSubQuery\":true,\"sqlAllowScalarSubQuery\":true,\"sqlAllowTop\":true}",
})
2024-02-10 15:17:34 +00:00
}