Export import server config from settings page (#2664)

This commit is contained in:
Prakash Senthil Vel
2023-02-22 01:20:04 +05:30
committed by GitHub
parent 6c0e7baa87
commit f21434a971
20 changed files with 1397 additions and 22 deletions

View File

@@ -0,0 +1,88 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package configuration
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/models"
)
// ExportConfigHandlerFunc turns a function with the right signature into a export config handler
type ExportConfigHandlerFunc func(ExportConfigParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn ExportConfigHandlerFunc) Handle(params ExportConfigParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// ExportConfigHandler interface for that can handle valid export config params
type ExportConfigHandler interface {
Handle(ExportConfigParams, *models.Principal) middleware.Responder
}
// NewExportConfig creates a new http.Handler for the export config operation
func NewExportConfig(ctx *middleware.Context, handler ExportConfigHandler) *ExportConfig {
return &ExportConfig{Context: ctx, Handler: handler}
}
/*
ExportConfig swagger:route GET /configs/export Configuration exportConfig
Export the current config from MinIO server
*/
type ExportConfig struct {
Context *middleware.Context
Handler ExportConfigHandler
}
func (o *ExportConfig) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewExportConfigParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *models.Principal
if uprinc != nil {
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -0,0 +1,63 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package configuration
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime/middleware"
)
// NewExportConfigParams creates a new ExportConfigParams object
//
// There are no default values defined in the spec.
func NewExportConfigParams() ExportConfigParams {
return ExportConfigParams{}
}
// ExportConfigParams contains all the bound params for the export config operation
// typically these are obtained from a http.Request
//
// swagger:parameters ExportConfig
type ExportConfigParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewExportConfigParams() beforehand.
func (o *ExportConfigParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -0,0 +1,135 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package configuration
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/minio/console/models"
)
// ExportConfigOKCode is the HTTP code returned for type ExportConfigOK
const ExportConfigOKCode int = 200
/*
ExportConfigOK A successful response.
swagger:response exportConfigOK
*/
type ExportConfigOK struct {
/*
In: Body
*/
Payload *models.ConfigExportResponse `json:"body,omitempty"`
}
// NewExportConfigOK creates ExportConfigOK with default headers values
func NewExportConfigOK() *ExportConfigOK {
return &ExportConfigOK{}
}
// WithPayload adds the payload to the export config o k response
func (o *ExportConfigOK) WithPayload(payload *models.ConfigExportResponse) *ExportConfigOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the export config o k response
func (o *ExportConfigOK) SetPayload(payload *models.ConfigExportResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ExportConfigOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(200)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}
/*
ExportConfigDefault Generic error response.
swagger:response exportConfigDefault
*/
type ExportConfigDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewExportConfigDefault creates ExportConfigDefault with default headers values
func NewExportConfigDefault(code int) *ExportConfigDefault {
if code <= 0 {
code = 500
}
return &ExportConfigDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the export config default response
func (o *ExportConfigDefault) WithStatusCode(code int) *ExportConfigDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the export config default response
func (o *ExportConfigDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the export config default response
func (o *ExportConfigDefault) WithPayload(payload *models.Error) *ExportConfigDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the export config default response
func (o *ExportConfigDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *ExportConfigDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(o._statusCode)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}

View File

@@ -0,0 +1,104 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package configuration
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// ExportConfigURL generates an URL for the export config operation
type ExportConfigURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *ExportConfigURL) WithBasePath(bp string) *ExportConfigURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *ExportConfigURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *ExportConfigURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/configs/export"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *ExportConfigURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *ExportConfigURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *ExportConfigURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on ExportConfigURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on ExportConfigURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *ExportConfigURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -0,0 +1,88 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package configuration
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"net/http"
"github.com/go-openapi/runtime/middleware"
"github.com/minio/console/models"
)
// PostConfigsImportHandlerFunc turns a function with the right signature into a post configs import handler
type PostConfigsImportHandlerFunc func(PostConfigsImportParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn PostConfigsImportHandlerFunc) Handle(params PostConfigsImportParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// PostConfigsImportHandler interface for that can handle valid post configs import params
type PostConfigsImportHandler interface {
Handle(PostConfigsImportParams, *models.Principal) middleware.Responder
}
// NewPostConfigsImport creates a new http.Handler for the post configs import operation
func NewPostConfigsImport(ctx *middleware.Context, handler PostConfigsImportHandler) *PostConfigsImport {
return &PostConfigsImport{Context: ctx, Handler: handler}
}
/*
PostConfigsImport swagger:route POST /configs/import Configuration postConfigsImport
Uploads an Object.
*/
type PostConfigsImport struct {
Context *middleware.Context
Handler PostConfigsImportHandler
}
func (o *PostConfigsImport) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewPostConfigsImportParams()
uprinc, aCtx, err := o.Context.Authorize(r, route)
if err != nil {
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
if aCtx != nil {
*r = *aCtx
}
var principal *models.Principal
if uprinc != nil {
principal = uprinc.(*models.Principal) // this is really a models.Principal, I promise
}
if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
o.Context.Respond(rw, r, route.Produces, route, err)
return
}
res := o.Handler.Handle(Params, principal) // actually handle the request
o.Context.Respond(rw, r, route.Produces, route, res)
}

View File

@@ -0,0 +1,103 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package configuration
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"io"
"mime/multipart"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
)
// PostConfigsImportMaxParseMemory sets the maximum size in bytes for
// the multipart form parser for this operation.
//
// The default value is 32 MB.
// The multipart parser stores up to this + 10MB.
var PostConfigsImportMaxParseMemory int64 = 32 << 20
// NewPostConfigsImportParams creates a new PostConfigsImportParams object
//
// There are no default values defined in the spec.
func NewPostConfigsImportParams() PostConfigsImportParams {
return PostConfigsImportParams{}
}
// PostConfigsImportParams contains all the bound params for the post configs import operation
// typically these are obtained from a http.Request
//
// swagger:parameters PostConfigsImport
type PostConfigsImportParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
Required: true
In: formData
*/
File io.ReadCloser
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
// To ensure default values, the struct must have been initialized with NewPostConfigsImportParams() beforehand.
func (o *PostConfigsImportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if err := r.ParseMultipartForm(PostConfigsImportMaxParseMemory); err != nil {
if err != http.ErrNotMultipart {
return errors.New(400, "%v", err)
} else if err := r.ParseForm(); err != nil {
return errors.New(400, "%v", err)
}
}
file, fileHeader, err := r.FormFile("file")
if err != nil {
res = append(res, errors.New(400, "reading file %q failed: %v", "file", err))
} else if err := o.bindFile(file, fileHeader); err != nil {
// Required: true
res = append(res, err)
} else {
o.File = &runtime.File{Data: file, Header: fileHeader}
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// bindFile binds file parameter File.
//
// The only supported validations on files are MinLength and MaxLength
func (o *PostConfigsImportParams) bindFile(file multipart.File, header *multipart.FileHeader) error {
return nil
}

View File

@@ -0,0 +1,115 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package configuration
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/minio/console/models"
)
// PostConfigsImportOKCode is the HTTP code returned for type PostConfigsImportOK
const PostConfigsImportOKCode int = 200
/*
PostConfigsImportOK A successful response.
swagger:response postConfigsImportOK
*/
type PostConfigsImportOK struct {
}
// NewPostConfigsImportOK creates PostConfigsImportOK with default headers values
func NewPostConfigsImportOK() *PostConfigsImportOK {
return &PostConfigsImportOK{}
}
// WriteResponse to the client
func (o *PostConfigsImportOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
rw.WriteHeader(200)
}
/*
PostConfigsImportDefault Generic error response.
swagger:response postConfigsImportDefault
*/
type PostConfigsImportDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewPostConfigsImportDefault creates PostConfigsImportDefault with default headers values
func NewPostConfigsImportDefault(code int) *PostConfigsImportDefault {
if code <= 0 {
code = 500
}
return &PostConfigsImportDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the post configs import default response
func (o *PostConfigsImportDefault) WithStatusCode(code int) *PostConfigsImportDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the post configs import default response
func (o *PostConfigsImportDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the post configs import default response
func (o *PostConfigsImportDefault) WithPayload(payload *models.Error) *PostConfigsImportDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the post configs import default response
func (o *PostConfigsImportDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *PostConfigsImportDefault) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(o._statusCode)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}

View File

@@ -0,0 +1,104 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2023 MinIO, Inc.
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
package configuration
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
)
// PostConfigsImportURL generates an URL for the post configs import operation
type PostConfigsImportURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *PostConfigsImportURL) WithBasePath(bp string) *PostConfigsImportURL {
o.SetBasePath(bp)
return o
}
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
func (o *PostConfigsImportURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *PostConfigsImportURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/configs/import"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *PostConfigsImportURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
if u == nil {
panic("url can't be nil")
}
return u
}
// String returns the string representation of the path with query string
func (o *PostConfigsImportURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *PostConfigsImportURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on PostConfigsImportURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on PostConfigsImportURL")
}
base, err := o.Build()
if err != nil {
return nil, err
}
base.Scheme = scheme
base.Host = host
return base, nil
}
// StringFull returns the string representation of a complete url
func (o *PostConfigsImportURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -217,6 +217,9 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
BucketEnableBucketEncryptionHandler: bucket.EnableBucketEncryptionHandlerFunc(func(params bucket.EnableBucketEncryptionParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation bucket.EnableBucketEncryption has not yet been implemented")
}),
ConfigurationExportConfigHandler: configuration.ExportConfigHandlerFunc(func(params configuration.ExportConfigParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation configuration.ExportConfig has not yet been implemented")
}),
BucketGetBucketEncryptionInfoHandler: bucket.GetBucketEncryptionInfoHandlerFunc(func(params bucket.GetBucketEncryptionInfoParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation bucket.GetBucketEncryptionInfo has not yet been implemented")
}),
@@ -421,6 +424,9 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
ObjectPostBucketsBucketNameObjectsUploadHandler: object.PostBucketsBucketNameObjectsUploadHandlerFunc(func(params object.PostBucketsBucketNameObjectsUploadParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation object.PostBucketsBucketNameObjectsUpload has not yet been implemented")
}),
ConfigurationPostConfigsImportHandler: configuration.PostConfigsImportHandlerFunc(func(params configuration.PostConfigsImportParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation configuration.PostConfigsImport has not yet been implemented")
}),
ProfileProfilingStartHandler: profile.ProfilingStartHandlerFunc(func(params profile.ProfilingStartParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation profile.ProfilingStart has not yet been implemented")
}),
@@ -696,6 +702,8 @@ type ConsoleAPI struct {
TieringEditTierCredentialsHandler tiering.EditTierCredentialsHandler
// BucketEnableBucketEncryptionHandler sets the operation handler for the enable bucket encryption operation
BucketEnableBucketEncryptionHandler bucket.EnableBucketEncryptionHandler
// ConfigurationExportConfigHandler sets the operation handler for the export config operation
ConfigurationExportConfigHandler configuration.ExportConfigHandler
// BucketGetBucketEncryptionInfoHandler sets the operation handler for the get bucket encryption info operation
BucketGetBucketEncryptionInfoHandler bucket.GetBucketEncryptionInfoHandler
// BucketGetBucketLifecycleHandler sets the operation handler for the get bucket lifecycle operation
@@ -832,6 +840,8 @@ type ConsoleAPI struct {
PolicyPolicyInfoHandler policy.PolicyInfoHandler
// ObjectPostBucketsBucketNameObjectsUploadHandler sets the operation handler for the post buckets bucket name objects upload operation
ObjectPostBucketsBucketNameObjectsUploadHandler object.PostBucketsBucketNameObjectsUploadHandler
// ConfigurationPostConfigsImportHandler sets the operation handler for the post configs import operation
ConfigurationPostConfigsImportHandler configuration.PostConfigsImportHandler
// ProfileProfilingStartHandler sets the operation handler for the profiling start operation
ProfileProfilingStartHandler profile.ProfilingStartHandler
// ProfileProfilingStopHandler sets the operation handler for the profiling stop operation
@@ -1136,6 +1146,9 @@ func (o *ConsoleAPI) Validate() error {
if o.BucketEnableBucketEncryptionHandler == nil {
unregistered = append(unregistered, "bucket.EnableBucketEncryptionHandler")
}
if o.ConfigurationExportConfigHandler == nil {
unregistered = append(unregistered, "configuration.ExportConfigHandler")
}
if o.BucketGetBucketEncryptionInfoHandler == nil {
unregistered = append(unregistered, "bucket.GetBucketEncryptionInfoHandler")
}
@@ -1340,6 +1353,9 @@ func (o *ConsoleAPI) Validate() error {
if o.ObjectPostBucketsBucketNameObjectsUploadHandler == nil {
unregistered = append(unregistered, "object.PostBucketsBucketNameObjectsUploadHandler")
}
if o.ConfigurationPostConfigsImportHandler == nil {
unregistered = append(unregistered, "configuration.PostConfigsImportHandler")
}
if o.ProfileProfilingStartHandler == nil {
unregistered = append(unregistered, "profile.ProfilingStartHandler")
}
@@ -1748,6 +1764,10 @@ func (o *ConsoleAPI) initHandlerCache() {
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/configs/export"] = configuration.NewExportConfig(o.context, o.ConfigurationExportConfigHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/buckets/{bucket_name}/encryption/info"] = bucket.NewGetBucketEncryptionInfo(o.context, o.BucketGetBucketEncryptionInfoHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
@@ -2020,6 +2040,10 @@ func (o *ConsoleAPI) initHandlerCache() {
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/configs/import"] = configuration.NewPostConfigsImport(o.context, o.ConfigurationPostConfigsImportHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/profiling/start"] = profile.NewProfilingStart(o.context, o.ProfileProfilingStartHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)