Browse Source
Merge pull request #2245 from Bl1tz23/master
Simple healthcheck for S3 API Server
pull/2252/head
Chris Lu
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
15 additions and
3 deletions
-
weed/s3api/s3api_server.go
-
weed/s3api/s3api_status_handlers.go
|
|
@ -2,13 +2,13 @@ package s3api |
|
|
|
|
|
|
|
import ( |
|
|
|
"fmt" |
|
|
|
"github.com/chrislusf/seaweedfs/weed/filer" |
|
|
|
. "github.com/chrislusf/seaweedfs/weed/s3api/s3_constants" |
|
|
|
"github.com/chrislusf/seaweedfs/weed/s3api/s3err" |
|
|
|
"net/http" |
|
|
|
"strings" |
|
|
|
"time" |
|
|
|
|
|
|
|
"github.com/chrislusf/seaweedfs/weed/filer" |
|
|
|
. "github.com/chrislusf/seaweedfs/weed/s3api/s3_constants" |
|
|
|
"github.com/chrislusf/seaweedfs/weed/s3api/s3err" |
|
|
|
"github.com/gorilla/mux" |
|
|
|
"google.golang.org/grpc" |
|
|
|
) |
|
|
@ -45,6 +45,10 @@ func NewS3ApiServer(router *mux.Router, option *S3ApiServerOption) (s3ApiServer |
|
|
|
func (s3a *S3ApiServer) registerRouter(router *mux.Router) { |
|
|
|
// API Router
|
|
|
|
apiRouter := router.PathPrefix("/").Subrouter() |
|
|
|
|
|
|
|
// Readiness Probe
|
|
|
|
apiRouter.Methods("GET").Path("/status").HandlerFunc(s3a.StatusHandler) |
|
|
|
|
|
|
|
var routers []*mux.Router |
|
|
|
if s3a.option.DomainName != "" { |
|
|
|
domainNames := strings.Split(s3a.option.DomainName, ",") |
|
|
|
|
|
@ -0,0 +1,8 @@ |
|
|
|
package s3api |
|
|
|
|
|
|
|
import "net/http" |
|
|
|
|
|
|
|
func (s3a *S3ApiServer) StatusHandler(w http.ResponseWriter, r *http.Request) { |
|
|
|
// write out the response code and content type header
|
|
|
|
writeSuccessResponseEmpty(w) |
|
|
|
} |