} />
} />
- }
- pageHeaderText={"Support"}
- title={"Call Home"}
- message={This feature is currently not available.
}
- />
- }
- />
+ } />
} />
} />
diff --git a/portal-ui/src/screens/Console/valid-routes.ts b/portal-ui/src/screens/Console/valid-routes.ts
index 413fc188d..8cd30692e 100644
--- a/portal-ui/src/screens/Console/valid-routes.ts
+++ b/portal-ui/src/screens/Console/valid-routes.ts
@@ -31,6 +31,7 @@ import {
BucketsMenuIcon,
ClustersIcon,
DocumentationIcon,
+ CallHomeMenuIcon,
DrivesMenuIcon,
GroupsMenuIcon,
HealthMenuIcon,
@@ -48,7 +49,6 @@ import {
RegisterMenuIcon,
SettingsIcon,
StorageIcon,
- SupportMenuIcon,
TenantsOutlineIcon,
TiersIcon,
TraceMenuIcon,
@@ -280,12 +280,6 @@ export const validRoutes = (
badge: LicenseBadge,
forceDisplay: true,
},
- {
- group: "Subscription",
- name: "Support",
- id: "support",
- icon: SupportMenuIcon,
- },
{
group: "Subscription",
name: "Health",
@@ -318,6 +312,14 @@ export const validRoutes = (
icon: InspectMenuIcon,
component: NavLink,
},
+ {
+ group: "Subscription",
+ name: "Call Home",
+ id: "callhome",
+ component: NavLink,
+ icon: CallHomeMenuIcon,
+ to: IAM_PAGES.CALL_HOME,
+ },
];
let operatorMenus: IMenuItem[] = [
diff --git a/restapi/admin_client_mock.go b/restapi/admin_client_mock.go
index 71bdb26d6..93f11cb80 100644
--- a/restapi/admin_client_mock.go
+++ b/restapi/admin_client_mock.go
@@ -31,10 +31,11 @@ var (
MinioServerInfoMock func(ctx context.Context) (madmin.InfoMessage, error)
minioChangePasswordMock func(ctx context.Context, accessKey, secretKey string) error
- minioHelpConfigKVMock func(subSys, key string, envOnly bool) (madmin.Help, error)
- minioGetConfigKVMock func(key string) ([]byte, error)
- minioSetConfigKVMock func(kv string) (restart bool, err error)
- minioDelConfigKVMock func(name string) (err error)
+ minioHelpConfigKVMock func(subSys, key string, envOnly bool) (madmin.Help, error)
+ minioGetConfigKVMock func(key string) ([]byte, error)
+ minioSetConfigKVMock func(kv string) (restart bool, err error)
+ minioDelConfigKVMock func(name string) (err error)
+ minioHelpConfigKVGlobalMock func(envOnly bool) (madmin.Help, error)
minioGetLogsMock func(ctx context.Context, node string, lineCnt int, logKind string) <-chan madmin.LogInfo
@@ -133,6 +134,11 @@ func (ac AdminClientMock) setConfigKV(ctx context.Context, kv string) (restart b
return minioSetConfigKVMock(kv)
}
+// mock function helpConfigKV()
+func (ac AdminClientMock) helpConfigKVGlobal(ctx context.Context, envOnly bool) (madmin.Help, error) {
+ return minioHelpConfigKVGlobalMock(envOnly)
+}
+
func (ac AdminClientMock) delConfigKV(ctx context.Context, name string) (err error) {
return minioDelConfigKVMock(name)
}
diff --git a/restapi/client-admin.go b/restapi/client-admin.go
index 942cb1f88..d12053dcd 100644
--- a/restapi/client-admin.go
+++ b/restapi/client-admin.go
@@ -83,8 +83,10 @@ type MinioAdmin interface {
setPolicy(ctx context.Context, policyName, entityName string, isGroup bool) error
getConfigKV(ctx context.Context, key string) ([]byte, error)
helpConfigKV(ctx context.Context, subSys, key string, envOnly bool) (madmin.Help, error)
+ helpConfigKVGlobal(ctx context.Context, envOnly bool) (madmin.Help, error)
setConfigKV(ctx context.Context, kv string) (restart bool, err error)
delConfigKV(ctx context.Context, kv string) (err error)
+
serviceRestart(ctx context.Context) error
serverInfo(ctx context.Context) (madmin.InfoMessage, error)
startProfiling(ctx context.Context, profiler madmin.ProfilerType) ([]madmin.StartProfilingResult, error)
@@ -269,6 +271,11 @@ func (ac AdminClient) helpConfigKV(ctx context.Context, subSys, key string, envO
return ac.Client.HelpConfigKV(ctx, subSys, key, envOnly)
}
+// implements madmin.helpConfigKVGlobal()
+func (ac AdminClient) helpConfigKVGlobal(ctx context.Context, envOnly bool) (madmin.Help, error) {
+ return ac.Client.HelpConfigKV(ctx, "", "", envOnly)
+}
+
// implements madmin.SetConfigKV()
func (ac AdminClient) setConfigKV(ctx context.Context, kv string) (restart bool, err error) {
return ac.Client.SetConfigKV(ctx, kv)
diff --git a/restapi/configure_console.go b/restapi/configure_console.go
index a8e933063..de6ba034c 100644
--- a/restapi/configure_console.go
+++ b/restapi/configure_console.go
@@ -156,6 +156,8 @@ func configureAPI(api *operations.ConsoleAPI) http.Handler {
registerSiteReplicationHandler(api)
registerSiteReplicationStatusHandler(api)
+ // Register Support Handler
+ registerSupportHandlers(api)
// Operator Console
diff --git a/restapi/embedded_spec.go b/restapi/embedded_spec.go
index 5f43ff67d..078033300 100644
--- a/restapi/embedded_spec.go
+++ b/restapi/embedded_spec.go
@@ -4725,6 +4725,57 @@ func init() {
}
}
},
+ "/support/callhome": {
+ "get": {
+ "tags": [
+ "Support"
+ ],
+ "summary": "Get Callhome current status",
+ "operationId": "GetCallHomeOptionValue",
+ "responses": {
+ "200": {
+ "description": "A successful response.",
+ "schema": {
+ "$ref": "#/definitions/callHomeGetResponse"
+ }
+ },
+ "default": {
+ "description": "Generic error response.",
+ "schema": {
+ "$ref": "#/definitions/error"
+ }
+ }
+ }
+ },
+ "put": {
+ "tags": [
+ "Support"
+ ],
+ "summary": "Sets callhome status",
+ "operationId": "SetCallHomeStatus",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/callHomeSetStatus"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "A successful response."
+ },
+ "default": {
+ "description": "Generic error response.",
+ "schema": {
+ "$ref": "#/definitions/error"
+ }
+ }
+ }
+ }
+ },
"/user/policy": {
"get": {
"tags": [
@@ -5828,6 +5879,32 @@ func init() {
}
}
},
+ "callHomeGetResponse": {
+ "type": "object",
+ "properties": {
+ "diagnosticsStatus": {
+ "type": "boolean"
+ },
+ "logsStatus": {
+ "type": "boolean"
+ }
+ }
+ },
+ "callHomeSetStatus": {
+ "type": "object",
+ "required": [
+ "diagState",
+ "logsState"
+ ],
+ "properties": {
+ "diagState": {
+ "type": "boolean"
+ },
+ "logsState": {
+ "type": "boolean"
+ }
+ }
+ },
"changeUserPasswordRequest": {
"type": "object",
"required": [
@@ -13418,6 +13495,57 @@ func init() {
}
}
},
+ "/support/callhome": {
+ "get": {
+ "tags": [
+ "Support"
+ ],
+ "summary": "Get Callhome current status",
+ "operationId": "GetCallHomeOptionValue",
+ "responses": {
+ "200": {
+ "description": "A successful response.",
+ "schema": {
+ "$ref": "#/definitions/callHomeGetResponse"
+ }
+ },
+ "default": {
+ "description": "Generic error response.",
+ "schema": {
+ "$ref": "#/definitions/error"
+ }
+ }
+ }
+ },
+ "put": {
+ "tags": [
+ "Support"
+ ],
+ "summary": "Sets callhome status",
+ "operationId": "SetCallHomeStatus",
+ "parameters": [
+ {
+ "name": "body",
+ "in": "body",
+ "required": true,
+ "schema": {
+ "$ref": "#/definitions/callHomeSetStatus"
+ }
+ }
+ ],
+ "responses": {
+ "204": {
+ "description": "A successful response."
+ },
+ "default": {
+ "description": "Generic error response.",
+ "schema": {
+ "$ref": "#/definitions/error"
+ }
+ }
+ }
+ }
+ },
"/user/policy": {
"get": {
"tags": [
@@ -14647,6 +14775,32 @@ func init() {
}
}
},
+ "callHomeGetResponse": {
+ "type": "object",
+ "properties": {
+ "diagnosticsStatus": {
+ "type": "boolean"
+ },
+ "logsStatus": {
+ "type": "boolean"
+ }
+ }
+ },
+ "callHomeSetStatus": {
+ "type": "object",
+ "required": [
+ "diagState",
+ "logsState"
+ ],
+ "properties": {
+ "diagState": {
+ "type": "boolean"
+ },
+ "logsState": {
+ "type": "boolean"
+ }
+ }
+ },
"changeUserPasswordRequest": {
"type": "object",
"required": [
diff --git a/restapi/operations/console_api.go b/restapi/operations/console_api.go
index 129acb428..f47ca9e69 100644
--- a/restapi/operations/console_api.go
+++ b/restapi/operations/console_api.go
@@ -55,6 +55,7 @@ import (
"github.com/minio/console/restapi/operations/service_account"
"github.com/minio/console/restapi/operations/site_replication"
"github.com/minio/console/restapi/operations/subnet"
+ "github.com/minio/console/restapi/operations/support"
"github.com/minio/console/restapi/operations/system"
"github.com/minio/console/restapi/operations/tiering"
"github.com/minio/console/restapi/operations/user"
@@ -243,6 +244,9 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
BucketGetBucketVersioningHandler: bucket.GetBucketVersioningHandlerFunc(func(params bucket.GetBucketVersioningParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation bucket.GetBucketVersioning has not yet been implemented")
}),
+ SupportGetCallHomeOptionValueHandler: support.GetCallHomeOptionValueHandlerFunc(func(params support.GetCallHomeOptionValueParams, principal *models.Principal) middleware.Responder {
+ return middleware.NotImplemented("operation support.GetCallHomeOptionValue has not yet been implemented")
+ }),
IdpGetConfigurationHandler: idp.GetConfigurationHandlerFunc(func(params idp.GetConfigurationParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation idp.GetConfiguration has not yet been implemented")
}),
@@ -471,6 +475,9 @@ func NewConsoleAPI(spec *loads.Document) *ConsoleAPI {
BucketSetBucketVersioningHandler: bucket.SetBucketVersioningHandlerFunc(func(params bucket.SetBucketVersioningParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation bucket.SetBucketVersioning has not yet been implemented")
}),
+ SupportSetCallHomeStatusHandler: support.SetCallHomeStatusHandlerFunc(func(params support.SetCallHomeStatusParams, principal *models.Principal) middleware.Responder {
+ return middleware.NotImplemented("operation support.SetCallHomeStatus has not yet been implemented")
+ }),
ConfigurationSetConfigHandler: configuration.SetConfigHandlerFunc(func(params configuration.SetConfigParams, principal *models.Principal) middleware.Responder {
return middleware.NotImplemented("operation configuration.SetConfig has not yet been implemented")
}),
@@ -707,6 +714,8 @@ type ConsoleAPI struct {
BucketGetBucketRewindHandler bucket.GetBucketRewindHandler
// BucketGetBucketVersioningHandler sets the operation handler for the get bucket versioning operation
BucketGetBucketVersioningHandler bucket.GetBucketVersioningHandler
+ // SupportGetCallHomeOptionValueHandler sets the operation handler for the get call home option value operation
+ SupportGetCallHomeOptionValueHandler support.GetCallHomeOptionValueHandler
// IdpGetConfigurationHandler sets the operation handler for the get configuration operation
IdpGetConfigurationHandler idp.GetConfigurationHandler
// ObjectGetObjectMetadataHandler sets the operation handler for the get object metadata operation
@@ -859,6 +868,8 @@ type ConsoleAPI struct {
BucketSetBucketRetentionConfigHandler bucket.SetBucketRetentionConfigHandler
// BucketSetBucketVersioningHandler sets the operation handler for the set bucket versioning operation
BucketSetBucketVersioningHandler bucket.SetBucketVersioningHandler
+ // SupportSetCallHomeStatusHandler sets the operation handler for the set call home status operation
+ SupportSetCallHomeStatusHandler support.SetCallHomeStatusHandler
// ConfigurationSetConfigHandler sets the operation handler for the set config operation
ConfigurationSetConfigHandler configuration.SetConfigHandler
// BucketSetMultiBucketReplicationHandler sets the operation handler for the set multi bucket replication operation
@@ -1152,6 +1163,9 @@ func (o *ConsoleAPI) Validate() error {
if o.BucketGetBucketVersioningHandler == nil {
unregistered = append(unregistered, "bucket.GetBucketVersioningHandler")
}
+ if o.SupportGetCallHomeOptionValueHandler == nil {
+ unregistered = append(unregistered, "support.GetCallHomeOptionValueHandler")
+ }
if o.IdpGetConfigurationHandler == nil {
unregistered = append(unregistered, "idp.GetConfigurationHandler")
}
@@ -1380,6 +1394,9 @@ func (o *ConsoleAPI) Validate() error {
if o.BucketSetBucketVersioningHandler == nil {
unregistered = append(unregistered, "bucket.SetBucketVersioningHandler")
}
+ if o.SupportSetCallHomeStatusHandler == nil {
+ unregistered = append(unregistered, "support.SetCallHomeStatusHandler")
+ }
if o.ConfigurationSetConfigHandler == nil {
unregistered = append(unregistered, "configuration.SetConfigHandler")
}
@@ -1767,6 +1784,10 @@ func (o *ConsoleAPI) initHandlerCache() {
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
+ o.handlers["GET"]["/support/callhome"] = support.NewGetCallHomeOptionValue(o.context, o.SupportGetCallHomeOptionValueHandler)
+ if o.handlers["GET"] == nil {
+ o.handlers["GET"] = make(map[string]http.Handler)
+ }
o.handlers["GET"]["/idp/{type}/{name}"] = idp.NewGetConfiguration(o.context, o.IdpGetConfigurationHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
@@ -2071,6 +2092,10 @@ func (o *ConsoleAPI) initHandlerCache() {
if o.handlers["PUT"] == nil {
o.handlers["PUT"] = make(map[string]http.Handler)
}
+ o.handlers["PUT"]["/support/callhome"] = support.NewSetCallHomeStatus(o.context, o.SupportSetCallHomeStatusHandler)
+ if o.handlers["PUT"] == nil {
+ o.handlers["PUT"] = make(map[string]http.Handler)
+ }
o.handlers["PUT"]["/configs/{name}"] = configuration.NewSetConfig(o.context, o.ConfigurationSetConfigHandler)
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
diff --git a/restapi/operations/support/get_call_home_option_value.go b/restapi/operations/support/get_call_home_option_value.go
new file mode 100644
index 000000000..54d60453a
--- /dev/null
+++ b/restapi/operations/support/get_call_home_option_value.go
@@ -0,0 +1,88 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+// This file is part of MinIO Console Server
+// Copyright (c) 2023 MinIO, Inc.
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Affero General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Affero General Public License for more details.
+//
+// You should have received a copy of the GNU Affero General Public License
+// along with this program. If not, see