Documentation ¶
Overview ¶
Package api MinIO Operator
Schemes: http ws Host: localhost BasePath: /api/v1 Version: 0.1.0 Consumes: - application/json Produces: - application/json
swagger:meta
Index ¶
- Constants
- Variables
- func AuditLogMiddleware(next http.Handler) http.Handler
- func AuthenticationMiddleware(next http.Handler) http.Handler
- func BaseURL() string
- func ContextMiddleware(next http.Handler) http.Handler
- func Error(err ...interface{}) *models.Error
- func ErrorWithContext(ctx context.Context, err ...interface{}) *models.Error
- func ExpireSessionCookie() http.Cookie
- func FileServerMiddleware(next http.Handler) http.Handler
- func GenerateTenantConfigurationFile(configuration map[string]string) string
- func GetAPIKey(token string) (string, error)
- func GetConsoleCredentialsForOperator(jwt string) (*credentials.Credentials, error)
- func GetConsoleHTTPClient(address string) *http.Client
- func GetHTTPClient() *http.Client
- func GetHostname() string
- func GetK8sAPIServer() string
- func GetK8sConfig(token string) *rest.Config
- func GetMinioImage() (*string, error)
- func GetOperatorClient(token string) (*operator.Clientset, error)
- func GetParityInfo(nodes int64, disksPerNode int64) (models.ParityResponse, error)
- func GetPort() int
- func GetSecureAllowedHosts() []string
- func GetSecureAllowedHostsAreRegex() bool
- func GetSecureBrowserXSSFilter() bool
- func GetSecureContentSecurityPolicy() string
- func GetSecureContentSecurityPolicyReportOnly() string
- func GetSecureContentTypeNonSniff() bool
- func GetSecureExpectCTHeader() string
- func GetSecureFeaturePolicy() string
- func GetSecureForceSTSHeader() bool
- func GetSecureFrameDeny() bool
- func GetSecureHostsProxyHeaders() []string
- func GetSecurePublicKey() string
- func GetSecureReferrerPolicy() string
- func GetSecureSTSIncludeSubdomains() bool
- func GetSecureSTSPreload() bool
- func GetSecureSTSSeconds() int64
- func GetSecureTLSHost() string
- func GetSecureTLSTemporaryRedirect() bool
- func GetSubPath() string
- func GetTLSPort() int
- func GetTLSRedirect() string
- func GetTenantConfiguration(ctx context.Context, clientSet K8sClientI, tenant *miniov2.Tenant) (map[string]string, error)
- func GetTenantServiceURL(mi *miniov2.Tenant) (svcURL string)
- func K8sClient(token string) (*kubernetes.Clientset, error)
- func KeyURL() string
- func Login() (string, error)
- func LoginURL() string
- func MFAURL() string
- func NewAdminClientWithInsecure(url, accessKey, secretKey, sessionToken string, insecure bool) (*madmin.AdminClient, *probe.Error)
- func NewSessionCookieForConsole(token string) http.Cookie
- func PrepareClientTransport(insecure bool) *http.Transport
- func PrepareConsoleHTTPClient(insecure bool) *http.Client
- func PrepareSTSClientTransport(insecure bool) *http.Transport
- func RegisterURL() string
- func SetPolicy(ctx context.Context, client MinioAdmin, name, entityName string, ...) error
- func SubnetLogin(client xhttp.ClientI, username, password string) (string, string, error)
- func SubnetRegisterWithAPIKey(ctx context.Context, minioClient MinioAdmin, apiKey string) (bool, error)
- type AdminClient
- type AdminClientMock
- type ConsoleCredentials
- type ConsoleCredentialsI
- type Context
- type K8sClientI
- type LicenseTokenConfig
- type MCClient
- type MinIOConfig
- type MinioAdmin
- type MinioClient
- type NodeResourceInfo
- type OperatorClient
- type OperatorClientI
- type Server
- func (s *Server) ConfigureAPI()
- func (s *Server) ConfigureFlags()
- func (s *Server) Fatalf(f string, args ...interface{})
- func (s *Server) GetHandler() http.Handler
- func (s *Server) HTTPListener() (net.Listener, error)
- func (s *Server) Listen() error
- func (s *Server) Logf(f string, args ...interface{})
- func (s *Server) Serve() (err error)
- func (s *Server) SetAPI(api *operations.OperatorAPI)
- func (s *Server) SetHandler(handler http.Handler)
- func (s *Server) Shutdown() error
- func (s *Server) TLSListener() (net.Listener, error)
- func (s *Server) UnixListener() (net.Listener, error)
- type SubnetPlan
- type UsageInfo
Constants ¶
const ( OperatorSAToken = "OPERATOR_SA_TOKEN" Marketplace = "OPERATOR_MARKETPLACE" KESImageVersion = "minio/kes:2023-11-10T10-44-28Z" // Constants for common configuration MinioImage = "OPERATOR_MINIO_IMAGE" OperatorUIHostname = "OPERATOR_HOSTNAME" OperatorUIPort = "OPERATOR_PORT" OperatorUITLSPort = "OPERATOR_TLS_PORT" // K8sAPIServer address of the K8s API K8sAPIServer = "OPERATOR_K8S_API_SERVER" // K8SAPIServerTLSRootCA location of the root CA K8SAPIServerTLSRootCA = "OPERATOR_K8S_API_SERVER_TLS_ROOT_CA" // Constants for Secure middleware SecureAllowedHosts = "OPERATOR_SECURE_ALLOWED_HOSTS" SecureAllowedHostsAreRegex = "OPERATOR_SECURE_ALLOWED_HOSTS_ARE_REGEX" SecureFrameDeny = "OPERATOR_SECURE_FRAME_DENY" SecureContentTypeNoSniff = "OPERATOR_SECURE_CONTENT_TYPE_NO_SNIFF" SecureBrowserXSSFilter = "OPERATOR_SECURE_BROWSER_XSS_FILTER" SecureContentSecurityPolicy = "OPERATOR_SECURE_CONTENT_SECURITY_POLICY" SecureContentSecurityPolicyReportOnly = "OPERATOR_SECURE_CONTENT_SECURITY_POLICY_REPORT_ONLY" SecureHostsProxyHeaders = "OPERATOR_SECURE_HOSTS_PROXY_HEADERS" SecureSTSSeconds = "OPERATOR_SECURE_STS_SECONDS" SecureSTSIncludeSubdomains = "OPERATOR_SECURE_STS_INCLUDE_SUB_DOMAINS" SecureSTSPreload = "OPERATOR_SECURE_STS_PRELOAD" SecureTLSRedirect = "OPERATOR_SECURE_TLS_REDIRECT" SecureTLSHost = "OPERATOR_SECURE_TLS_HOST" SecureTLSTemporaryRedirect = "OPERATOR_SECURE_TLS_TEMPORARY_REDIRECT" SecureForceSTSHeader = "OPERATOR_SECURE_FORCE_STS_HEADER" SecurePublicKey = "OPERATOR_SECURE_PUBLIC_KEY" SecureReferrerPolicy = "OPERATOR_SECURE_REFERRER_POLICY" SecureFeaturePolicy = "OPERATOR_SECURE_FEATURE_POLICY" SecureExpectCTHeader = "OPERATOR_SECURE_EXPECT_CT_HEADER" SlashSeparator = "/" )
list of all console environment constants
const ( // KesConfigVersion1 identifier v1 KesConfigVersion1 = "v1" // KesConfigVersion2 identifier v2 KesConfigVersion2 = "v2" )
const (
// SubPath path for hosting ui
SubPath = "OPERATOR_SUBPATH"
)
Variables ¶
var ( // Port console default port Port = "9090" // Hostname console hostname // avoid listening on 0.0.0.0 by default // instead listen on all IPv4 and IPv6 // - Hostname should be empty. Hostname = "" // TLSPort console tls port TLSPort = "9443" // TLSRedirect console tls redirect rule TLSRedirect = "on" // SessionDuration cookie validity duration SessionDuration = 45 * time.Minute // LicenseKey in memory license key used by console ui LicenseKey = "" // GlobalRootCAs is CA root certificates, a nil value means system certs pool will be used GlobalRootCAs *x509.CertPool // GlobalPublicCerts has certificates Console will use to serve clients GlobalPublicCerts []*x509.Certificate // GlobalTLSCertsManager custom TLS Manager for SNI support GlobalTLSCertsManager *xcerts.Manager )
var ( // SwaggerJSON embedded version of the swagger document used at generation time SwaggerJSON json.RawMessage // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time FlatSwaggerJSON json.RawMessage )
var ( ErrDefault = errors.New("an error occurred, please try again") ErrInvalidLogin = errors.New("invalid Login") ErrForbidden = errors.New("403 Forbidden") ErrBadRequest = errors.New("400 Bad Request") ErrFileTooLarge = errors.New("413 File too Large") ErrInvalidSession = errors.New("invalid session") ErrNotFound = errors.New("not found") ErrGroupAlreadyExists = errors.New("error group name already in use") ErrInvalidErasureCodingValue = errors.New("invalid Erasure Coding Value") ErrBucketBodyNotInRequest = errors.New("error bucket body not in request") ErrBucketNameNotInRequest = errors.New("error bucket name not in request") ErrGroupBodyNotInRequest = errors.New("error group body not in request") ErrGroupNameNotInRequest = errors.New("error group name not in request") ErrPolicyNameNotInRequest = errors.New("error policy name not in request") ErrPolicyBodyNotInRequest = errors.New("error policy body not in request") ErrPolicyNameContainsSpace = errors.New("error policy name cannot contain spaces") ErrInvalidEncryptionAlgorithm = errors.New("error invalid encryption algorithm") ErrSSENotConfigured = errors.New("error server side encryption configuration not found") ErrBucketLifeCycleNotConfigured = errors.New("error bucket life cycle configuration not found") ErrChangePassword = errors.New("error please check your current password") ErrInvalidLicense = errors.New("invalid license key") ErrLicenseNotFound = errors.New("license not found") ErrAvoidSelfAccountDelete = errors.New("logged in user cannot be deleted by itself") ErrAccessDenied = errors.New("access denied") ErrOauth2Provider = errors.New("unable to contact configured identity provider") ErrNonUniqueAccessKey = errors.New("access key already in use") ErrRemoteTierExists = errors.New("specified remote tier already exists") ErrRemoteTierNotFound = errors.New("specified remote tier was not found") ErrRemoteTierUppercase = errors.New("tier name must be in uppercase") ErrRemoteTierBucketNotFound = errors.New("remote tier bucket not found") ErrRemoteInvalidCredentials = errors.New("invalid remote tier credentials") ErrUnableToGetTenantUsage = errors.New("unable to get tenant usage") ErrTooManyNodes = errors.New("cannot request more nodes than what is available in the cluster") ErrTooFewNodes = errors.New("there are not enough nodes in the cluster to support this tenant") ErrTooFewAvailableNodes = errors.New("there is not enough available nodes to satisfy this requirement") ErrFewerThanFourNodes = errors.New("at least 4 nodes are required for a tenant") ErrUnableToGetTenantLogs = errors.New("unable to get tenant logs") ErrUnableToUpdateTenantCertificates = errors.New("unable to update tenant certificates") ErrUpdatingEncryptionConfig = errors.New("unable to update encryption configuration") ErrDeletingEncryptionConfig = errors.New("error disabling tenant encryption") ErrEncryptionConfigNotFound = errors.New("encryption configuration not found") ErrPolicyNotFound = errors.New("policy does not exist") ErrLoginNotAllowed = errors.New("login not allowed") ErrPoolExists = errors.New("pool exists") )
Generic errors
var ( LogInfo = logInfo LogError = logError LogIf = logIf )
globally changeable logger styles
var InstanceLicensePlan = PlanAGPL
InstanceLicensePlan default assumed plan
var KesConfigVersionsMap = map[string]interface{}{ KesConfigVersion1: kes.ServerConfigV1{}, KesConfigVersion2: kes.ServerConfigV2{}, }
KesConfigVersionsMap is a map of kes config version types
var ( // MinioServerInfoMock is the mc admin info server client mock MinioServerInfoMock func(ctx context.Context) (madmin.InfoMessage, error) )
Functions ¶
func AuditLogMiddleware ¶
AuditLogMiddleware notifies audit webhook regarding the request
func AuthenticationMiddleware ¶
AuthenticationMiddleware handles aut
func ContextMiddleware ¶
ContextMiddleware attachs request info to context
func Error ¶
Error receives an errors object and parse it against k8sErrors, returns the right errors code paired with a generic errors message
func ErrorWithContext ¶
ErrorWithContext :
func ExpireSessionCookie ¶
ExpireSessionCookie expires a cookie
func FileServerMiddleware ¶
FileServerMiddleware serves files from the static folder
func GenerateTenantConfigurationFile ¶
GenerateTenantConfigurationFile generate config for tenant
func GetConsoleCredentialsForOperator ¶
func GetConsoleCredentialsForOperator(jwt string) (*credentials.Credentials, error)
GetConsoleCredentialsForOperator will validate the provided JWT (service account token) and return it in the form of credentials.Login
func GetConsoleHTTPClient ¶
GetConsoleHTTPClient caches different http clients depending on the target endpoint while taking in consideration CA certs stored in ${HOME}/.console/certs/CAs and ${HOME}/.minio/certs/CAs If the target endpoint points to a loopback device, skip the TLS verification.
func GetHTTPClient ¶
GetHTTPClient returns a http client to communicate with subnet
func GetHostname ¶
func GetHostname() string
GetHostname gets console hostname set on env variable, default one or defined on run command
func GetK8sAPIServer ¶
func GetK8sAPIServer() string
GetK8sAPIServer returns the URL to use for the k8s api
func GetK8sConfig ¶
GetK8sConfig returns the config for k8s api
func GetMinioImage ¶
GetMinioImage returns the image URL to be used when deploying a MinIO instance, if there is a preferred image to be used (configured via ENVIRONMENT VARIABLES) GetMinioImage will return that if not, GetMinioImage will try to obtain the image URL for the latest version of MinIO and return that
func GetOperatorClient ¶
GetOperatorClient returns an operator client using GetK8sConfig for its config
func GetParityInfo ¶
func GetParityInfo(nodes int64, disksPerNode int64) (models.ParityResponse, error)
GetParityInfo returns the parity for nxd config
func GetSecureAllowedHosts ¶
func GetSecureAllowedHosts() []string
GetSecureAllowedHosts secure middleware env variable configurations
func GetSecureAllowedHostsAreRegex ¶
func GetSecureAllowedHostsAreRegex() bool
GetSecureAllowedHostsAreRegex determines, if the provided AllowedHosts slice contains valid regular expressions. Default is false.
func GetSecureBrowserXSSFilter ¶
func GetSecureBrowserXSSFilter() bool
GetSecureBrowserXSSFilter If BrowserXssFilter is true, adds the X-XSS-Protection header with the value `1; mode=block`. Default is true.
func GetSecureContentSecurityPolicy ¶
func GetSecureContentSecurityPolicy() string
GetSecureContentSecurityPolicy allows the Content-Security-Policy header value to be set with a custom value. Default is "". Passing a template string will replace `$NONCE` with a dynamic nonce value of 16 bytes for each request which can be later retrieved using the Nonce function.
func GetSecureContentSecurityPolicyReportOnly ¶
func GetSecureContentSecurityPolicyReportOnly() string
GetSecureContentSecurityPolicyReportOnly allows the Content-Security-Policy-Report-Only header value to be set with a custom value. Default is "".
func GetSecureContentTypeNonSniff ¶
func GetSecureContentTypeNonSniff() bool
GetSecureContentTypeNonSniff If ContentTypeNosniff is true, adds the X-Content-Type-Options header with the value `nosniff`. Default is true.
func GetSecureFeaturePolicy ¶
func GetSecureFeaturePolicy() string
GetSecureFeaturePolicy FeaturePolicy allows the Feature-Policy header with the value to be set with a custom value. Default is "".
func GetSecureForceSTSHeader ¶
func GetSecureForceSTSHeader() bool
GetSecureForceSTSHeader STS header is only included when the connection is HTTPS.
func GetSecureFrameDeny ¶
func GetSecureFrameDeny() bool
GetSecureFrameDeny If FrameDeny is set to true, adds the X-Frame-Options header with the value of `DENY`. Default is true.
func GetSecureHostsProxyHeaders ¶
func GetSecureHostsProxyHeaders() []string
GetSecureHostsProxyHeaders is a set of header keys that may hold a proxied hostname value for the request.
func GetSecurePublicKey ¶
func GetSecurePublicKey() string
GetSecurePublicKey PublicKey implements HPKP to prevent MITM attacks with forged certificates. Default is "".
func GetSecureReferrerPolicy ¶
func GetSecureReferrerPolicy() string
GetSecureReferrerPolicy ReferrerPolicy allows the Referrer-Policy header with the value to be set with a custom value. Default is "".
func GetSecureSTSIncludeSubdomains ¶
func GetSecureSTSIncludeSubdomains() bool
GetSecureSTSIncludeSubdomains If STSIncludeSubdomains is set to true, the `includeSubdomains` will be appended to the Strict-Transport-Security header. Default is false.
func GetSecureSTSPreload ¶
func GetSecureSTSPreload() bool
GetSecureSTSPreload If STSPreload is set to true, the `preload` flag will be appended to the Strict-Transport-Security header. Default is false.
func GetSecureSTSSeconds ¶
func GetSecureSTSSeconds() int64
GetSecureSTSSeconds is the max-age of the Strict-Transport-Security header. Default is 0, which would NOT include the header.
func GetSecureTLSHost ¶
func GetSecureTLSHost() string
GetSecureTLSHost is the host name that is used to redirect HTTP requests to HTTPS. Default is "", which indicates to use the same host.
func GetSecureTLSTemporaryRedirect ¶
func GetSecureTLSTemporaryRedirect() bool
GetSecureTLSTemporaryRedirect If TLSTemporaryRedirect is true, the a 302 will be used while redirecting. Default is false (301).
func GetTLSPort ¶
func GetTLSPort() int
GetTLSPort gets console tls port set on env variable or default one
func GetTLSRedirect ¶
func GetTLSRedirect() string
GetTLSRedirect if is set to true, then only allow HTTPS requests. Default is true.
func GetTenantConfiguration ¶
func GetTenantConfiguration(ctx context.Context, clientSet K8sClientI, tenant *miniov2.Tenant) (map[string]string, error)
GetTenantConfiguration returns the config for a tenant
func GetTenantServiceURL ¶
GetTenantServiceURL gets tenant's service url with the proper scheme and port
func K8sClient ¶
func K8sClient(token string) (*kubernetes.Clientset, error)
K8sClient returns kubernetes client using GetK8sConfig for its config
func NewAdminClientWithInsecure ¶
func NewAdminClientWithInsecure(url, accessKey, secretKey, sessionToken string, insecure bool) (*madmin.AdminClient, *probe.Error)
NewAdminClientWithInsecure gives a new madmin client interface either secure or insecure based on parameter
func NewSessionCookieForConsole ¶
NewSessionCookieForConsole creates a cookie for a token
func PrepareClientTransport ¶
PrepareClientTransport prepares http transport
func PrepareConsoleHTTPClient ¶
PrepareConsoleHTTPClient returns an http.Client with custom configurations need it by *credentials.STSAssumeRole custom configurations include the use of CA certificates
func PrepareSTSClientTransport ¶
PrepareSTSClientTransport :
func SetPolicy ¶
func SetPolicy(ctx context.Context, client MinioAdmin, name, entityName string, entityType models.PolicyEntity) error
SetPolicy calls MinIO server to assign policy to a group or user.
func SubnetLogin ¶
SubnetLogin start login
func SubnetRegisterWithAPIKey ¶
func SubnetRegisterWithAPIKey(ctx context.Context, minioClient MinioAdmin, apiKey string) (bool, error)
SubnetRegisterWithAPIKey start registration with api key
Types ¶
type AdminClient ¶
type AdminClient struct {
Client *madmin.AdminClient
}
AdminClient Interface implementation
Define the structure of a minIO Client and define the functions that are actually used from minIO api.
func (AdminClient) AccountInfo ¶
func (ac AdminClient) AccountInfo(ctx context.Context) (madmin.AccountInfo, error)
AccountInfo implements madmin.AccountInfo()
type AdminClientMock ¶
type AdminClientMock struct{}
AdminClientMock mock client
func (AdminClientMock) AccountInfo ¶
func (ac AdminClientMock) AccountInfo(ctx context.Context) (madmin.AccountInfo, error)
AccountInfo mock
type ConsoleCredentials ¶
type ConsoleCredentials struct { ConsoleCredentials *credentials.Credentials AccountAccessKey string }
ConsoleCredentials Interface implementation
func (ConsoleCredentials) Expire ¶
func (c ConsoleCredentials) Expire()
Expire implements *Login.Expire()
func (ConsoleCredentials) Get ¶
func (c ConsoleCredentials) Get() (credentials.Value, error)
Get implements *Login.Get()
func (ConsoleCredentials) GetAccountAccessKey ¶
func (c ConsoleCredentials) GetAccountAccessKey() string
GetAccountAccessKey implementation
type ConsoleCredentialsI ¶
type ConsoleCredentialsI interface { Get() (credentials.Value, error) Expire() GetAccountAccessKey() string }
ConsoleCredentialsI interface with all functions to be implemented by mock when testing, it should include all needed consoleCredentials.Login api calls that are used within this project.
type Context ¶
type Context struct { Host string HTTPPort, HTTPSPort int TLSRedirect string // Legacy options, TODO: remove in future TLSCertificate, TLSKey, TLSca string }
Context captures all command line flags values
type K8sClientI ¶
type K8sClientI interface {
// contains filtered or unexported methods
}
K8sClientI interface with all functions to be implemented by mock when testing, it should include all K8sClientI respective api calls that are used within this project.
type LicenseTokenConfig ¶
LicenseTokenConfig stores subnet license information
func GetSubnetKeyFromMinIOConfig ¶
func GetSubnetKeyFromMinIOConfig(ctx context.Context, adminClient MinioAdmin) (*LicenseTokenConfig, error)
GetSubnetKeyFromMinIOConfig return subnet config stored in minio
func RegisterWithAPIKey ¶
func RegisterWithAPIKey(admInfo madmin.InfoMessage, apiKey string) (*LicenseTokenConfig, error)
RegisterWithAPIKey registers minio instance in subnet
type MCClient ¶
type MCClient interface {
// contains filtered or unexported methods
}
MCClient interface with all functions to be implemented by mock when testing, it should include all mc/S3Client respective api calls that are used within this project.
type MinIOConfig ¶
type MinIOConfig struct {
OpenIDProviders oauth2.OpenIDPCfg
}
MinIOConfig represents application configuration passed in from the MinIO server to the console.
type MinioAdmin ¶
type MinioAdmin interface { AccountInfo(ctx context.Context) (madmin.AccountInfo, error) // contains filtered or unexported methods }
MinioAdmin interface with all functions to be implemented by mock when testing, it should include all MinioAdmin respective api calls that are used within this project.
type MinioClient ¶
type MinioClient interface { GetBucketTagging(ctx context.Context, bucketName string) (*tags.Tags, error) SetBucketTagging(ctx context.Context, bucketName string, tags *tags.Tags) error RemoveBucketTagging(ctx context.Context, bucketName string) error // contains filtered or unexported methods }
MinioClient interface with all functions to be implemented by mock when testing, it should include all MinioClient respective api calls that are used within this project.
type NodeResourceInfo ¶
NodeResourceInfo node information
type OperatorClient ¶
OperatorClient interface with all functions to be implemented by mock when testing, it should include all OperatorClient respective api calls that are used within this project.
type OperatorClientI ¶
type OperatorClientI interface { TenantDelete(ctx context.Context, namespace string, instanceName string, options metav1.DeleteOptions) error TenantGet(ctx context.Context, namespace string, instanceName string, options metav1.GetOptions) (*miniov2.Tenant, error) TenantPatch(ctx context.Context, namespace string, instanceName string, pt types.PatchType, data []byte, options metav1.PatchOptions) (*miniov2.Tenant, error) TenantUpdate(ctx context.Context, tenant *miniov2.Tenant, opts metav1.UpdateOptions) (*miniov2.Tenant, error) TenantList(ctx context.Context, namespace string, opts metav1.ListOptions) (*miniov2.TenantList, error) }
OperatorClientI interface with all functions to be implemented by mock when testing, it should include all OperatorClientI respective api calls that are used within this project.
type Server ¶
type Server struct { EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` MaxHeaderSize flagext.ByteSize `` /* 231-byte string literal not displayed */ SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/operator.sock"` Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` KeepAlive time.Duration `` /* 169-byte string literal not displayed */ ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` TLSKeepAlive time.Duration `` /* 160-byte string literal not displayed */ TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` // contains filtered or unexported fields }
Server for the operator API
func NewServer ¶
func NewServer(api *operations.OperatorAPI) *Server
NewServer creates a new api operator server but does not configure it
func (*Server) ConfigureAPI ¶
func (s *Server) ConfigureAPI()
ConfigureAPI configures the API and handlers.
func (*Server) ConfigureFlags ¶
func (s *Server) ConfigureFlags()
ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse
func (*Server) Fatalf ¶
Fatalf logs message either via defined user logger or via system one if no user logger is defined. Exits with non-zero status after printing
func (*Server) GetHandler ¶
GetHandler returns a handler useful for testing
func (*Server) HTTPListener ¶
HTTPListener returns the http listener
func (*Server) Logf ¶
Logf logs message either via defined user logger or via system one if no user logger is defined.
func (*Server) SetAPI ¶
func (s *Server) SetAPI(api *operations.OperatorAPI)
SetAPI configures the server with the specified API. Needs to be called before Serve
func (*Server) SetHandler ¶
SetHandler allows for setting a http handler on this server
func (*Server) TLSListener ¶
TLSListener returns the https listener
type SubnetPlan ¶
type SubnetPlan int
SubnetPlan stores the plan
const ( PlanAGPL SubnetPlan = iota PlanStandard PlanEnterprise )
license enums
func (SubnetPlan) String ¶
func (sp SubnetPlan) String() string
type UsageInfo ¶
type UsageInfo struct { Buckets int64 Objects int64 Usage int64 DisksUsage int64 Servers []*models.ServerProperties EndpointNotReady bool Backend *models.BackendProperties }
UsageInfo usage info
func GetAdminInfo ¶
func GetAdminInfo(ctx context.Context, client MinioAdmin) (*UsageInfo, error)
GetAdminInfo invokes admin info and returns a parsed `UsageInfo` structure
Source Files ¶
- admin_client_mock.go
- admin_info.go
- admin_policies.go
- certificate-handlers.go
- client-admin.go
- client.go
- config.go
- configuration-handlers.go
- configure_operator.go
- consts.go
- cookies.go
- doc.go
- domain-handlers.go
- embedded_spec.go
- encryption-handlers.go
- errors.go
- event-handlers.go
- idp-handlers.go
- k8s_client.go
- k8s_client_mock.go
- kubernetes.go
- license.go
- login.go
- logout.go
- logs.go
- marketplace.go
- minio.go
- minio_operator_mock.go
- namespaces.go
- nodes.go
- operator.go
- operator_client.go
- operator_subnet.go
- parity.go
- pod-handlers.go
- pool-handlers.go
- proxy.go
- resource_quota.go
- server.go
- session.go
- subnet-utils.go
- tenant-add-handlers.go
- tenant-get-handlers.go
- tenant-handlers.go
- tenant_update.go
- tenants_helper.go
- tls.go
- users-handlers.go
- utils.go
- version.go
- volumes.go
- yaml-handlers.go