json

package
v1.12.3 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OutputsFromChanges

func OutputsFromChanges(changes []*plans.OutputChangeSrc) jsonentities.Outputs

func OutputsFromMap

func OutputsFromMap(outputValues map[string]*states.OutputValue) (jsonentities.Outputs, tfdiags.Diagnostics)

Types

type ChangeSummary

type ChangeSummary struct {
	Add       int       `json:"add"`
	Change    int       `json:"change"`
	Import    int       `json:"import"`
	Remove    int       `json:"remove"`
	Forget    int       `json:"forget"`
	Operation Operation `json:"operation"`
}

func (*ChangeSummary) String

func (cs *ChangeSummary) String() string

The summary strings for apply and plan are accidentally a public interface used by Terraform Cloud and Terraform Enterprise, so the exact formats of these strings are important.

type Hook

type Hook interface {
	HookType() MessageType
	String() string
}

func NewApplyComplete

func NewApplyComplete(addr addrs.AbsResourceInstance, action plans.Action, idKey, idValue string, elapsed time.Duration) Hook

func NewApplyErrored

func NewApplyErrored(addr addrs.AbsResourceInstance, action plans.Action, elapsed time.Duration) Hook

func NewApplyProgress

func NewApplyProgress(addr addrs.AbsResourceInstance, action plans.Action, elapsed time.Duration) Hook

func NewApplyStart

func NewApplyStart(addr addrs.AbsResourceInstance, action plans.Action, idKey string, idValue string) Hook

func NewEphemeralStart

func NewEphemeralStart(addr addrs.AbsResourceInstance, startMsg string) Hook

func NewEphemeralStop

func NewEphemeralStop(addr addrs.AbsResourceInstance, startMsg string) Hook

func NewProvisionComplete

func NewProvisionComplete(addr addrs.AbsResourceInstance, provisioner string) Hook

func NewProvisionErrored

func NewProvisionErrored(addr addrs.AbsResourceInstance, provisioner string) Hook

func NewProvisionProgress

func NewProvisionProgress(addr addrs.AbsResourceInstance, provisioner string, output string) Hook

func NewProvisionStart

func NewProvisionStart(addr addrs.AbsResourceInstance, provisioner string) Hook

func NewRefreshComplete

func NewRefreshComplete(addr addrs.AbsResourceInstance, idKey, idValue string) Hook

func NewRefreshStart

func NewRefreshStart(addr addrs.AbsResourceInstance, idKey, idValue string) Hook

type MessageType

type MessageType string
const (
	// Generic messages
	MessageVersion    MessageType = "version"
	MessageLog        MessageType = "log"
	MessageDiagnostic MessageType = "diagnostic"

	// Operation results
	MessageResourceDrift MessageType = "resource_drift"
	MessagePlannedChange MessageType = "planned_change"
	MessageChangeSummary MessageType = "change_summary"
	MessageOutputs       MessageType = "outputs"

	// Hook-driven messages
	MessageApplyStart              MessageType = "apply_start"
	MessageApplyProgress           MessageType = "apply_progress"
	MessageApplyComplete           MessageType = "apply_complete"
	MessageApplyErrored            MessageType = "apply_errored"
	MessageProvisionStart          MessageType = "provision_start"
	MessageProvisionProgress       MessageType = "provision_progress"
	MessageProvisionComplete       MessageType = "provision_complete"
	MessageProvisionErrored        MessageType = "provision_errored"
	MessageRefreshStart            MessageType = "refresh_start"
	MessageRefreshComplete         MessageType = "refresh_complete"
	MessageEphemeralActionStart    MessageType = "ephemeral_action_started"
	MessageEphemeralActionComplete MessageType = "ephemeral_action_complete"

	// Test messages
	MessageTestAbstract  MessageType = "test_abstract"
	MessageTestFile      MessageType = "test_file"
	MessageTestRun       MessageType = "test_run"
	MessageTestPlan      MessageType = "test_plan"
	MessageTestState     MessageType = "test_state"
	MessageTestSummary   MessageType = "test_summary"
	MessageTestCleanup   MessageType = "test_cleanup"
	MessageTestInterrupt MessageType = "test_interrupt"
)

type Operation

type Operation string
const (
	OperationApplied   Operation = "apply"
	OperationDestroyed Operation = "destroy"
	OperationPlanned   Operation = "plan"
)

type TestFailedResource

type TestFailedResource struct {
	Instance   string `json:"instance"`
	DeposedKey string `json:"deposed_key,omitempty"`
}

type TestFatalInterrupt

type TestFatalInterrupt struct {
	State   []TestFailedResource            `json:"state,omitempty"`
	States  map[string][]TestFailedResource `json:"states,omitempty"`
	Planned []string                        `json:"planned,omitempty"`
}

type TestFileCleanup

type TestFileCleanup struct {
	FailedResources []TestFailedResource `json:"failed_resources"`
}

type TestFileStatus

type TestFileStatus struct {
	Path   string     `json:"path"`
	Status TestStatus `json:"status"`
}

type TestRunStatus

type TestRunStatus struct {
	Path   string     `json:"path"`
	Run    string     `json:"run"`
	Status TestStatus `json:"status"`
}

type TestStatus

type TestStatus string

func ToTestStatus

func ToTestStatus(status moduletest.Status) TestStatus

type TestSuiteAbstract

type TestSuiteAbstract map[string][]string

type TestSuiteSummary

type TestSuiteSummary struct {
	Status  TestStatus `json:"status"`
	Passed  int        `json:"passed"`
	Failed  int        `json:"failed"`
	Errored int        `json:"errored"`
	Skipped int        `json:"skipped"`
}

Jump to

Keyboard shortcuts

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