Documentation
¶
Index ¶
- Constants
- Variables
- func CertificatesToDTO(r *publickey.RefinedPullResponse) dto.CertificatePullResponse
- func FindBootSettingInstances(bootSourceSettings []cimBoot.BootSourceSetting) dtov2.BootSettings
- func KeysToDTO(r *publicprivate.RefinedPullResponse) dto.KeyPullResponse
- func ParseInterval(duration string) (int, error)
- func RandomValueHex(length int) (string, error)
- func ValidateHTTPBootParams(url, username, password string) (buffer []byte, paramCount int, err error)
- func ValidatePBAWinReBootParams(file string) (buffer []byte, paramCount int, err error)
- type AMTError
- type DeviceConnection
- type ExplorerError
- type Feature
- type NotSupportedError
- type OCRData
- type Redirection
- type Redirector
- func (g *Redirector) RedirectClose(_ context.Context, deviceConnection *DeviceConnection) error
- func (g *Redirector) RedirectConnect(_ context.Context, deviceConnection *DeviceConnection) error
- func (g *Redirector) RedirectListen(_ context.Context, deviceConnection *DeviceConnection) ([]byte, error)
- func (g *Redirector) RedirectSend(_ context.Context, deviceConnection *DeviceConnection, data []byte) error
- func (g *Redirector) SetupWsmanClient(device entity.Device, isRedirection, logAMTMessages bool) wsman.Messages
- type Repository
- type UseCase
- func (uc *UseCase) AddCertificate(c context.Context, guid string, certInfo dto.CertInfo) (handle string, err error)
- func (uc *UseCase) CancelUserConsent(c context.Context, guid string) (dto.UserConsentMessage, error)
- func (uc *UseCase) CreateAlarmOccurrences(c context.Context, guid string, alarm dto.AlarmClockOccurrenceInput) (dto.AddAlarmOutput, error)
- func (uc *UseCase) Delete(ctx context.Context, guid, tenantID string) error
- func (uc *UseCase) DeleteAlarmOccurrences(c context.Context, guid, instanceID string) error
- func (uc *UseCase) Get(ctx context.Context, top, skip int, tenantID string) ([]dto.Device, error)
- func (uc *UseCase) GetAlarmOccurrences(c context.Context, guid string) ([]dto.AlarmClockOccurrence, error)
- func (uc *UseCase) GetAuditLog(c context.Context, startIndex int, guid string) (dto.AuditLog, error)
- func (uc *UseCase) GetBootSourceSetting(c context.Context, guid string) ([]dto.BootSources, error)
- func (uc *UseCase) GetByColumn(ctx context.Context, columnName, queryValue, tenantID string) ([]dto.Device, error)
- func (uc *UseCase) GetByID(ctx context.Context, guid, tenantID string, includeSecrets bool) (*dto.Device, error)
- func (uc *UseCase) GetByTags(ctx context.Context, tags, method string, limit, offset int, tenantID string) ([]dto.Device, error)
- func (uc *UseCase) GetCertificates(c context.Context, guid string) (dto.SecuritySettings, error)
- func (uc *UseCase) GetCount(ctx context.Context, tenantID string) (int, error)
- func (uc *UseCase) GetDeviceCertificate(c context.Context, guid string) (dto.Certificate, error)
- func (uc *UseCase) GetDiskInfo(c context.Context, guid string) (dto.DiskInfo, error)
- func (uc *UseCase) GetDistinctTags(ctx context.Context, tenantID string) ([]string, error)
- func (uc *UseCase) GetEventLog(c context.Context, startIndex, maxReadRecords int, guid string) (dto.EventLogs, error)
- func (uc *UseCase) GetFeatures(c context.Context, guid string) (settingsResults dto.Features, settingsResultsV2 dtov2.Features, err error)
- func (uc *UseCase) GetGeneralSettings(c context.Context, guid string) (dto.GeneralSettings, error)
- func (uc *UseCase) GetHardwareInfo(c context.Context, guid string) (dto.HardwareInfo, error)
- func (uc *UseCase) GetKVMScreenSettings(c context.Context, guid string) (dto.KVMScreenSettings, error)
- func (uc *UseCase) GetNetworkSettings(c context.Context, guid string) (dto.NetworkSettings, error)
- func (uc *UseCase) GetPowerCapabilities(c context.Context, guid string) (dto.PowerCapabilities, error)
- func (uc *UseCase) GetPowerState(c context.Context, guid string) (dto.PowerState, error)
- func (uc *UseCase) GetTLSSettingData(c context.Context, guid string) ([]dto.SettingDataResponse, error)
- func (uc *UseCase) GetUserConsentCode(c context.Context, guid string) (dto.UserConsentMessage, error)
- func (uc *UseCase) GetVersion(c context.Context, guid string) (v1 dto.Version, v2 dtov2.Version, err error)
- func (uc *UseCase) Insert(ctx context.Context, d *dto.Device) (*dto.Device, error)
- func (uc *UseCase) ListenToBrowser(deviceConnection *DeviceConnection)
- func (uc *UseCase) ListenToDevice(deviceConnection *DeviceConnection)
- func (uc *UseCase) MonitorConnectionHealth(deviceConnection *DeviceConnection, key string)
- func (uc *UseCase) Redirect(c context.Context, conn *websocket.Conn, guid, mode string) error
- func (uc *UseCase) SendConsentCode(c context.Context, userConsent dto.UserConsentCode, guid string) (dto.UserConsentMessage, error)
- func (uc *UseCase) SendPowerAction(c context.Context, guid string, action int) (power.PowerActionResponse, error)
- func (uc *UseCase) SetBootOptions(c context.Context, guid string, bootSetting dto.BootSetting) (power.PowerActionResponse, error)
- func (uc *UseCase) SetFeatures(c context.Context, guid string, features dto.Features) (settingsResults dto.Features, settingsResultsV2 dtov2.Features, err error)
- func (uc *UseCase) SetKVMScreenSettings(c context.Context, guid string, reqData dto.KVMScreenSettingsRequest) (dto.KVMScreenSettings, error)
- func (uc *UseCase) Update(ctx context.Context, d *dto.Device) (*dto.Device, error)
- type ValidationError
- type WSMAN
- type WebSocketConn
Constants ¶
View Source
const ( TypeWireless string = "Wireless" TypeTLS string = "TLS" TypeWired string = "Wired" )
View Source
const ( HeaderByteSize = 9 ContentLengthPadding = 8 RedirectSessionLengthBytes = 13 RedirectionSessionReply = 4 ConnectionTimeout = 5 * time.Minute InactivityTimeout = 30 * time.Second // Close connection if no data for 30 seconds HeartbeatInterval = 30 * time.Second // Check connection health every 30 seconds )
View Source
const ( BootActionHTTPSBoot = 105 BootActionPowerOnHTTPSBoot = 106 BootActionPBA = 107 BootActionPowerOnPBA = 108 BootActionWinREBoot = 109 BootActionPowerOnWinREBoot = 110 BootActionResetToIDERCDROM = 202 BootActionPowerOnIDERCDROM = 203 BootActionResetToBIOS = 101 BootActionResetToPXE = 400 BootActionPowerOnToPXE = 401 BootActionResetToDiag = 301 BootActionResetToIDERFloppy = 200 OsToFullPower = 500 OsToPowerSaving = 501 CIMPMSPowerOn = 2 // CIM > Power Management Service > Power On )
View Source
const ( RedirectionCommandsStartRedirectionSession = 16 RedirectionCommandsStartRedirectionSessionReply = 17 RedirectionCommandsEndRedirectionSession = 18 RedirectionCommandsAuthenticateSession = 19 RedirectionCommandsAuthenticateSessionReply = 20 StartRedirectionSessionReplyStatusSuccess = 0 StartRedirectionSessionReplyStatusUnknown = 1 StartRedirectionSessionReplyStatusBusy = 2 StartRedirectionSessionReplyStatusUnsupported = 3 StartRedirectionSessionReplyStatusError = 0xFF AuthenticationTypeQuery = 0 AuthenticationTypeUserPass = 1 AuthenticationTypeKerberos = 2 AuthenticationTypeBadDigest = 3 AuthenticationTypeDigest = 4 AuthenticationStatusSuccess = 0 AuthenticationStatusFail = 1 AuthenticationStatusNotSupported = 2 // MinAMTVersion - minimum AMT version required for certain features in power capabilities. MinAMTVersion = 9 )
Variables ¶
View Source
var ( ErrValidationUseCase = ValidationError{Console: consoleerrors.CreateConsoleError("parameter validation failed")} ErrLargeFileUseCase = ValidationError{Console: consoleerrors.CreateConsoleError("UEFI file too large")} )
View Source
var ( ErrDeviceUseCase = consoleerrors.CreateConsoleError("DevicesUseCase") ErrDatabase = sqldb.DatabaseError{Console: consoleerrors.CreateConsoleError("DevicesUseCase")} ErrNotFound = sqldb.NotFoundError{Console: consoleerrors.CreateConsoleError("DevicesUseCase")} )
View Source
var ErrAMT = AMTError{Console: consoleerrors.CreateConsoleError("DevicesUseCase")}
View Source
var ErrLengthLimit = errors.New("calculated length exceeds uint32 limit")
View Source
var ErrNotSupportedUseCase = NotSupportedError{Console: consoleerrors.CreateConsoleError("Not Supported")}
View Source
var ErrOCRNotSupportedUseCase = NotSupportedError{Console: consoleerrors.CreateConsoleError("One Click Recovery Unsupported")}
View Source
var UserConsentOptions = map[int]string{
0: "none",
1: "kvm",
4294967295: "all",
}
Functions ¶
func CertificatesToDTO ¶
func CertificatesToDTO(r *publickey.RefinedPullResponse) dto.CertificatePullResponse
func FindBootSettingInstances ¶ added in v1.9.0
func FindBootSettingInstances(bootSourceSettings []cimBoot.BootSourceSetting) dtov2.BootSettings
func KeysToDTO ¶
func KeysToDTO(r *publicprivate.RefinedPullResponse) dto.KeyPullResponse
func ParseInterval ¶
func RandomValueHex ¶
func ValidateHTTPBootParams ¶ added in v1.9.0
Types ¶
type AMTError ¶
type AMTError struct {
Console consoleerrors.InternalError
}
type DeviceConnection ¶
type DeviceConnection struct {
Conn WebSocketConn
Device entity.Device
Direct bool
Mode string
Challenge client.AuthChallenge
// contains filtered or unexported fields
}
type ExplorerError ¶
type ExplorerError struct {
Console consoleerrors.InternalError
}
func (ExplorerError) Error ¶
func (e ExplorerError) Error() string
type Feature ¶
type Feature interface {
// Repository/Database Calls
GetCount(context.Context, string) (int, error)
Get(ctx context.Context, top, skip int, tenantID string) ([]dto.Device, error)
GetByID(ctx context.Context, guid, tenantID string, includeSecrets bool) (*dto.Device, error)
GetDistinctTags(ctx context.Context, tenantID string) ([]string, error)
GetByTags(ctx context.Context, tags, method string, limit, offset int, tenantID string) ([]dto.Device, error)
Delete(ctx context.Context, guid, tenantID string) error
Update(ctx context.Context, d *dto.Device) (*dto.Device, error)
Insert(ctx context.Context, d *dto.Device) (*dto.Device, error)
GetByColumn(ctx context.Context, columnName, queryValue, tenantID string) ([]dto.Device, error)
// Management Calls
GetVersion(ctx context.Context, guid string) (dto.Version, dtov2.Version, error)
GetFeatures(ctx context.Context, guid string) (dto.Features, dtov2.Features, error)
SetFeatures(ctx context.Context, guid string, features dto.Features) (dto.Features, dtov2.Features, error)
GetAlarmOccurrences(ctx context.Context, guid string) ([]dto.AlarmClockOccurrence, error)
CreateAlarmOccurrences(ctx context.Context, guid string, alarm dto.AlarmClockOccurrenceInput) (dto.AddAlarmOutput, error)
DeleteAlarmOccurrences(ctx context.Context, guid, instanceID string) error
GetHardwareInfo(ctx context.Context, guid string) (dto.HardwareInfo, error)
GetPowerState(ctx context.Context, guid string) (dto.PowerState, error)
GetPowerCapabilities(ctx context.Context, guid string) (dto.PowerCapabilities, error)
GetGeneralSettings(ctx context.Context, guid string) (dto.GeneralSettings, error)
CancelUserConsent(ctx context.Context, guid string) (dto.UserConsentMessage, error)
GetUserConsentCode(ctx context.Context, guid string) (dto.UserConsentMessage, error)
SendConsentCode(ctx context.Context, code dto.UserConsentCode, guid string) (dto.UserConsentMessage, error)
SendPowerAction(ctx context.Context, guid string, action int) (power.PowerActionResponse, error)
SetBootOptions(ctx context.Context, guid string, bootSetting dto.BootSetting) (power.PowerActionResponse, error)
GetAuditLog(ctx context.Context, startIndex int, guid string) (dto.AuditLog, error)
GetEventLog(ctx context.Context, startIndex, maxReadRecords int, guid string) (dto.EventLogs, error)
Redirect(ctx context.Context, conn *websocket.Conn, guid, mode string) error
GetNetworkSettings(c context.Context, guid string) (dto.NetworkSettings, error)
GetCertificates(c context.Context, guid string) (dto.SecuritySettings, error)
GetTLSSettingData(c context.Context, guid string) ([]dto.SettingDataResponse, error)
GetDiskInfo(c context.Context, guid string) (dto.DiskInfo, error)
GetDeviceCertificate(c context.Context, guid string) (dto.Certificate, error)
AddCertificate(c context.Context, guid string, certInfo dto.CertInfo) (string, error)
GetBootSourceSetting(c context.Context, guid string) ([]dto.BootSources, error)
// KVM Screen Settings (IPS_ScreenSettingData)
GetKVMScreenSettings(c context.Context, guid string) (dto.KVMScreenSettings, error)
SetKVMScreenSettings(c context.Context, guid string, req dto.KVMScreenSettingsRequest) (dto.KVMScreenSettings, error)
}
type NotSupportedError ¶
type NotSupportedError struct {
Console consoleerrors.InternalError
}
func (NotSupportedError) Error ¶
func (e NotSupportedError) Error() string
func (NotSupportedError) Wrap ¶
func (e NotSupportedError) Wrap(call, function, message string) error
type Redirection ¶
type Redirection interface {
SetupWsmanClient(device entity.Device, isRedirection, logMessages bool) wsman.Messages
RedirectConnect(ctx context.Context, deviceConnection *DeviceConnection) error
RedirectClose(ctx context.Context, deviceConnection *DeviceConnection) error
RedirectListen(ctx context.Context, deviceConnection *DeviceConnection) ([]byte, error)
RedirectSend(ctx context.Context, deviceConnection *DeviceConnection, message []byte) error
}
type Redirector ¶
func NewRedirector ¶
func NewRedirector(safeRequirements security.Cryptor) *Redirector
func (*Redirector) RedirectClose ¶
func (g *Redirector) RedirectClose(_ context.Context, deviceConnection *DeviceConnection) error
func (*Redirector) RedirectConnect ¶
func (g *Redirector) RedirectConnect(_ context.Context, deviceConnection *DeviceConnection) error
func (*Redirector) RedirectListen ¶
func (g *Redirector) RedirectListen(_ context.Context, deviceConnection *DeviceConnection) ([]byte, error)
func (*Redirector) RedirectSend ¶
func (g *Redirector) RedirectSend(_ context.Context, deviceConnection *DeviceConnection, data []byte) error
func (*Redirector) SetupWsmanClient ¶
type Repository ¶
type Repository interface {
GetCount(context.Context, string) (int, error)
Get(ctx context.Context, top, skip int, tenantID string) ([]entity.Device, error)
GetByID(ctx context.Context, guid, tenantID string) (*entity.Device, error)
GetDistinctTags(ctx context.Context, tenantID string) ([]string, error)
GetByTags(ctx context.Context, tags []string, method string, limit, offset int, tenantID string) ([]entity.Device, error)
Delete(ctx context.Context, guid, tenantID string) (bool, error)
Update(ctx context.Context, d *entity.Device) (bool, error)
Insert(ctx context.Context, d *entity.Device) (string, error)
GetByColumn(ctx context.Context, columnName, queryValue, tenantID string) ([]entity.Device, error)
}
type UseCase ¶
type UseCase struct {
// contains filtered or unexported fields
}
UseCase -.
func New ¶
func New(r Repository, d WSMAN, redirection Redirection, log logger.Interface, safeRequirements security.Cryptor) *UseCase
New -.
func (*UseCase) AddCertificate ¶
func (*UseCase) CancelUserConsent ¶
func (*UseCase) CreateAlarmOccurrences ¶
func (uc *UseCase) CreateAlarmOccurrences(c context.Context, guid string, alarm dto.AlarmClockOccurrenceInput) (dto.AddAlarmOutput, error)
func (*UseCase) DeleteAlarmOccurrences ¶
func (*UseCase) GetAlarmOccurrences ¶
func (*UseCase) GetAuditLog ¶
func (*UseCase) GetBootSourceSetting ¶ added in v1.9.0
func (*UseCase) GetByColumn ¶
func (*UseCase) GetCertificates ¶
func (*UseCase) GetDeviceCertificate ¶
func (*UseCase) GetDiskInfo ¶
func (*UseCase) GetDistinctTags ¶
func (*UseCase) GetEventLog ¶
func (*UseCase) GetFeatures ¶
func (*UseCase) GetGeneralSettings ¶
func (*UseCase) GetHardwareInfo ¶
func (*UseCase) GetKVMScreenSettings ¶ added in v1.10.0
func (uc *UseCase) GetKVMScreenSettings(c context.Context, guid string) (dto.KVMScreenSettings, error)
GetKVMScreenSettings returns IPS_ScreenSettingData for the device.
func (*UseCase) GetNetworkSettings ¶
func (*UseCase) GetPowerCapabilities ¶
func (*UseCase) GetPowerState ¶
func (*UseCase) GetTLSSettingData ¶
func (*UseCase) GetUserConsentCode ¶
func (*UseCase) GetVersion ¶
func (*UseCase) ListenToBrowser ¶
func (uc *UseCase) ListenToBrowser(deviceConnection *DeviceConnection)
func (*UseCase) ListenToDevice ¶
func (uc *UseCase) ListenToDevice(deviceConnection *DeviceConnection)
func (*UseCase) MonitorConnectionHealth ¶ added in v1.8.5
func (uc *UseCase) MonitorConnectionHealth(deviceConnection *DeviceConnection, key string)
func (*UseCase) SendConsentCode ¶
func (uc *UseCase) SendConsentCode(c context.Context, userConsent dto.UserConsentCode, guid string) (dto.UserConsentMessage, error)
func (*UseCase) SendPowerAction ¶
func (*UseCase) SetBootOptions ¶
func (uc *UseCase) SetBootOptions(c context.Context, guid string, bootSetting dto.BootSetting) (power.PowerActionResponse, error)
func (*UseCase) SetFeatures ¶
func (*UseCase) SetKVMScreenSettings ¶ added in v1.10.0
func (uc *UseCase) SetKVMScreenSettings(c context.Context, guid string, reqData dto.KVMScreenSettingsRequest) (dto.KVMScreenSettings, error)
SetKVMScreenSettings updates IPS_ScreenSettingData; currently not supported via wsman lib We accept payload but return NotSupported to preserve API contract for future.
type ValidationError ¶
type ValidationError struct {
Console consoleerrors.InternalError
}
func (ValidationError) Error ¶
func (e ValidationError) Error() string
func (ValidationError) Wrap ¶
func (e ValidationError) Wrap(call, function, message string) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.