Remove Operator UI Storage Page (#1639)

Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2022-02-28 22:58:20 -08:00
committed by GitHub
parent 69a3ee6c1a
commit 208afdfc3a
25 changed files with 507 additions and 2473 deletions

View File

@@ -1,88 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 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 operator_api
// 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"
)
// DirectCSIFormatDriveHandlerFunc turns a function with the right signature into a direct c s i format drive handler
type DirectCSIFormatDriveHandlerFunc func(DirectCSIFormatDriveParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn DirectCSIFormatDriveHandlerFunc) Handle(params DirectCSIFormatDriveParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// DirectCSIFormatDriveHandler interface for that can handle valid direct c s i format drive params
type DirectCSIFormatDriveHandler interface {
Handle(DirectCSIFormatDriveParams, *models.Principal) middleware.Responder
}
// NewDirectCSIFormatDrive creates a new http.Handler for the direct c s i format drive operation
func NewDirectCSIFormatDrive(ctx *middleware.Context, handler DirectCSIFormatDriveHandler) *DirectCSIFormatDrive {
return &DirectCSIFormatDrive{Context: ctx, Handler: handler}
}
/* DirectCSIFormatDrive swagger:route POST /direct-csi/drives/format OperatorAPI directCSIFormatDrive
Format direct-csi drives from a list
*/
type DirectCSIFormatDrive struct {
Context *middleware.Context
Handler DirectCSIFormatDriveHandler
}
func (o *DirectCSIFormatDrive) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewDirectCSIFormatDriveParams()
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,102 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 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 operator_api
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"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"
)
// NewDirectCSIFormatDriveParams creates a new DirectCSIFormatDriveParams object
//
// There are no default values defined in the spec.
func NewDirectCSIFormatDriveParams() DirectCSIFormatDriveParams {
return DirectCSIFormatDriveParams{}
}
// DirectCSIFormatDriveParams contains all the bound params for the direct c s i format drive operation
// typically these are obtained from a http.Request
//
// swagger:parameters DirectCSIFormatDrive
type DirectCSIFormatDriveParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
Required: true
In: body
*/
Body *models.FormatConfiguration
}
// 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 NewDirectCSIFormatDriveParams() beforehand.
func (o *DirectCSIFormatDriveParams) 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.FormatConfiguration
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(context.Background())
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,133 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 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 operator_api
// 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"
)
// DirectCSIFormatDriveOKCode is the HTTP code returned for type DirectCSIFormatDriveOK
const DirectCSIFormatDriveOKCode int = 200
/*DirectCSIFormatDriveOK A successful response.
swagger:response directCSIFormatDriveOK
*/
type DirectCSIFormatDriveOK struct {
/*
In: Body
*/
Payload *models.FormatDirectCSIDrivesResponse `json:"body,omitempty"`
}
// NewDirectCSIFormatDriveOK creates DirectCSIFormatDriveOK with default headers values
func NewDirectCSIFormatDriveOK() *DirectCSIFormatDriveOK {
return &DirectCSIFormatDriveOK{}
}
// WithPayload adds the payload to the direct c s i format drive o k response
func (o *DirectCSIFormatDriveOK) WithPayload(payload *models.FormatDirectCSIDrivesResponse) *DirectCSIFormatDriveOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the direct c s i format drive o k response
func (o *DirectCSIFormatDriveOK) SetPayload(payload *models.FormatDirectCSIDrivesResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *DirectCSIFormatDriveOK) 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
}
}
}
/*DirectCSIFormatDriveDefault Generic error response.
swagger:response directCSIFormatDriveDefault
*/
type DirectCSIFormatDriveDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewDirectCSIFormatDriveDefault creates DirectCSIFormatDriveDefault with default headers values
func NewDirectCSIFormatDriveDefault(code int) *DirectCSIFormatDriveDefault {
if code <= 0 {
code = 500
}
return &DirectCSIFormatDriveDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the direct c s i format drive default response
func (o *DirectCSIFormatDriveDefault) WithStatusCode(code int) *DirectCSIFormatDriveDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the direct c s i format drive default response
func (o *DirectCSIFormatDriveDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the direct c s i format drive default response
func (o *DirectCSIFormatDriveDefault) WithPayload(payload *models.Error) *DirectCSIFormatDriveDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the direct c s i format drive default response
func (o *DirectCSIFormatDriveDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *DirectCSIFormatDriveDefault) 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) 2021 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 operator_api
// 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"
)
// DirectCSIFormatDriveURL generates an URL for the direct c s i format drive operation
type DirectCSIFormatDriveURL 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 *DirectCSIFormatDriveURL) WithBasePath(bp string) *DirectCSIFormatDriveURL {
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 *DirectCSIFormatDriveURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *DirectCSIFormatDriveURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/direct-csi/drives/format"
_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 *DirectCSIFormatDriveURL) 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 *DirectCSIFormatDriveURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *DirectCSIFormatDriveURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on DirectCSIFormatDriveURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on DirectCSIFormatDriveURL")
}
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 *DirectCSIFormatDriveURL) 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) 2021 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 operator_api
// 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"
)
// GetDirectCSIDriveListHandlerFunc turns a function with the right signature into a get direct c s i drive list handler
type GetDirectCSIDriveListHandlerFunc func(GetDirectCSIDriveListParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn GetDirectCSIDriveListHandlerFunc) Handle(params GetDirectCSIDriveListParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// GetDirectCSIDriveListHandler interface for that can handle valid get direct c s i drive list params
type GetDirectCSIDriveListHandler interface {
Handle(GetDirectCSIDriveListParams, *models.Principal) middleware.Responder
}
// NewGetDirectCSIDriveList creates a new http.Handler for the get direct c s i drive list operation
func NewGetDirectCSIDriveList(ctx *middleware.Context, handler GetDirectCSIDriveListHandler) *GetDirectCSIDriveList {
return &GetDirectCSIDriveList{Context: ctx, Handler: handler}
}
/* GetDirectCSIDriveList swagger:route GET /direct-csi/drives OperatorAPI getDirectCSIDriveList
Get direct-csi drives list
*/
type GetDirectCSIDriveList struct {
Context *middleware.Context
Handler GetDirectCSIDriveListHandler
}
func (o *GetDirectCSIDriveList) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewGetDirectCSIDriveListParams()
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,121 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 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 operator_api
// 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"
)
// NewGetDirectCSIDriveListParams creates a new GetDirectCSIDriveListParams object
//
// There are no default values defined in the spec.
func NewGetDirectCSIDriveListParams() GetDirectCSIDriveListParams {
return GetDirectCSIDriveListParams{}
}
// GetDirectCSIDriveListParams contains all the bound params for the get direct c s i drive list operation
// typically these are obtained from a http.Request
//
// swagger:parameters GetDirectCSIDriveList
type GetDirectCSIDriveListParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: query
*/
Drives *string
/*
In: query
*/
Nodes *string
}
// 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 NewGetDirectCSIDriveListParams() beforehand.
func (o *GetDirectCSIDriveListParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
qs := runtime.Values(r.URL.Query())
qDrives, qhkDrives, _ := qs.GetOK("drives")
if err := o.bindDrives(qDrives, qhkDrives, route.Formats); err != nil {
res = append(res, err)
}
qNodes, qhkNodes, _ := qs.GetOK("nodes")
if err := o.bindNodes(qNodes, qhkNodes, route.Formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// bindDrives binds and validates parameter Drives from query.
func (o *GetDirectCSIDriveListParams) bindDrives(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.Drives = &raw
return nil
}
// bindNodes binds and validates parameter Nodes from query.
func (o *GetDirectCSIDriveListParams) bindNodes(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.Nodes = &raw
return nil
}

View File

@@ -1,133 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 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 operator_api
// 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"
)
// GetDirectCSIDriveListOKCode is the HTTP code returned for type GetDirectCSIDriveListOK
const GetDirectCSIDriveListOKCode int = 200
/*GetDirectCSIDriveListOK A successful response.
swagger:response getDirectCSIDriveListOK
*/
type GetDirectCSIDriveListOK struct {
/*
In: Body
*/
Payload *models.GetDirectCSIDriveListResponse `json:"body,omitempty"`
}
// NewGetDirectCSIDriveListOK creates GetDirectCSIDriveListOK with default headers values
func NewGetDirectCSIDriveListOK() *GetDirectCSIDriveListOK {
return &GetDirectCSIDriveListOK{}
}
// WithPayload adds the payload to the get direct c s i drive list o k response
func (o *GetDirectCSIDriveListOK) WithPayload(payload *models.GetDirectCSIDriveListResponse) *GetDirectCSIDriveListOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the get direct c s i drive list o k response
func (o *GetDirectCSIDriveListOK) SetPayload(payload *models.GetDirectCSIDriveListResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *GetDirectCSIDriveListOK) 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
}
}
}
/*GetDirectCSIDriveListDefault Generic error response.
swagger:response getDirectCSIDriveListDefault
*/
type GetDirectCSIDriveListDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewGetDirectCSIDriveListDefault creates GetDirectCSIDriveListDefault with default headers values
func NewGetDirectCSIDriveListDefault(code int) *GetDirectCSIDriveListDefault {
if code <= 0 {
code = 500
}
return &GetDirectCSIDriveListDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the get direct c s i drive list default response
func (o *GetDirectCSIDriveListDefault) WithStatusCode(code int) *GetDirectCSIDriveListDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the get direct c s i drive list default response
func (o *GetDirectCSIDriveListDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the get direct c s i drive list default response
func (o *GetDirectCSIDriveListDefault) WithPayload(payload *models.Error) *GetDirectCSIDriveListDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the get direct c s i drive list default response
func (o *GetDirectCSIDriveListDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *GetDirectCSIDriveListDefault) 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,129 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 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 operator_api
// 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"
)
// GetDirectCSIDriveListURL generates an URL for the get direct c s i drive list operation
type GetDirectCSIDriveListURL struct {
Drives *string
Nodes *string
_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 *GetDirectCSIDriveListURL) WithBasePath(bp string) *GetDirectCSIDriveListURL {
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 *GetDirectCSIDriveListURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *GetDirectCSIDriveListURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/direct-csi/drives"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
qs := make(url.Values)
var drivesQ string
if o.Drives != nil {
drivesQ = *o.Drives
}
if drivesQ != "" {
qs.Set("drives", drivesQ)
}
var nodesQ string
if o.Nodes != nil {
nodesQ = *o.Nodes
}
if nodesQ != "" {
qs.Set("nodes", nodesQ)
}
_result.RawQuery = qs.Encode()
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *GetDirectCSIDriveListURL) 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 *GetDirectCSIDriveListURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *GetDirectCSIDriveListURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on GetDirectCSIDriveListURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on GetDirectCSIDriveListURL")
}
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 *GetDirectCSIDriveListURL) 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) 2021 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 operator_api
// 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"
)
// GetDirectCSIVolumeListHandlerFunc turns a function with the right signature into a get direct c s i volume list handler
type GetDirectCSIVolumeListHandlerFunc func(GetDirectCSIVolumeListParams, *models.Principal) middleware.Responder
// Handle executing the request and returning a response
func (fn GetDirectCSIVolumeListHandlerFunc) Handle(params GetDirectCSIVolumeListParams, principal *models.Principal) middleware.Responder {
return fn(params, principal)
}
// GetDirectCSIVolumeListHandler interface for that can handle valid get direct c s i volume list params
type GetDirectCSIVolumeListHandler interface {
Handle(GetDirectCSIVolumeListParams, *models.Principal) middleware.Responder
}
// NewGetDirectCSIVolumeList creates a new http.Handler for the get direct c s i volume list operation
func NewGetDirectCSIVolumeList(ctx *middleware.Context, handler GetDirectCSIVolumeListHandler) *GetDirectCSIVolumeList {
return &GetDirectCSIVolumeList{Context: ctx, Handler: handler}
}
/* GetDirectCSIVolumeList swagger:route GET /direct-csi/volumes OperatorAPI getDirectCSIVolumeList
Get direct-csi volumes list
*/
type GetDirectCSIVolumeList struct {
Context *middleware.Context
Handler GetDirectCSIVolumeListHandler
}
func (o *GetDirectCSIVolumeList) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
route, rCtx, _ := o.Context.RouteInfo(r)
if rCtx != nil {
*r = *rCtx
}
var Params = NewGetDirectCSIVolumeListParams()
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,121 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 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 operator_api
// 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"
)
// NewGetDirectCSIVolumeListParams creates a new GetDirectCSIVolumeListParams object
//
// There are no default values defined in the spec.
func NewGetDirectCSIVolumeListParams() GetDirectCSIVolumeListParams {
return GetDirectCSIVolumeListParams{}
}
// GetDirectCSIVolumeListParams contains all the bound params for the get direct c s i volume list operation
// typically these are obtained from a http.Request
//
// swagger:parameters GetDirectCSIVolumeList
type GetDirectCSIVolumeListParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*
In: query
*/
Drives *string
/*
In: query
*/
Nodes *string
}
// 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 NewGetDirectCSIVolumeListParams() beforehand.
func (o *GetDirectCSIVolumeListParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
qs := runtime.Values(r.URL.Query())
qDrives, qhkDrives, _ := qs.GetOK("drives")
if err := o.bindDrives(qDrives, qhkDrives, route.Formats); err != nil {
res = append(res, err)
}
qNodes, qhkNodes, _ := qs.GetOK("nodes")
if err := o.bindNodes(qNodes, qhkNodes, route.Formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
// bindDrives binds and validates parameter Drives from query.
func (o *GetDirectCSIVolumeListParams) bindDrives(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.Drives = &raw
return nil
}
// bindNodes binds and validates parameter Nodes from query.
func (o *GetDirectCSIVolumeListParams) bindNodes(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.Nodes = &raw
return nil
}

View File

@@ -1,133 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 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 operator_api
// 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"
)
// GetDirectCSIVolumeListOKCode is the HTTP code returned for type GetDirectCSIVolumeListOK
const GetDirectCSIVolumeListOKCode int = 200
/*GetDirectCSIVolumeListOK A successful response.
swagger:response getDirectCSIVolumeListOK
*/
type GetDirectCSIVolumeListOK struct {
/*
In: Body
*/
Payload *models.GetDirectCSIVolumeListResponse `json:"body,omitempty"`
}
// NewGetDirectCSIVolumeListOK creates GetDirectCSIVolumeListOK with default headers values
func NewGetDirectCSIVolumeListOK() *GetDirectCSIVolumeListOK {
return &GetDirectCSIVolumeListOK{}
}
// WithPayload adds the payload to the get direct c s i volume list o k response
func (o *GetDirectCSIVolumeListOK) WithPayload(payload *models.GetDirectCSIVolumeListResponse) *GetDirectCSIVolumeListOK {
o.Payload = payload
return o
}
// SetPayload sets the payload to the get direct c s i volume list o k response
func (o *GetDirectCSIVolumeListOK) SetPayload(payload *models.GetDirectCSIVolumeListResponse) {
o.Payload = payload
}
// WriteResponse to the client
func (o *GetDirectCSIVolumeListOK) 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
}
}
}
/*GetDirectCSIVolumeListDefault Generic error response.
swagger:response getDirectCSIVolumeListDefault
*/
type GetDirectCSIVolumeListDefault struct {
_statusCode int
/*
In: Body
*/
Payload *models.Error `json:"body,omitempty"`
}
// NewGetDirectCSIVolumeListDefault creates GetDirectCSIVolumeListDefault with default headers values
func NewGetDirectCSIVolumeListDefault(code int) *GetDirectCSIVolumeListDefault {
if code <= 0 {
code = 500
}
return &GetDirectCSIVolumeListDefault{
_statusCode: code,
}
}
// WithStatusCode adds the status to the get direct c s i volume list default response
func (o *GetDirectCSIVolumeListDefault) WithStatusCode(code int) *GetDirectCSIVolumeListDefault {
o._statusCode = code
return o
}
// SetStatusCode sets the status to the get direct c s i volume list default response
func (o *GetDirectCSIVolumeListDefault) SetStatusCode(code int) {
o._statusCode = code
}
// WithPayload adds the payload to the get direct c s i volume list default response
func (o *GetDirectCSIVolumeListDefault) WithPayload(payload *models.Error) *GetDirectCSIVolumeListDefault {
o.Payload = payload
return o
}
// SetPayload sets the payload to the get direct c s i volume list default response
func (o *GetDirectCSIVolumeListDefault) SetPayload(payload *models.Error) {
o.Payload = payload
}
// WriteResponse to the client
func (o *GetDirectCSIVolumeListDefault) 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,129 +0,0 @@
// Code generated by go-swagger; DO NOT EDIT.
// This file is part of MinIO Console Server
// Copyright (c) 2021 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 operator_api
// 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"
)
// GetDirectCSIVolumeListURL generates an URL for the get direct c s i volume list operation
type GetDirectCSIVolumeListURL struct {
Drives *string
Nodes *string
_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 *GetDirectCSIVolumeListURL) WithBasePath(bp string) *GetDirectCSIVolumeListURL {
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 *GetDirectCSIVolumeListURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
func (o *GetDirectCSIVolumeListURL) Build() (*url.URL, error) {
var _result url.URL
var _path = "/direct-csi/volumes"
_basePath := o._basePath
if _basePath == "" {
_basePath = "/api/v1"
}
_result.Path = golangswaggerpaths.Join(_basePath, _path)
qs := make(url.Values)
var drivesQ string
if o.Drives != nil {
drivesQ = *o.Drives
}
if drivesQ != "" {
qs.Set("drives", drivesQ)
}
var nodesQ string
if o.Nodes != nil {
nodesQ = *o.Nodes
}
if nodesQ != "" {
qs.Set("nodes", nodesQ)
}
_result.RawQuery = qs.Encode()
return &_result, nil
}
// Must is a helper function to panic when the url builder returns an error
func (o *GetDirectCSIVolumeListURL) 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 *GetDirectCSIVolumeListURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
func (o *GetDirectCSIVolumeListURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
return nil, errors.New("scheme is required for a full url on GetDirectCSIVolumeListURL")
}
if host == "" {
return nil, errors.New("host is required for a full url on GetDirectCSIVolumeListURL")
}
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 *GetDirectCSIVolumeListURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}