model

package
v0.0.0-...-7638cb1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package model provides model definitions for document state

Package model provides model definitions for document state

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsManagedInstanceIncompatibleAWSSSMDocument

func IsManagedInstanceIncompatibleAWSSSMDocument(documentName string) bool

IsManagedInstanceIncompatibleAWSSSMDocument checks if doc could contain incompatible code for managed instance

func RemoveDependencyOnInstanceMetadata

func RemoveDependencyOnInstanceMetadata(context context.T, docState *DocumentState) error

RemoveDependencyOnInstanceMetadata looks for array of commands which will be executed as a part of this document and replace the incompatible code.

Types

type CancelCommandInfo

type CancelCommandInfo struct {
	CancelMessageID string
	CancelCommandID string
	Payload         string
	DebugInfo       string
}

CancelCommandInfo represents information relevant to a cancel-command that agent receives TODO This might be revisited when Agent-cli is written to list previously executed commands

type DocumentInfo

type DocumentInfo struct {
	// DocumentID is a unique name for file system
	// For Association, DocumentID = AssociationID.RunID
	// For RunCommand, DocumentID = CommandID
	DocumentID          string
	AdditionalInfo      contracts.AdditionalInfo
	CommandID           string
	AssociationID       string
	InstanceID          string
	MessageID           string
	RunID               string
	CreatedDate         string
	DocumentName        string
	IsCommand           bool
	DocumentStatus      contracts.ResultStatus
	DocumentTraceOutput string
	RuntimeStatus       map[string]*contracts.PluginRuntimeStatus
	RunCount            int
}

DocumentInfo represents information stored as interim state for a document

type DocumentState

type DocumentState struct {
	DocumentInformation        DocumentInfo
	DocumentType               DocumentType
	SchemaVersion              string
	InstancePluginsInformation []PluginState
	CancelInformation          CancelCommandInfo
}

DocumentState represents information relevant to a command that gets executed by agent

func (*DocumentState) IsAssociation

func (c *DocumentState) IsAssociation() bool

IsAssociation returns if documentType is association

func (*DocumentState) IsRebootRequired

func (c *DocumentState) IsRebootRequired() bool

IsRebootRequired returns if reboot is needed

type DocumentType

type DocumentType string

DocumentType defines the type of document persists locally.

const (
	// SendCommand represents document type for send command
	SendCommand DocumentType = "SendCommand"
	// CancelCommand represents document type for cancel command
	CancelCommand DocumentType = "CancelComamnd"
	// Association represents document type for association
	Association DocumentType = "Association"
	// SendCommandOffline represents document type for send command received from offline service
	SendCommandOffline DocumentType = "SendCommandOffline"
	// CancelCommandOffline represents document type for cancel command received from offline service
	CancelCommandOffline DocumentType = "CancelCommandOffline"
)

type PluginState

type PluginState struct {
	Configuration contracts.Configuration
	Name          string
	Result        contracts.PluginResult
	HasExecuted   bool
	Id            string
}

PluginState represents information stored as interim state for any plugin This has both the configuration with which a plugin gets executed and a corresponding plugin result.

Jump to

Keyboard shortcuts

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