Documentation
¶
Index ¶
- Constants
- type Controller
- func (cl *Controller) Close() error
- func (cl *Controller) ControllerInfo(ctx context.Context) (models.ControllerInfo, error)
- func (cl *Controller) ControllerVersion(ctx context.Context) (models.Version, error)
- func (cl *Controller) FirmwareUpdates(ctx context.Context) (models.ControllerUpdateInfo, error)
- func (cl *Controller) GetControllerUpgradeStatus(ctx context.Context) (*models.HardwareUpgradeStatus, error)
- func (cl *Controller) InstallControllerFirmware(ctx context.Context, targetVersion string) error
- func (cl *Controller) Reboot(ctx context.Context) error
- func (cl *Controller) SetCertificate(ctx context.Context, keyPEM, certPEM string) error
- func (cl *Controller) Shutdown(ctx context.Context) error
- func (cl *Controller) Site(ctx context.Context, siteID string) (models.Site, error)
- func (cl *Controller) SiteByName(ctx context.Context, name string) (models.Site, error)
- func (cl *Controller) SiteClient(ctx context.Context, siteID string) (*site.SiteClient, error)
- func (cl *Controller) Sites(ctx context.Context) ([]models.Site, error)
- func (cl *Controller) UpdateFirmwareChannel(ctx context.Context, section UpdateSection, channel string) error
- type Option
- type SiteClient
- type UpdateSection
Constants ¶
const ( // UpdateSectionHardware targets hardware (firmware) controller updates. UpdateSectionHardware = models.UpdateSectionHardware // UpdateSectionSoftware targets software controller updates. UpdateSectionSoftware = models.UpdateSectionSoftware )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
Controller is the controller-level API facade. Controller-scoped operations that do not belong to a site are served through it.
func New ¶
func New(controllerURL, username, password string, opts ...Option) (*Controller, error)
New creates a Controller for the controller at controllerURL and performs the initial login. New has no context; the initial login uses context.Background.
func (*Controller) Close ¶
func (cl *Controller) Close() error
Close releases pooled idle connections.
func (*Controller) ControllerInfo ¶
func (cl *Controller) ControllerInfo(ctx context.Context) (models.ControllerInfo, error)
models.ControllerInfo fetches unauthenticated controller diagnostic information.
func (*Controller) ControllerVersion ¶
ControllerVersion returns the controller software version.
func (*Controller) FirmwareUpdates ¶
func (cl *Controller) FirmwareUpdates(ctx context.Context) (models.ControllerUpdateInfo, error)
FirmwareUpdates checks for controller firmware updates.
func (*Controller) GetControllerUpgradeStatus ¶
func (cl *Controller) GetControllerUpgradeStatus(ctx context.Context) (*models.HardwareUpgradeStatus, error)
GetControllerUpgradeStatus returns the status of an ongoing hardware controller firmware upgrade.
func (*Controller) InstallControllerFirmware ¶
func (cl *Controller) InstallControllerFirmware(ctx context.Context, targetVersion string) error
InstallControllerFirmware installs controller firmware to the given target version.
func (*Controller) Reboot ¶
func (cl *Controller) Reboot(ctx context.Context) error
Reboot reboots the controller.
func (*Controller) SetCertificate ¶
func (cl *Controller) SetCertificate(ctx context.Context, keyPEM, certPEM string) error
SetCertificate uploads a PEM certificate and its unencrypted private key, then makes them the controller's HTTPS certificate. It changes only the certificate setting.
func (*Controller) Shutdown ¶
func (cl *Controller) Shutdown(ctx context.Context) error
Shutdown shuts the controller down.
func (*Controller) SiteByName ¶
SiteByName resolves a site by display name.
func (*Controller) SiteClient ¶
func (cl *Controller) SiteClient(ctx context.Context, siteID string) (*site.SiteClient, error)
SiteClient validates the site and returns a site-scoped client handle.
func (*Controller) UpdateFirmwareChannel ¶
func (cl *Controller) UpdateFirmwareChannel(ctx context.Context, section UpdateSection, channel string) error
UpdateFirmwareChannel selects the firmware release channel to check.
type Option ¶
type Option func(*options)
Option customizes a Controller.
func WithHTTPClient ¶
WithHTTPClient sets the *http.Client used for controller requests.
func WithInsecureSkipVerify ¶
func WithInsecureSkipVerify() Option
WithInsecureSkipVerify enables TLS certificate verification skipping.
func WithTimeout ¶
WithTimeout sets the timeout applied to controller requests.
type SiteClient ¶
type SiteClient = site.SiteClient
SiteClient is the site-scoped API handle, defined in the site package.
type UpdateSection ¶
type UpdateSection = models.UpdateSection
UpdateSection is the firmware update section, defined in the models package.