rundocument

package
v0.0.0-...-176c957 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Overview

Package rundocument implements the aws:runDocument plugin

Package rundocument implements the aws:runDocument plugin

Index

Constants

View Source
const (
	SSMDocumentType = "SSMDocument"
	LocalPathType   = "LocalPath"

	FailExitCode = 1
	PassExitCode = 0
)

Variables

This section is empty.

Functions

func Name

func Name() string

Name returns the plugin name

Types

type ExecDocument

type ExecDocument interface {
	ParseDocument(context context.T, documentRaw []byte, orchestrationDir string,
		s3Bucket string, s3KeyPrefix string, messageID string, documentID string, defaultWorkingDirectory string,
		params map[string]interface{}) (pluginsInfo []contracts.PluginState, err error)
	ExecuteDocument(config contracts.Configuration, context context.T, pluginInput []contracts.PluginState, documentID string,
		documentCreatedDate string) (chan contracts.DocumentResult, error)
}

type ExecDocumentImpl

type ExecDocumentImpl struct {
	DocExecutor executer.Executer
}

func (ExecDocumentImpl) ExecuteDocument

func (exec ExecDocumentImpl) ExecuteDocument(config contracts.Configuration, context context.T, pluginInput []contracts.PluginState, documentID string,
	documentCreatedDate string) (resultChannels chan contracts.DocumentResult, err error)

ExecuteDocument is responsible to execute the sub-documents that are created or downloaded by the executeCommand plugin

func (ExecDocumentImpl) ParseDocument

func (exec ExecDocumentImpl) ParseDocument(context context.T, documentRaw []byte, orchestrationDir string,
	s3Bucket string, s3KeyPrefix string, messageID string, documentID string, defaultWorkingDirectory string,
	params map[string]interface{}) (pluginsInfo []contracts.PluginState, err error)

ParseDocument parses the remote document obtained to a format that the executor can use. This function is also responsible for all the validation of document and replacement of parameters

type ExecutePluginDepth

type ExecutePluginDepth struct {
	// contains filtered or unexported fields
}

ExecutePluginDepth is the struct that is sent through to the sub-documents to maintain the depth of execution

type NoOpDocumentMgr

type NoOpDocumentMgr struct {
	// contains filtered or unexported fields
}

Workaround to keep this plugin from overwriting the DocumentState of the top-level document.

Up until version 3.0.732.0, this plugin always failed to write the DocumentState to file due to a path calculation bug. In 3.0.732.0, the path calculation bug was fixed, and the plugin started overwriting the top-level document's DocumentState, which sometimes interfered with plugins in the top-level document that executed after this one. NoOpDocumentMgr is meant to keep this plugin from overwriting the state of the top-level document. However, it does not persist the DocumentState over a reboot, and it does not track the status (e.g. "pending", "current", "corrupt") of the document. Longer-term, we may want to implement proper DocumentState bookkeeping for the documents executed by this plugin.

func NewNoOpDocumentMgr

func NewNoOpDocumentMgr(ctx context.T) *NoOpDocumentMgr

func (*NoOpDocumentMgr) GetDocumentState

func (m *NoOpDocumentMgr) GetDocumentState(fileName, locationFolder string) contracts.DocumentState

func (*NoOpDocumentMgr) MoveDocumentState

func (m *NoOpDocumentMgr) MoveDocumentState(fileName, srcLocationFolder, dstLocationFolder string)

func (*NoOpDocumentMgr) PersistDocumentState

func (m *NoOpDocumentMgr) PersistDocumentState(fileName, locationFolder string, state contracts.DocumentState)

func (*NoOpDocumentMgr) RemoveDocumentState

func (m *NoOpDocumentMgr) RemoveDocumentState(fileName, locationFolder string)

type Plugin

type Plugin struct {
	// contains filtered or unexported fields
}

Plugin is the type for the aws:copyContent plugin.

func NewPlugin

func NewPlugin(context context.T) (*Plugin, error)

NewPlugin returns a new instance of the plugin.

func (*Plugin) Execute

func (p *Plugin) Execute(config contracts.Configuration, cancelFlag task.CancelFlag, output iohandler.IOHandler)

Execute runs multiple sets of commands and returns their outputs. res.Output will contain a slice of RunCommandPluginOutput.

type RunDocumentPluginInput

type RunDocumentPluginInput struct {
	contracts.PluginInput
	DocumentType       string      `json:"documentType"`
	DocumentPath       string      `json:"documentPath"`
	DocumentParameters interface{} `json:"documentParameters"`
}

RunDocumentPluginInput is a struct that holds the parameters sent through send command

Directories

Path Synopsis
mocks
rundocument
Package rundocument implements the aws:runDocument plugin
Package rundocument implements the aws:runDocument plugin

Jump to

Keyboard shortcuts

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