types

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 6, 2024 License: Apache-2.0, EPL-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// StatusIdentifying denotes that action identification process has started.
	StatusIdentifying StatusType = "IDENTIFYING"
	// StatusIdentified denotes that required actions are identified.
	StatusIdentified StatusType = "IDENTIFIED"
	// StatusIdentificationFailed denotes some or all of the required actions failed to be identified.
	StatusIdentificationFailed StatusType = "IDENTIFICATION_FAILED"
	// StatusRunning denotes that identified actions are currently executing.
	StatusRunning StatusType = "RUNNING"
	// StatusCompleted denotes that identified actions completed successfully.
	StatusCompleted StatusType = "COMPLETED"
	// StatusIncomplete denotes that not all of the identified actions completed successfully.
	StatusIncomplete StatusType = "INCOMPLETE"
	// StatusIncompleteInconsistent denotes that not all of the identified actions completed successfully, leaving the state inconsistent.
	StatusIncompleteInconsistent StatusType = "INCOMPLETE_INCONSISTENT"
	// StatusSuperseded denotes that the identified actions are no longer valid because new desired state was requested.
	StatusSuperseded StatusType = "SUPERSEDED"

	// BaselineStatusDownloading denotes a baseline is currently being downloaded.
	BaselineStatusDownloading StatusType = "DOWNLOADING"
	// BaselineStatusDownloadSuccess denotes a baseline was downloaded successfully.
	BaselineStatusDownloadSuccess StatusType = "DOWNLOAD_SUCCESS"
	// BaselineStatusDownloadFailure denotes a baseline download has failed.
	BaselineStatusDownloadFailure StatusType = "DOWNLOAD_FAILURE"
	// BaselineStatusRollback denotes that a baseline is currently in a rollback process.
	BaselineStatusRollback StatusType = "ROLLBACK"
	// BaselineStatusRollbackSuccess denotes that the rollback process for a baseline was successful.
	BaselineStatusRollbackSuccess StatusType = "ROLLBACK_SUCCESS"
	// BaselineStatusRollbackFailure denotes that the rollback process for a baseline was not successful.
	BaselineStatusRollbackFailure StatusType = "ROLLBACK_FAILURE"
	// BaselineStatusUpdating denotes a baseline is currently being updated.
	BaselineStatusUpdating StatusType = "UPDATING"
	// BaselineStatusUpdateSuccess denotes a baseline has been updated successfully.
	BaselineStatusUpdateSuccess StatusType = "UPDATE_SUCCESS"
	// BaselineStatusUpdateFailure denotes a baseline could not be updated.
	BaselineStatusUpdateFailure StatusType = "UPDATE_FAILURE"
	// BaselineStatusActivating denotes a baseline is currently being activated.
	BaselineStatusActivating StatusType = "ACTIVATING"
	// BaselineStatusActivationSuccess denotes a baseline has been activated successfully.
	BaselineStatusActivationSuccess StatusType = "ACTIVATION_SUCCESS"
	// BaselineStatusActivationFailure denotes a baseline could not be activated.
	BaselineStatusActivationFailure StatusType = "ACTIVATION_FAILURE"
	// BaselineStatusCleanup denotes that the cleanup process for a baseline after activation is currently running.
	BaselineStatusCleanup StatusType = "CLEANUP"
	// BaselineStatusCleanupSuccess denotes that the cleanup process for a baseline after activation was successful.
	BaselineStatusCleanupSuccess StatusType = "CLEANUP_SUCCESS"
	// BaselineStatusCleanupFailure denotes that the cleanup process for a baseline after activation was not successful.
	BaselineStatusCleanupFailure StatusType = "CLEANUP_FAILURE"

	// ActionStatusIdentified denotes action is identified, initial status for each action.
	ActionStatusIdentified ActionStatusType = "IDENTIFIED"
	// ActionStatusDownloading denotes an artifact is currently being downloaded.
	ActionStatusDownloading ActionStatusType = "DOWNLOADING"
	// ActionStatusDownloadFailure denotes an artifact download has failed.
	ActionStatusDownloadFailure ActionStatusType = "DOWNLOAD_FAILURE"
	// ActionStatusDownloadSuccess denotes an artifact has been downloaded successfully.
	ActionStatusDownloadSuccess ActionStatusType = "DOWNLOAD_SUCCESS"
	// ActionStatusUpdating denotes a component is currently being installed or modified.
	ActionStatusUpdating ActionStatusType = "UPDATING"
	// ActionStatusUpdateFailure denotes a component could not be installed or modified.
	ActionStatusUpdateFailure ActionStatusType = "UPDATE_FAILURE"
	// ActionStatusUpdateSuccess denotes a component has been installed or modified successfully.
	ActionStatusUpdateSuccess ActionStatusType = "UPDATE_SUCCESS"
	// ActionStatusRemoving denotes a component is currently being removed.
	ActionStatusRemoving ActionStatusType = "REMOVING"
	// ActionStatusRemovalFailure denotes a component could not be removed.
	ActionStatusRemovalFailure ActionStatusType = "REMOVAL_FAILURE"
	// ActionStatusRemovalSuccess denotes a component has been removed successfully.
	ActionStatusRemovalSuccess ActionStatusType = "REMOVAL_SUCCESS"
	// ActionStatusActivating denotes a component is currently being activated.
	ActionStatusActivating ActionStatusType = "ACTIVATING"
	// ActionStatusActivationFailure denotes a component could not be activated.
	ActionStatusActivationFailure ActionStatusType = "ACTIVATION_FAILURE"
	// ActionStatusActivationSuccess denotes a component has been activated successfully.
	ActionStatusActivationSuccess ActionStatusType = "ACTIVATION_SUCCESS"
)

Variables

This section is empty.

Functions

func ToEnvelope

func ToEnvelope(activityID string, payload interface{}) ([]byte, error)

ToEnvelope returns the Envelope as raw bytes, setting activity ID and payload to the given parameters.

Types

type Action

type Action struct {
	Component *Component       `json:"component,omitempty"`
	Status    ActionStatusType `json:"status,omitempty"`
	Progress  uint8            `json:"progress,omitempty"`
	Message   string           `json:"message,omitempty"`
}

Action defines the payload holding Desired State Feedback responses.

type ActionStatusType

type ActionStatusType string

ActionStatusType defines values for status of an action within the desired state feedback

type Association

type Association struct {
	SourceID string `json:"sourceId,omitempty"`
	TargetID string `json:"targetId,omitempty"`
}

Association links software and/or hardware nodes.

type Baseline

type Baseline struct {
	Title         string   `json:"title,omitempty"`
	Description   string   `json:"description,omitempty"`
	Preconditions string   `json:"preconditions,omitempty"`
	Components    []string `json:"components,omitempty"`
}

Baseline defines the baseline structure within the Desired State specification.

type CommandType

type CommandType string

CommandType defines command names for desired state command requests

const (
	// CommandDownload denotes a download baseline command
	CommandDownload CommandType = "DOWNLOAD"
	// CommandUpdate denotes an update baseline command
	CommandUpdate CommandType = "UPDATE"
	// CommandActivate denotes an activate baseline command
	CommandActivate CommandType = "ACTIVATE"
	// CommandRollback denotes a rollback baseline command
	CommandRollback CommandType = "ROLLBACK"
	// CommandCleanup denotes a cleanup baseline command
	CommandCleanup CommandType = "CLEANUP"
)

type Component

type Component struct {
	ID      string `json:"id,omitempty"`
	Version string `json:"version,omitempty"`
}

Component defines the component structure within the Desired State specification.

type ComponentWithConfig

type ComponentWithConfig struct {
	Component
	Config []*KeyValuePair `json:"config,omitempty"`
}

ComponentWithConfig defines the component structure within the Desired State specification, it includes key-value configuration pairs.

type ConsentStatusType

type ConsentStatusType string

ConsentStatusType defines values for status within the owner consent

const (
	// StatusApproved denotes that the owner approved the update operation.
	StatusApproved ConsentStatusType = "APPROVED"
	// StatusDenied denotes that the owner denied the update operation.
	StatusDenied ConsentStatusType = "DENIED"
)

type DesiredState

type DesiredState struct {
	Baselines []*Baseline `json:"baselines,omitempty"`
	Domains   []*Domain   `json:"domains,omitempty"`
}

DesiredState defines the payload holding the Desired State specification.

func (*DesiredState) GetBaselinesForDomain

func (desiredState *DesiredState) GetBaselinesForDomain(domain string) []*Baseline

GetBaselinesForDomain returns a list of baselines for the requested domain

func (*DesiredState) SplitPerDomains

func (desiredState *DesiredState) SplitPerDomains() map[string]*DesiredState

SplitPerDomains splits the full desired state into several desired states for each domain

type DesiredStateCommand

type DesiredStateCommand struct {
	Command  CommandType `json:"command,omitempty"`
	Baseline string      `json:"baseline,omitempty"`
}

DesiredStateCommand defines the payload holding the Desired State Command specification.

type DesiredStateFeedback

type DesiredStateFeedback struct {
	Baseline string     `json:"baseline,omitempty"`
	Status   StatusType `json:"status,omitempty"`
	Message  string     `json:"message,omitempty"`
	Actions  []*Action  `json:"actions,omitempty"`
}

DesiredStateFeedback defines the payload holding Desired State Feedback responses.

type Domain

type Domain struct {
	ID         string                 `json:"id,omitempty"`
	Config     []*KeyValuePair        `json:"config,omitempty"`
	Components []*ComponentWithConfig `json:"components,omitempty"`
}

Domain defines the domain structure within the Desired State specification.

type Envelope

type Envelope struct {
	ActivityID string      `json:"activityId"`
	Timestamp  int64       `json:"timestamp"`
	Payload    interface{} `json:"payload"`
}

Envelope defines the structure of messages for interacting with the UpdateAgent API.

func FromEnvelope

func FromEnvelope(bytes []byte, payload interface{}) (*Envelope, error)

FromEnvelope expects to receive raw bytes and convert them as Envelope, payload being unmarshalled into the given parameter.

type HardwareNode

type HardwareNode struct {
	InventoryNode
	Addressable bool `json:"addressable,omitempty"`
}

HardwareNode defines the representation for a hardware node.

type Inventory

type Inventory struct {
	HardwareNodes []*HardwareNode `json:"hardwareNodes,omitempty"`
	SoftwareNodes []*SoftwareNode `json:"softwareNodes,omitempty"`
	Associations  []*Association  `json:"associations,omitempty"`
}

Inventory defines the payload holding an inventory graph.

type InventoryNode

type InventoryNode struct {
	ID         string          `json:"id,omitempty"`
	Version    string          `json:"version,omitempty"`
	Name       string          `json:"name,omitempty"`
	Parameters []*KeyValuePair `json:"parameters,omitempty"`
}

InventoryNode defines common struct for both SoftwareNode and HardwareNode.

type KeyValuePair

type KeyValuePair struct {
	Key   string `json:"key,omitempty"`
	Value string `json:"value,omitempty"`
}

KeyValuePair represents key/value string pair.

type OwnerConsent

type OwnerConsent struct {
	Command CommandType `json:"command,omitempty"`
}

OwnerConsent defines the payload for Owner Consent.

type OwnerConsentFeedback

type OwnerConsentFeedback struct {
	Status ConsentStatusType `json:"status,omitempty"`
}

OwnerConsentFeedback defines the payload for Owner Consent Feedback.

type SoftwareNode

type SoftwareNode struct {
	InventoryNode
	Type SoftwareType `json:"type,omitempty"`
}

SoftwareNode defines the representation for a software node.

type SoftwareType

type SoftwareType string

SoftwareType represents the type of a software node.

const (
	// SoftwareTypeImage represents an image software type
	SoftwareTypeImage SoftwareType = "IMAGE"
	// SoftwareTypeRaw represents a raw bytes software type
	SoftwareTypeRaw SoftwareType = "RAW"
	// SoftwareTypeData represents a data software type
	SoftwareTypeData SoftwareType = "DATA"
	// SoftwareTypeApplication represents an application software type
	SoftwareTypeApplication SoftwareType = "APPLICATION"
	// SoftwareTypeContainer represents a container software type
	SoftwareTypeContainer SoftwareType = "CONTAINER"
)

type StatusType

type StatusType string

StatusType defines values for status within the desired state feedback

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL