Add Tagging for Buckets to Console (#1193)

This commit is contained in:
adfost
2021-11-11 18:36:18 -08:00
committed by GitHub
parent 3638455abb
commit 000071e414
17 changed files with 1319 additions and 10 deletions

View File

@@ -284,6 +284,9 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
AdminAPIProfilingStopHandler: admin_api.ProfilingStopHandlerFunc(func(params admin_api.ProfilingStopParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation admin_api.ProfilingStop has not yet been implemented")
}),
UserAPIPutBucketTagsHandler: user_api.PutBucketTagsHandlerFunc(func(params user_api.PutBucketTagsParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation user_api.PutBucketTags has not yet been implemented")
}),
UserAPIPutObjectLegalHoldHandler: user_api.PutObjectLegalHoldHandlerFunc(func(params user_api.PutObjectLegalHoldParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation user_api.PutObjectLegalHold has not yet been implemented")
}),
@@ -560,6 +563,8 @@ type ConsoleAPI struct {
AdminAPIProfilingStartHandler admin_api.ProfilingStartHandler
// AdminAPIProfilingStopHandler sets the operation handler for the profiling stop operation
AdminAPIProfilingStopHandler admin_api.ProfilingStopHandler
// UserAPIPutBucketTagsHandler sets the operation handler for the put bucket tags operation
UserAPIPutBucketTagsHandler user_api.PutBucketTagsHandler
// UserAPIPutObjectLegalHoldHandler sets the operation handler for the put object legal hold operation
UserAPIPutObjectLegalHoldHandler user_api.PutObjectLegalHoldHandler
// UserAPIPutObjectRestoreHandler sets the operation handler for the put object restore operation
@@ -916,6 +921,9 @@ func (o *ConsoleAPI) Validate() error {
if o.AdminAPIProfilingStopHandler == nil {
unregistered = append(unregistered, "admin_api.ProfilingStopHandler")
}
if o.UserAPIPutBucketTagsHandler == nil {
unregistered = append(unregistered, "user_api.PutBucketTagsHandler")
}
if o.UserAPIPutObjectLegalHoldHandler == nil {
unregistered = append(unregistered, "user_api.PutObjectLegalHoldHandler")
}
@@ -1388,6 +1396,10 @@ func (o *ConsoleAPI) initHandlerCache() {
if o.handlers["PUT"] == nil {
o.handlers["PUT"] = make(map[string]http.Handler)
}
o.handlers["PUT"]["/buckets/{bucket_name}/tags"] = user_api.NewPutBucketTags(o.context, o.UserAPIPutBucketTagsHandler)
if o.handlers["PUT"] == nil {
o.handlers["PUT"] = make(map[string]http.Handler)
}
o.handlers["PUT"]["/buckets/{bucket_name}/objects/legalhold"] = user_api.NewPutObjectLegalHold(o.context, o.UserAPIPutObjectLegalHoldHandler)
if o.handlers["PUT"] == nil {
o.handlers["PUT"] = make(map[string]http.Handler)