airshipctl/pkg/remote/types.go
Drew Walters bd51d1f31b Add remote Client interface
The remote package in airshipctl is tightly coupled to redfish. In
the future, we may need to introduce IPMI or SMASH; however, adding
those clients now would be difficult because of our tight dependence on
redfish. This change adds a Client interface, remote.Client, that will
be implemented by all OOB clients (i.e. Redfish, SMASH, IPMI) in order
to satisfy remoteDirect and future power commands. This change also
creates a Redfish client that implements the client.

A future change will remove the old Redfish client and de-couple the
remoteDirect functionality from the redfish package.

Relates #5, #122

Change-Id: Id9fe09e74efef0c4fcd5b92a1c12897217a4dae1
Signed-off-by: Drew Walters <andrew.walters@att.com>
2020-04-01 18:37:47 +00:00

33 lines
1.3 KiB
Go

// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package remote
import (
"context"
)
// Client is a set of functions that clients created for out-of-band power management and control should implement. The
// functions within client are used by power management commands and remote direct functionality.
type Client interface {
RebootSystem(context.Context, string) error
EphemeralNodeID() string
// TODO(drewwalters96): This function may be too tightly coupled to remoteDirect operations. This could probably
// be combined with SetVirtualMedia.
SetEphemeralBootSourceByType(context.Context, string) error
// TODO(drewwalters96): This function is tightly coupled to Redfish. It should be combined with the
// SetBootSource operation and removed from the client interface.
SetVirtualMedia(context.Context, string, string) error
}