Deprecated Site Replication in UI (#3469)

* Deprecated Sire Replication in UI

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>

* fix-workflow-issue

---------

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>
Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2024-11-11 14:26:19 -06:00
committed by GitHub
parent 18e50975d4
commit 4e5dcf0fc3
53 changed files with 15 additions and 6455 deletions

View File

@@ -51,7 +51,6 @@ import (
"github.com/minio/console/api/operations/release"
"github.com/minio/console/api/operations/service"
"github.com/minio/console/api/operations/service_account"
"github.com/minio/console/api/operations/site_replication"
"github.com/minio/console/api/operations/system"
"github.com/minio/console/api/operations/tiering"
"github.com/minio/console/api/operations/user"
@@ -262,12 +261,6 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
ServiceAccountGetServiceAccountHandler: service_account.GetServiceAccountHandlerFunc(func(params service_account.GetServiceAccountParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation service_account.GetServiceAccount has not yet been implemented")
}),
SiteReplicationGetSiteReplicationInfoHandler: site_replication.GetSiteReplicationInfoHandlerFunc(func(params site_replication.GetSiteReplicationInfoParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation site_replication.GetSiteReplicationInfo has not yet been implemented")
}),
SiteReplicationGetSiteReplicationStatusHandler: site_replication.GetSiteReplicationStatusHandlerFunc(func(params site_replication.GetSiteReplicationStatusParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation site_replication.GetSiteReplicationStatus has not yet been implemented")
}),
TieringGetTierHandler: tiering.GetTierHandlerFunc(func(params tiering.GetTierParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation tiering.GetTier has not yet been implemented")
}),
@@ -457,15 +450,6 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
ObjectShareObjectHandler: object.ShareObjectHandlerFunc(func(params object.ShareObjectParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation object.ShareObject has not yet been implemented")
}),
SiteReplicationSiteReplicationEditHandler: site_replication.SiteReplicationEditHandlerFunc(func(params site_replication.SiteReplicationEditParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation site_replication.SiteReplicationEdit has not yet been implemented")
}),
SiteReplicationSiteReplicationInfoAddHandler: site_replication.SiteReplicationInfoAddHandlerFunc(func(params site_replication.SiteReplicationInfoAddParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation site_replication.SiteReplicationInfoAdd has not yet been implemented")
}),
SiteReplicationSiteReplicationRemoveHandler: site_replication.SiteReplicationRemoveHandlerFunc(func(params site_replication.SiteReplicationRemoveParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation site_replication.SiteReplicationRemove has not yet been implemented")
}),
TieringTiersListHandler: tiering.TiersListHandlerFunc(func(params tiering.TiersListParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation tiering.TiersList has not yet been implemented")
}),
@@ -676,10 +660,6 @@ type ConsoleAPI struct {
PolicyGetSAUserPolicyHandler policy.GetSAUserPolicyHandler
// ServiceAccountGetServiceAccountHandler sets the operation handler for the get service account operation
ServiceAccountGetServiceAccountHandler service_account.GetServiceAccountHandler
// SiteReplicationGetSiteReplicationInfoHandler sets the operation handler for the get site replication info operation
SiteReplicationGetSiteReplicationInfoHandler site_replication.GetSiteReplicationInfoHandler
// SiteReplicationGetSiteReplicationStatusHandler sets the operation handler for the get site replication status operation
SiteReplicationGetSiteReplicationStatusHandler site_replication.GetSiteReplicationStatusHandler
// TieringGetTierHandler sets the operation handler for the get tier operation
TieringGetTierHandler tiering.GetTierHandler
// UserGetUserInfoHandler sets the operation handler for the get user info operation
@@ -806,12 +786,6 @@ type ConsoleAPI struct {
PolicySetPolicyMultipleHandler policy.SetPolicyMultipleHandler
// ObjectShareObjectHandler sets the operation handler for the share object operation
ObjectShareObjectHandler object.ShareObjectHandler
// SiteReplicationSiteReplicationEditHandler sets the operation handler for the site replication edit operation
SiteReplicationSiteReplicationEditHandler site_replication.SiteReplicationEditHandler
// SiteReplicationSiteReplicationInfoAddHandler sets the operation handler for the site replication info add operation
SiteReplicationSiteReplicationInfoAddHandler site_replication.SiteReplicationInfoAddHandler
// SiteReplicationSiteReplicationRemoveHandler sets the operation handler for the site replication remove operation
SiteReplicationSiteReplicationRemoveHandler site_replication.SiteReplicationRemoveHandler
// TieringTiersListHandler sets the operation handler for the tiers list operation
TieringTiersListHandler tiering.TiersListHandler
// TieringTiersListNamesHandler sets the operation handler for the tiers list names operation
@@ -1100,12 +1074,6 @@ func (o *ConsoleAPI) Validate() error {
if o.ServiceAccountGetServiceAccountHandler == nil {
unregistered = append(unregistered, "service_account.GetServiceAccountHandler")
}
if o.SiteReplicationGetSiteReplicationInfoHandler == nil {
unregistered = append(unregistered, "site_replication.GetSiteReplicationInfoHandler")
}
if o.SiteReplicationGetSiteReplicationStatusHandler == nil {
unregistered = append(unregistered, "site_replication.GetSiteReplicationStatusHandler")
}
if o.TieringGetTierHandler == nil {
unregistered = append(unregistered, "tiering.GetTierHandler")
}
@@ -1295,15 +1263,6 @@ func (o *ConsoleAPI) Validate() error {
if o.ObjectShareObjectHandler == nil {
unregistered = append(unregistered, "object.ShareObjectHandler")
}
if o.SiteReplicationSiteReplicationEditHandler == nil {
unregistered = append(unregistered, "site_replication.SiteReplicationEditHandler")
}
if o.SiteReplicationSiteReplicationInfoAddHandler == nil {
unregistered = append(unregistered, "site_replication.SiteReplicationInfoAddHandler")
}
if o.SiteReplicationSiteReplicationRemoveHandler == nil {
unregistered = append(unregistered, "site_replication.SiteReplicationRemoveHandler")
}
if o.TieringTiersListHandler == nil {
unregistered = append(unregistered, "tiering.TiersListHandler")
}
@@ -1682,14 +1641,6 @@ func (o *ConsoleAPI) initHandlerCache() {
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/admin/site-replication"] = site_replication.NewGetSiteReplicationInfo(o.context, o.SiteReplicationGetSiteReplicationInfoHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/admin/site-replication/status"] = site_replication.NewGetSiteReplicationStatus(o.context, o.SiteReplicationGetSiteReplicationStatusHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/admin/tiers/{type}/{name}"] = tiering.NewGetTier(o.context, o.TieringGetTierHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
@@ -1939,18 +1890,6 @@ func (o *ConsoleAPI) initHandlerCache() {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/buckets/{bucket_name}/objects/share"] = object.NewShareObject(o.context, o.ObjectShareObjectHandler)
if o.handlers["PUT"] == nil {
o.handlers["PUT"] = make(map[string]http.Handler)
}
o.handlers["PUT"]["/admin/site-replication"] = site_replication.NewSiteReplicationEdit(o.context, o.SiteReplicationSiteReplicationEditHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
o.handlers["POST"]["/admin/site-replication"] = site_replication.NewSiteReplicationInfoAdd(o.context, o.SiteReplicationSiteReplicationInfoAddHandler)
if o.handlers["DELETE"] == nil {
o.handlers["DELETE"] = make(map[string]http.Handler)
}
o.handlers["DELETE"]["/admin/site-replication"] = site_replication.NewSiteReplicationRemove(o.context, o.SiteReplicationSiteReplicationRemoveHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}

View File

@@ -1,88 +0,0 @@
// 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 site_replication
// 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"
)
// GetSiteReplicationInfoHandlerFunc turns a function with the right signature into a get site replication info handler
type GetSiteReplicationInfoHandlerFunc func(GetSiteReplicationInfoParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn GetSiteReplicationInfoHandlerFunc) Handle(params GetSiteReplicationInfoParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// GetSiteReplicationInfoHandler interface for that can handle valid get site replication info params
type GetSiteReplicationInfoHandler interface {
Handle(GetSiteReplicationInfoParams, *models.Principal) middleware.Responder
}
// NewGetSiteReplicationInfo creates a new http.Handler for the get site replication info operation
func NewGetSiteReplicationInfo(ctx *middleware.Context, handler GetSiteReplicationInfoHandler) *GetSiteReplicationInfo {
return &GetSiteReplicationInfo{Context: ctx, Handler: handler}
}
/*
GetSiteReplicationInfo swagger:route GET /admin/site-replication SiteReplication getSiteReplicationInfo
Get list of Replication Sites
*/
type GetSiteReplicationInfo struct {
Context *middleware.Context
Handler GetSiteReplicationInfoHandler
}
func (o *GetSiteReplicationInfo) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewGetSiteReplicationInfoParams()
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

@@ -1,63 +0,0 @@
// 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 site_replication
// 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"
)
// NewGetSiteReplicationInfoParams creates a new GetSiteReplicationInfoParams object
//
// There are no default values defined in the spec.
func NewGetSiteReplicationInfoParams() GetSiteReplicationInfoParams {
return GetSiteReplicationInfoParams{}
}
// GetSiteReplicationInfoParams contains all the bound params for the get site replication info operation
// typically these are obtained from a http.Request
//
// swagger:parameters GetSiteReplicationInfo
type GetSiteReplicationInfoParams 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 NewGetSiteReplicationInfoParams() beforehand.
func (o *GetSiteReplicationInfoParams) 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

@@ -1,135 +0,0 @@
// 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 site_replication
// 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"
)
// GetSiteReplicationInfoOKCode is the HTTP code returned for type GetSiteReplicationInfoOK
const GetSiteReplicationInfoOKCode int = 200
/*
GetSiteReplicationInfoOK A successful response.
swagger:response getSiteReplicationInfoOK
*/
type GetSiteReplicationInfoOK struct {
/*
In: Body
*/
Payload *models.SiteReplicationInfoResponse `json:"body,omitempty"`
}
// NewGetSiteReplicationInfoOK creates GetSiteReplicationInfoOK with default headers values
func NewGetSiteReplicationInfoOK() *GetSiteReplicationInfoOK {
return &GetSiteReplicationInfoOK{}
}
// WithPayload adds the payload to the get site replication info o k response
func (o *GetSiteReplicationInfoOK) WithPayload(payload *models.SiteReplicationInfoResponse) *GetSiteReplicationInfoOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the get site replication info o k response
func (o *GetSiteReplicationInfoOK) SetPayload(payload *models.SiteReplicationInfoResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *GetSiteReplicationInfoOK) 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
}
}
}
/*
GetSiteReplicationInfoDefault Generic error response.
swagger:response getSiteReplicationInfoDefault
*/
type GetSiteReplicationInfoDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.APIError `json:"body,omitempty"`
}
// NewGetSiteReplicationInfoDefault creates GetSiteReplicationInfoDefault with default headers values
func NewGetSiteReplicationInfoDefault(code int) *GetSiteReplicationInfoDefault {
if code <= 0 {
code = 500
}
return &GetSiteReplicationInfoDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the get site replication info default response
func (o *GetSiteReplicationInfoDefault) WithStatusCode(code int) *GetSiteReplicationInfoDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the get site replication info default response
func (o *GetSiteReplicationInfoDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the get site replication info default response
func (o *GetSiteReplicationInfoDefault) WithPayload(payload *models.APIError) *GetSiteReplicationInfoDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the get site replication info default response
func (o *GetSiteReplicationInfoDefault) SetPayload(payload *models.APIError) {
o.Payload = payload
}
// WriteResponse to the client
func (o *GetSiteReplicationInfoDefault) 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

@@ -1,104 +0,0 @@
// 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 site_replication
// 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"
)
// GetSiteReplicationInfoURL generates an URL for the get site replication info operation
type GetSiteReplicationInfoURL 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 *GetSiteReplicationInfoURL) WithBasePath(bp string) *GetSiteReplicationInfoURL {
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 *GetSiteReplicationInfoURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *GetSiteReplicationInfoURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/admin/site-replication"
_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 *GetSiteReplicationInfoURL) 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 *GetSiteReplicationInfoURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *GetSiteReplicationInfoURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on GetSiteReplicationInfoURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on GetSiteReplicationInfoURL")
}
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 *GetSiteReplicationInfoURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -1,88 +0,0 @@
// 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 site_replication
// 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"
)
// GetSiteReplicationStatusHandlerFunc turns a function with the right signature into a get site replication status handler
type GetSiteReplicationStatusHandlerFunc func(GetSiteReplicationStatusParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn GetSiteReplicationStatusHandlerFunc) Handle(params GetSiteReplicationStatusParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// GetSiteReplicationStatusHandler interface for that can handle valid get site replication status params
type GetSiteReplicationStatusHandler interface {
Handle(GetSiteReplicationStatusParams, *models.Principal) middleware.Responder
}
// NewGetSiteReplicationStatus creates a new http.Handler for the get site replication status operation
func NewGetSiteReplicationStatus(ctx *middleware.Context, handler GetSiteReplicationStatusHandler) *GetSiteReplicationStatus {
return &GetSiteReplicationStatus{Context: ctx, Handler: handler}
}
/*
GetSiteReplicationStatus swagger:route GET /admin/site-replication/status SiteReplication getSiteReplicationStatus
Display overall site replication status
*/
type GetSiteReplicationStatus struct {
Context *middleware.Context
Handler GetSiteReplicationStatusHandler
}
func (o *GetSiteReplicationStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewGetSiteReplicationStatusParams()
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

@@ -1,275 +0,0 @@
// 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 site_replication
// 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"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// NewGetSiteReplicationStatusParams creates a new GetSiteReplicationStatusParams object
// with the default values initialized.
func NewGetSiteReplicationStatusParams() GetSiteReplicationStatusParams {
var (
// initialize parameters with default values
bucketsDefault = bool(true)
groupsDefault = bool(true)
policiesDefault = bool(true)
usersDefault = bool(true)
)
return GetSiteReplicationStatusParams{
Buckets: &bucketsDefault,
Groups: &groupsDefault,
Policies: &policiesDefault,
Users: &usersDefault,
}
}
// GetSiteReplicationStatusParams contains all the bound params for the get site replication status operation
// typically these are obtained from a http.Request
//
// swagger:parameters GetSiteReplicationStatus
type GetSiteReplicationStatusParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*Include Bucket stats
In: query
Default: true
*/
Buckets *bool
/*Entity Type to lookup
In: query
*/
EntityType *string
/*Entity Value to lookup
In: query
*/
EntityValue *string
/*Include Group stats
In: query
Default: true
*/
Groups *bool
/*Include Policies stats
In: query
Default: true
*/
Policies *bool
/*Include Policies stats
In: query
Default: true
*/
Users *bool
}
// 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 NewGetSiteReplicationStatusParams() beforehand.
func (o *GetSiteReplicationStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
qs := runtime.Values(r.URL.Query())
qBuckets, qhkBuckets, _ := qs.GetOK("buckets")
if err := o.bindBuckets(qBuckets, qhkBuckets, route.Formats); err != nil {
res = append(res, err)
}
qEntityType, qhkEntityType, _ := qs.GetOK("entityType")
if err := o.bindEntityType(qEntityType, qhkEntityType, route.Formats); err != nil {
res = append(res, err)
}
qEntityValue, qhkEntityValue, _ := qs.GetOK("entityValue")
if err := o.bindEntityValue(qEntityValue, qhkEntityValue, route.Formats); err != nil {
res = append(res, err)
}
qGroups, qhkGroups, _ := qs.GetOK("groups")
if err := o.bindGroups(qGroups, qhkGroups, route.Formats); err != nil {
res = append(res, err)
}
qPolicies, qhkPolicies, _ := qs.GetOK("policies")
if err := o.bindPolicies(qPolicies, qhkPolicies, route.Formats); err != nil {
res = append(res, err)
}
qUsers, qhkUsers, _ := qs.GetOK("users")
if err := o.bindUsers(qUsers, qhkUsers, route.Formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// bindBuckets binds and validates parameter Buckets from query.
func (o *GetSiteReplicationStatusParams) bindBuckets(rawData []string, hasKey bool, formats strfmt.Registry) error {
var raw string
if len(rawData) > 0 {
raw = rawData[len(rawData)-1]
}
// Required: false
// AllowEmptyValue: false
if raw == "" { // empty values pass all other validations
// Default values have been previously initialized by NewGetSiteReplicationStatusParams()
return nil
}
value, err := swag.ConvertBool(raw)
if err != nil {
return errors.InvalidType("buckets", "query", "bool", raw)
}
o.Buckets = &value
return nil
}
// bindEntityType binds and validates parameter EntityType from query.
func (o *GetSiteReplicationStatusParams) bindEntityType(rawData []string, hasKey bool, formats strfmt.Registry) error {
var raw string
if len(rawData) > 0 {
raw = rawData[len(rawData)-1]
}
// Required: false
// AllowEmptyValue: false
if raw == "" { // empty values pass all other validations
return nil
}
o.EntityType = &raw
return nil
}
// bindEntityValue binds and validates parameter EntityValue from query.
func (o *GetSiteReplicationStatusParams) bindEntityValue(rawData []string, hasKey bool, formats strfmt.Registry) error {
var raw string
if len(rawData) > 0 {
raw = rawData[len(rawData)-1]
}
// Required: false
// AllowEmptyValue: false
if raw == "" { // empty values pass all other validations
return nil
}
o.EntityValue = &raw
return nil
}
// bindGroups binds and validates parameter Groups from query.
func (o *GetSiteReplicationStatusParams) bindGroups(rawData []string, hasKey bool, formats strfmt.Registry) error {
var raw string
if len(rawData) > 0 {
raw = rawData[len(rawData)-1]
}
// Required: false
// AllowEmptyValue: false
if raw == "" { // empty values pass all other validations
// Default values have been previously initialized by NewGetSiteReplicationStatusParams()
return nil
}
value, err := swag.ConvertBool(raw)
if err != nil {
return errors.InvalidType("groups", "query", "bool", raw)
}
o.Groups = &value
return nil
}
// bindPolicies binds and validates parameter Policies from query.
func (o *GetSiteReplicationStatusParams) bindPolicies(rawData []string, hasKey bool, formats strfmt.Registry) error {
var raw string
if len(rawData) > 0 {
raw = rawData[len(rawData)-1]
}
// Required: false
// AllowEmptyValue: false
if raw == "" { // empty values pass all other validations
// Default values have been previously initialized by NewGetSiteReplicationStatusParams()
return nil
}
value, err := swag.ConvertBool(raw)
if err != nil {
return errors.InvalidType("policies", "query", "bool", raw)
}
o.Policies = &value
return nil
}
// bindUsers binds and validates parameter Users from query.
func (o *GetSiteReplicationStatusParams) bindUsers(rawData []string, hasKey bool, formats strfmt.Registry) error {
var raw string
if len(rawData) > 0 {
raw = rawData[len(rawData)-1]
}
// Required: false
// AllowEmptyValue: false
if raw == "" { // empty values pass all other validations
// Default values have been previously initialized by NewGetSiteReplicationStatusParams()
return nil
}
value, err := swag.ConvertBool(raw)
if err != nil {
return errors.InvalidType("users", "query", "bool", raw)
}
o.Users = &value
return nil
}

View File

@@ -1,135 +0,0 @@
// 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 site_replication
// 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"
)
// GetSiteReplicationStatusOKCode is the HTTP code returned for type GetSiteReplicationStatusOK
const GetSiteReplicationStatusOKCode int = 200
/*
GetSiteReplicationStatusOK A successful response.
swagger:response getSiteReplicationStatusOK
*/
type GetSiteReplicationStatusOK struct {
/*
In: Body
*/
Payload *models.SiteReplicationStatusResponse `json:"body,omitempty"`
}
// NewGetSiteReplicationStatusOK creates GetSiteReplicationStatusOK with default headers values
func NewGetSiteReplicationStatusOK() *GetSiteReplicationStatusOK {
return &GetSiteReplicationStatusOK{}
}
// WithPayload adds the payload to the get site replication status o k response
func (o *GetSiteReplicationStatusOK) WithPayload(payload *models.SiteReplicationStatusResponse) *GetSiteReplicationStatusOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the get site replication status o k response
func (o *GetSiteReplicationStatusOK) SetPayload(payload *models.SiteReplicationStatusResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *GetSiteReplicationStatusOK) 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
}
}
}
/*
GetSiteReplicationStatusDefault Generic error response.
swagger:response getSiteReplicationStatusDefault
*/
type GetSiteReplicationStatusDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.APIError `json:"body,omitempty"`
}
// NewGetSiteReplicationStatusDefault creates GetSiteReplicationStatusDefault with default headers values
func NewGetSiteReplicationStatusDefault(code int) *GetSiteReplicationStatusDefault {
if code <= 0 {
code = 500
}
return &GetSiteReplicationStatusDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the get site replication status default response
func (o *GetSiteReplicationStatusDefault) WithStatusCode(code int) *GetSiteReplicationStatusDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the get site replication status default response
func (o *GetSiteReplicationStatusDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the get site replication status default response
func (o *GetSiteReplicationStatusDefault) WithPayload(payload *models.APIError) *GetSiteReplicationStatusDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the get site replication status default response
func (o *GetSiteReplicationStatusDefault) SetPayload(payload *models.APIError) {
o.Payload = payload
}
// WriteResponse to the client
func (o *GetSiteReplicationStatusDefault) 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

@@ -1,167 +0,0 @@
// 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 site_replication
// 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"
"github.com/go-openapi/swag"
)
// GetSiteReplicationStatusURL generates an URL for the get site replication status operation
type GetSiteReplicationStatusURL struct {
Buckets *bool
EntityType *string
EntityValue *string
Groups *bool
Policies *bool
Users *bool
_basePath string
// avoid unkeyed usage
_ struct{}
}
// 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 *GetSiteReplicationStatusURL) WithBasePath(bp string) *GetSiteReplicationStatusURL {
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 *GetSiteReplicationStatusURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *GetSiteReplicationStatusURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/admin/site-replication/status"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
qs := make(url.Values)
var bucketsQ string
if o.Buckets != nil {
bucketsQ = swag.FormatBool(*o.Buckets)
}
if bucketsQ != "" {
qs.Set("buckets", bucketsQ)
}
var entityTypeQ string
if o.EntityType != nil {
entityTypeQ = *o.EntityType
}
if entityTypeQ != "" {
qs.Set("entityType", entityTypeQ)
}
var entityValueQ string
if o.EntityValue != nil {
entityValueQ = *o.EntityValue
}
if entityValueQ != "" {
qs.Set("entityValue", entityValueQ)
}
var groupsQ string
if o.Groups != nil {
groupsQ = swag.FormatBool(*o.Groups)
}
if groupsQ != "" {
qs.Set("groups", groupsQ)
}
var policiesQ string
if o.Policies != nil {
policiesQ = swag.FormatBool(*o.Policies)
}
if policiesQ != "" {
qs.Set("policies", policiesQ)
}
var usersQ string
if o.Users != nil {
usersQ = swag.FormatBool(*o.Users)
}
if usersQ != "" {
qs.Set("users", usersQ)
}
_result.RawQuery = qs.Encode()
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *GetSiteReplicationStatusURL) 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 *GetSiteReplicationStatusURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *GetSiteReplicationStatusURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on GetSiteReplicationStatusURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on GetSiteReplicationStatusURL")
}
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 *GetSiteReplicationStatusURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -1,88 +0,0 @@
// 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 site_replication
// 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"
)
// SiteReplicationEditHandlerFunc turns a function with the right signature into a site replication edit handler
type SiteReplicationEditHandlerFunc func(SiteReplicationEditParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn SiteReplicationEditHandlerFunc) Handle(params SiteReplicationEditParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// SiteReplicationEditHandler interface for that can handle valid site replication edit params
type SiteReplicationEditHandler interface {
Handle(SiteReplicationEditParams, *models.Principal) middleware.Responder
}
// NewSiteReplicationEdit creates a new http.Handler for the site replication edit operation
func NewSiteReplicationEdit(ctx *middleware.Context, handler SiteReplicationEditHandler) *SiteReplicationEdit {
return &SiteReplicationEdit{Context: ctx, Handler: handler}
}
/*
SiteReplicationEdit swagger:route PUT /admin/site-replication SiteReplication siteReplicationEdit
Edit a Replication Site
*/
type SiteReplicationEdit struct {
Context *middleware.Context
Handler SiteReplicationEditHandler
}
func (o *SiteReplicationEdit) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewSiteReplicationEditParams()
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

@@ -1,101 +0,0 @@
// 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 site_replication
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"io"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
"github.com/minio/console/models"
)
// NewSiteReplicationEditParams creates a new SiteReplicationEditParams object
//
// There are no default values defined in the spec.
func NewSiteReplicationEditParams() SiteReplicationEditParams {
return SiteReplicationEditParams{}
}
// SiteReplicationEditParams contains all the bound params for the site replication edit operation
// typically these are obtained from a http.Request
//
// swagger:parameters SiteReplicationEdit
type SiteReplicationEditParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
Required: true
In: body
*/
Body *models.PeerInfo
}
// 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 NewSiteReplicationEditParams() beforehand.
func (o *SiteReplicationEditParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body models.PeerInfo
if err := route.Consumer.Consume(r.Body, &body); err != nil {
if err == io.EOF {
res = append(res, errors.Required("body", "body", ""))
} else {
res = append(res, errors.NewParseError("body", "body", "", err))
}
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = &body
}
}
} else {
res = append(res, errors.Required("body", "body", ""))
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -1,135 +0,0 @@
// 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 site_replication
// 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"
)
// SiteReplicationEditOKCode is the HTTP code returned for type SiteReplicationEditOK
const SiteReplicationEditOKCode int = 200
/*
SiteReplicationEditOK A successful response.
swagger:response siteReplicationEditOK
*/
type SiteReplicationEditOK struct {
/*
In: Body
*/
Payload *models.PeerSiteEditResponse `json:"body,omitempty"`
}
// NewSiteReplicationEditOK creates SiteReplicationEditOK with default headers values
func NewSiteReplicationEditOK() *SiteReplicationEditOK {
return &SiteReplicationEditOK{}
}
// WithPayload adds the payload to the site replication edit o k response
func (o *SiteReplicationEditOK) WithPayload(payload *models.PeerSiteEditResponse) *SiteReplicationEditOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the site replication edit o k response
func (o *SiteReplicationEditOK) SetPayload(payload *models.PeerSiteEditResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *SiteReplicationEditOK) 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
}
}
}
/*
SiteReplicationEditDefault Generic error response.
swagger:response siteReplicationEditDefault
*/
type SiteReplicationEditDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.APIError `json:"body,omitempty"`
}
// NewSiteReplicationEditDefault creates SiteReplicationEditDefault with default headers values
func NewSiteReplicationEditDefault(code int) *SiteReplicationEditDefault {
if code <= 0 {
code = 500
}
return &SiteReplicationEditDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the site replication edit default response
func (o *SiteReplicationEditDefault) WithStatusCode(code int) *SiteReplicationEditDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the site replication edit default response
func (o *SiteReplicationEditDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the site replication edit default response
func (o *SiteReplicationEditDefault) WithPayload(payload *models.APIError) *SiteReplicationEditDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the site replication edit default response
func (o *SiteReplicationEditDefault) SetPayload(payload *models.APIError) {
o.Payload = payload
}
// WriteResponse to the client
func (o *SiteReplicationEditDefault) 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

@@ -1,104 +0,0 @@
// 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 site_replication
// 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"
)
// SiteReplicationEditURL generates an URL for the site replication edit operation
type SiteReplicationEditURL 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 *SiteReplicationEditURL) WithBasePath(bp string) *SiteReplicationEditURL {
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 *SiteReplicationEditURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *SiteReplicationEditURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/admin/site-replication"
_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 *SiteReplicationEditURL) 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 *SiteReplicationEditURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *SiteReplicationEditURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on SiteReplicationEditURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on SiteReplicationEditURL")
}
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 *SiteReplicationEditURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -1,88 +0,0 @@
// 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 site_replication
// 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"
)
// SiteReplicationInfoAddHandlerFunc turns a function with the right signature into a site replication info add handler
type SiteReplicationInfoAddHandlerFunc func(SiteReplicationInfoAddParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn SiteReplicationInfoAddHandlerFunc) Handle(params SiteReplicationInfoAddParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// SiteReplicationInfoAddHandler interface for that can handle valid site replication info add params
type SiteReplicationInfoAddHandler interface {
Handle(SiteReplicationInfoAddParams, *models.Principal) middleware.Responder
}
// NewSiteReplicationInfoAdd creates a new http.Handler for the site replication info add operation
func NewSiteReplicationInfoAdd(ctx *middleware.Context, handler SiteReplicationInfoAddHandler) *SiteReplicationInfoAdd {
return &SiteReplicationInfoAdd{Context: ctx, Handler: handler}
}
/*
SiteReplicationInfoAdd swagger:route POST /admin/site-replication SiteReplication siteReplicationInfoAdd
Add a Replication Site
*/
type SiteReplicationInfoAdd struct {
Context *middleware.Context
Handler SiteReplicationInfoAddHandler
}
func (o *SiteReplicationInfoAdd) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewSiteReplicationInfoAddParams()
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

@@ -1,101 +0,0 @@
// 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 site_replication
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"io"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
"github.com/minio/console/models"
)
// NewSiteReplicationInfoAddParams creates a new SiteReplicationInfoAddParams object
//
// There are no default values defined in the spec.
func NewSiteReplicationInfoAddParams() SiteReplicationInfoAddParams {
return SiteReplicationInfoAddParams{}
}
// SiteReplicationInfoAddParams contains all the bound params for the site replication info add operation
// typically these are obtained from a http.Request
//
// swagger:parameters SiteReplicationInfoAdd
type SiteReplicationInfoAddParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
Required: true
In: body
*/
Body models.SiteReplicationAddRequest
}
// 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 NewSiteReplicationInfoAddParams() beforehand.
func (o *SiteReplicationInfoAddParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body models.SiteReplicationAddRequest
if err := route.Consumer.Consume(r.Body, &body); err != nil {
if err == io.EOF {
res = append(res, errors.Required("body", "body", ""))
} else {
res = append(res, errors.NewParseError("body", "body", "", err))
}
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = body
}
}
} else {
res = append(res, errors.Required("body", "body", ""))
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -1,135 +0,0 @@
// 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 site_replication
// 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"
)
// SiteReplicationInfoAddOKCode is the HTTP code returned for type SiteReplicationInfoAddOK
const SiteReplicationInfoAddOKCode int = 200
/*
SiteReplicationInfoAddOK A successful response.
swagger:response siteReplicationInfoAddOK
*/
type SiteReplicationInfoAddOK struct {
/*
In: Body
*/
Payload *models.SiteReplicationAddResponse `json:"body,omitempty"`
}
// NewSiteReplicationInfoAddOK creates SiteReplicationInfoAddOK with default headers values
func NewSiteReplicationInfoAddOK() *SiteReplicationInfoAddOK {
return &SiteReplicationInfoAddOK{}
}
// WithPayload adds the payload to the site replication info add o k response
func (o *SiteReplicationInfoAddOK) WithPayload(payload *models.SiteReplicationAddResponse) *SiteReplicationInfoAddOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the site replication info add o k response
func (o *SiteReplicationInfoAddOK) SetPayload(payload *models.SiteReplicationAddResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *SiteReplicationInfoAddOK) 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
}
}
}
/*
SiteReplicationInfoAddDefault Generic error response.
swagger:response siteReplicationInfoAddDefault
*/
type SiteReplicationInfoAddDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.APIError `json:"body,omitempty"`
}
// NewSiteReplicationInfoAddDefault creates SiteReplicationInfoAddDefault with default headers values
func NewSiteReplicationInfoAddDefault(code int) *SiteReplicationInfoAddDefault {
if code <= 0 {
code = 500
}
return &SiteReplicationInfoAddDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the site replication info add default response
func (o *SiteReplicationInfoAddDefault) WithStatusCode(code int) *SiteReplicationInfoAddDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the site replication info add default response
func (o *SiteReplicationInfoAddDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the site replication info add default response
func (o *SiteReplicationInfoAddDefault) WithPayload(payload *models.APIError) *SiteReplicationInfoAddDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the site replication info add default response
func (o *SiteReplicationInfoAddDefault) SetPayload(payload *models.APIError) {
o.Payload = payload
}
// WriteResponse to the client
func (o *SiteReplicationInfoAddDefault) 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

@@ -1,104 +0,0 @@
// 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 site_replication
// 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"
)
// SiteReplicationInfoAddURL generates an URL for the site replication info add operation
type SiteReplicationInfoAddURL 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 *SiteReplicationInfoAddURL) WithBasePath(bp string) *SiteReplicationInfoAddURL {
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 *SiteReplicationInfoAddURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *SiteReplicationInfoAddURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/admin/site-replication"
_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 *SiteReplicationInfoAddURL) 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 *SiteReplicationInfoAddURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *SiteReplicationInfoAddURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on SiteReplicationInfoAddURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on SiteReplicationInfoAddURL")
}
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 *SiteReplicationInfoAddURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}

View File

@@ -1,88 +0,0 @@
// 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 site_replication
// 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"
)
// SiteReplicationRemoveHandlerFunc turns a function with the right signature into a site replication remove handler
type SiteReplicationRemoveHandlerFunc func(SiteReplicationRemoveParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn SiteReplicationRemoveHandlerFunc) Handle(params SiteReplicationRemoveParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// SiteReplicationRemoveHandler interface for that can handle valid site replication remove params
type SiteReplicationRemoveHandler interface {
Handle(SiteReplicationRemoveParams, *models.Principal) middleware.Responder
}
// NewSiteReplicationRemove creates a new http.Handler for the site replication remove operation
func NewSiteReplicationRemove(ctx *middleware.Context, handler SiteReplicationRemoveHandler) *SiteReplicationRemove {
return &SiteReplicationRemove{Context: ctx, Handler: handler}
}
/*
SiteReplicationRemove swagger:route DELETE /admin/site-replication SiteReplication siteReplicationRemove
Remove a Replication Site
*/
type SiteReplicationRemove struct {
Context *middleware.Context
Handler SiteReplicationRemoveHandler
}
func (o *SiteReplicationRemove) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewSiteReplicationRemoveParams()
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

@@ -1,101 +0,0 @@
// 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 site_replication
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"io"
"net/http"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
"github.com/go-openapi/validate"
"github.com/minio/console/models"
)
// NewSiteReplicationRemoveParams creates a new SiteReplicationRemoveParams object
//
// There are no default values defined in the spec.
func NewSiteReplicationRemoveParams() SiteReplicationRemoveParams {
return SiteReplicationRemoveParams{}
}
// SiteReplicationRemoveParams contains all the bound params for the site replication remove operation
// typically these are obtained from a http.Request
//
// swagger:parameters SiteReplicationRemove
type SiteReplicationRemoveParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
Required: true
In: body
*/
Body *models.PeerInfoRemove
}
// 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 NewSiteReplicationRemoveParams() beforehand.
func (o *SiteReplicationRemoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
var body models.PeerInfoRemove
if err := route.Consumer.Consume(r.Body, &body); err != nil {
if err == io.EOF {
res = append(res, errors.Required("body", "body", ""))
} else {
res = append(res, errors.NewParseError("body", "body", "", err))
}
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
res = append(res, err)
}
ctx := validate.WithOperationRequest(r.Context())
if err := body.ContextValidate(ctx, route.Formats); err != nil {
res = append(res, err)
}
if len(res) == 0 {
o.Body = &body
}
}
} else {
res = append(res, errors.Required("body", "body", ""))
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}

View File

@@ -1,135 +0,0 @@
// 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 site_replication
// 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"
)
// SiteReplicationRemoveNoContentCode is the HTTP code returned for type SiteReplicationRemoveNoContent
const SiteReplicationRemoveNoContentCode int = 204
/*
SiteReplicationRemoveNoContent A successful response.
swagger:response siteReplicationRemoveNoContent
*/
type SiteReplicationRemoveNoContent struct {
/*
In: Body
*/
Payload *models.PeerSiteRemoveResponse `json:"body,omitempty"`
}
// NewSiteReplicationRemoveNoContent creates SiteReplicationRemoveNoContent with default headers values
func NewSiteReplicationRemoveNoContent() *SiteReplicationRemoveNoContent {
return &SiteReplicationRemoveNoContent{}
}
// WithPayload adds the payload to the site replication remove no content response
func (o *SiteReplicationRemoveNoContent) WithPayload(payload *models.PeerSiteRemoveResponse) *SiteReplicationRemoveNoContent {
o.Payload = payload
return o
}
// SetPayload sets the payload to the site replication remove no content response
func (o *SiteReplicationRemoveNoContent) SetPayload(payload *models.PeerSiteRemoveResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *SiteReplicationRemoveNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
rw.WriteHeader(204)
if o.Payload != nil {
payload := o.Payload
if err := producer.Produce(rw, payload); err != nil {
panic(err) // let the recovery middleware deal with this
}
}
}
/*
SiteReplicationRemoveDefault Generic error response.
swagger:response siteReplicationRemoveDefault
*/
type SiteReplicationRemoveDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.APIError `json:"body,omitempty"`
}
// NewSiteReplicationRemoveDefault creates SiteReplicationRemoveDefault with default headers values
func NewSiteReplicationRemoveDefault(code int) *SiteReplicationRemoveDefault {
if code <= 0 {
code = 500
}
return &SiteReplicationRemoveDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the site replication remove default response
func (o *SiteReplicationRemoveDefault) WithStatusCode(code int) *SiteReplicationRemoveDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the site replication remove default response
func (o *SiteReplicationRemoveDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the site replication remove default response
func (o *SiteReplicationRemoveDefault) WithPayload(payload *models.APIError) *SiteReplicationRemoveDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the site replication remove default response
func (o *SiteReplicationRemoveDefault) SetPayload(payload *models.APIError) {
o.Payload = payload
}
// WriteResponse to the client
func (o *SiteReplicationRemoveDefault) 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

@@ -1,104 +0,0 @@
// 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 site_replication
// 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"
)
// SiteReplicationRemoveURL generates an URL for the site replication remove operation
type SiteReplicationRemoveURL 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 *SiteReplicationRemoveURL) WithBasePath(bp string) *SiteReplicationRemoveURL {
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 *SiteReplicationRemoveURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *SiteReplicationRemoveURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/admin/site-replication"
_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 *SiteReplicationRemoveURL) 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 *SiteReplicationRemoveURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *SiteReplicationRemoveURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on SiteReplicationRemoveURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on SiteReplicationRemoveURL")
}
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 *SiteReplicationRemoveURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}