Documentation ¶
Overview ¶
********************************************************************
- Copyright (c) Intel Corporation 2022
- SPDX-License-Identifier: Apache-2.0 *********************************************************************
********************************************************************
- Copyright (c) Intel Corporation 2021
- SPDX-License-Identifier: Apache-2.0 *********************************************************************
********************************************************************
- Copyright (c) Intel Corporation 2021
- SPDX-License-Identifier: Apache-2.0 *********************************************************************
Index ¶
- func ExecuteCommand(flags *flags.Flags) utils.ReturnCode
- type AMTActivationServer
- func (amt *AMTActivationServer) Close() error
- func (amt *AMTActivationServer) Connect(skipCertCheck bool) error
- func (amt *AMTActivationServer) GenerateHeartbeatResponse(activation Message) ([]byte, error)
- func (amt *AMTActivationServer) Listen() chan []byte
- func (amt *AMTActivationServer) ProcessMessage(message []byte) []byte
- func (amt *AMTActivationServer) Send(data Message) error
- type Executor
- type Message
- type MessagePayload
- type Payload
- type StatusMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecuteCommand ¶
func ExecuteCommand(flags *flags.Flags) utils.ReturnCode
Types ¶
type AMTActivationServer ¶
type AMTActivationServer struct { URL string Conn *websocket.Conn // contains filtered or unexported fields }
AMTActivationServer struct represents the connection to RPS
func NewAMTActivationServer ¶
func NewAMTActivationServer(flags *flags.Flags) AMTActivationServer
TODO: suggest this be renamed to RemoteProvisioningService
func (*AMTActivationServer) Close ¶
func (amt *AMTActivationServer) Close() error
Close closes the connection to rps
func (*AMTActivationServer) Connect ¶
func (amt *AMTActivationServer) Connect(skipCertCheck bool) error
Connect is used to connect to the RPS Server
func (*AMTActivationServer) GenerateHeartbeatResponse ¶
func (amt *AMTActivationServer) GenerateHeartbeatResponse(activation Message) ([]byte, error)
func (*AMTActivationServer) Listen ¶
func (amt *AMTActivationServer) Listen() chan []byte
Listen is used for listening to responses from RPS
func (*AMTActivationServer) ProcessMessage ¶
func (amt *AMTActivationServer) ProcessMessage(message []byte) []byte
ProcessMessage inspects RPS messages, decodes the base64 payload from the server and relays it to LMS
func (*AMTActivationServer) Send ¶
func (amt *AMTActivationServer) Send(data Message) error
Send is used for sending data to the RPS Server
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func (Executor) HandleDataFromLM ¶
func (Executor) HandleDataFromRPS ¶
func (Executor) HandleInterrupt ¶
func (e Executor) HandleInterrupt()
type Message ¶
type Message struct { Method string `json:"method"` APIKey string `json:"apiKey"` AppVersion string `json:"appVersion"` ProtocolVersion string `json:"protocolVersion"` Status string `json:"status"` Message string `json:"message"` Fqdn string `json:"fqdn"` Payload string `json:"payload"` TenantID string `json:"tenantId"` }
Message is used for tranferring messages between RPS and RPC
type MessagePayload ¶
type MessagePayload struct { Version string `json:"ver"` Build string `json:"build"` SKU string `json:"sku"` Features string `json:"features"` UUID string `json:"uuid"` Username string `json:"username"` Password string `json:"password"` CurrentMode int `json:"currentMode"` Hostname string `json:"hostname"` FQDN string `json:"fqdn"` Client string `json:"client"` CertificateHashes []string `json:"certHashes"` IPConfiguration flags.IPConfiguration `json:"ipConfiguration"` HostnameInfo flags.HostnameInfo `json:"hostnameInfo"` FriendlyName string `json:"friendlyName,omitempty"` }
MessagePayload struct is used for the initial request to RPS to activate or manage a device
type Payload ¶
func NewPayload ¶
func NewPayload() Payload
func (Payload) CreateMessageRequest ¶
CreateMessageRequest is used for assembling the message to request activation of a device
func (Payload) CreateMessageResponse ¶
CreateMessageResponse is used for creating a response to the server
type StatusMessage ¶
type StatusMessage struct { Status string `json:"Status,omitempty"` Network string `json:"Network,omitempty"` CIRAConnection string `json:"CIRAConnection,omitempty"` TLSConfiguration string `json:"TLSConfiguration,omitempty"` }
Status Message is used for displaying and parsing status messages from RPS