Adding delete remote bucket functionality (#1762)

This commit is contained in:
adfost
2022-03-28 15:36:23 -07:00
committed by GitHub
parent fcd50257ee
commit d1a5e5ba57
13 changed files with 962 additions and 54 deletions

View File

@@ -171,6 +171,9 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
UserAPIDeleteRemoteBucketHandler: user_api.DeleteRemoteBucketHandlerFunc(func(params user_api.DeleteRemoteBucketParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation user_api.DeleteRemoteBucket has not yet been implemented")
}),
UserAPIDeleteSelectedReplicationRulesHandler: user_api.DeleteSelectedReplicationRulesHandlerFunc(func(params user_api.DeleteSelectedReplicationRulesParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation user_api.DeleteSelectedReplicationRules has not yet been implemented")
}),
UserAPIDeleteServiceAccountHandler: user_api.DeleteServiceAccountHandlerFunc(func(params user_api.DeleteServiceAccountParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation user_api.DeleteServiceAccount has not yet been implemented")
}),
@@ -537,6 +540,8 @@ type ConsoleAPI struct {
UserAPIDeleteObjectRetentionHandler user_api.DeleteObjectRetentionHandler
// UserAPIDeleteRemoteBucketHandler sets the operation handler for the delete remote bucket operation
UserAPIDeleteRemoteBucketHandler user_api.DeleteRemoteBucketHandler
// UserAPIDeleteSelectedReplicationRulesHandler sets the operation handler for the delete selected replication rules operation
UserAPIDeleteSelectedReplicationRulesHandler user_api.DeleteSelectedReplicationRulesHandler
// UserAPIDeleteServiceAccountHandler sets the operation handler for the delete service account operation
UserAPIDeleteServiceAccountHandler user_api.DeleteServiceAccountHandler
// UserAPIDisableBucketEncryptionHandler sets the operation handler for the disable bucket encryption operation
@@ -889,6 +894,9 @@ func (o *ConsoleAPI) Validate() error {
if o.UserAPIDeleteRemoteBucketHandler == nil {
unregistered = append(unregistered, "user_api.DeleteRemoteBucketHandler")
}
if o.UserAPIDeleteSelectedReplicationRulesHandler == nil {
unregistered = append(unregistered, "user_api.DeleteSelectedReplicationRulesHandler")
}
if o.UserAPIDeleteServiceAccountHandler == nil {
unregistered = append(unregistered, "user_api.DeleteServiceAccountHandler")
}
@@ -1372,6 +1380,10 @@ func (o *ConsoleAPI) initHandlerCache() {
if o.handlers["DELETE"] == nil {
o.handlers["DELETE"] = make(map[string]http.Handler)
}
o.handlers["DELETE"]["/buckets/{bucket_name}/delete-selected-replication-rules"] = user_api.NewDeleteSelectedReplicationRules(o.context, o.UserAPIDeleteSelectedReplicationRulesHandler)
if o.handlers["DELETE"] == nil {
o.handlers["DELETE"] = make(map[string]http.Handler)
}
o.handlers["DELETE"]["/service-accounts/{access_key}"] = user_api.NewDeleteServiceAccount(o.context, o.UserAPIDeleteServiceAccountHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)