apply

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package apply verifies approved plans and hands their actions to a trusted executor while recording redacted state and history.

The apply package is part of Ramen's supported v0.1 core API.

Index

Constants

View Source
const Version = "ramen.apply.v1"

Variables

This section is empty.

Functions

func BuildActionDocument

func BuildActionDocument(resource tfplan.ResourcePlan, sourcePaths map[string]string) (*uws1.Document, error)

func BuildActionDocumentWithBindings

func BuildActionDocumentWithBindings(resource tfplan.ResourcePlan, sourcePaths map[string]string, attrs, identity map[string]any) (*uws1.Document, error)

func ExecutorEventSink

func ExecutorEventSink(store *state.Store) executor.EventSink

Types

type APISourceInput

type APISourceInput = tfplan.APISourceInput

type ExecutedAction

type ExecutedAction struct {
	Address   string          `json:"address"`
	Action    string          `json:"action"`
	Operation string          `json:"operation,omitempty"`
	Document  string          `json:"document,omitempty"`
	Result    executor.Result `json:"result"`
}

type Options

type Options struct {
	ConfigDir   string
	ProjectPath string
	StatePath   string
	APISources  []APISourceInput
	VarFiles    []string
	Vars        []string
	Workspace   string
	PlanPath    string
	AutoApprove bool
	OutDir      string
	Executor    executor.Executor
}

type Result

type Result struct {
	Version            string                    `json:"version"`
	StatePath          string                    `json:"state_path"`
	RunID              int64                     `json:"run_id,omitempty"`
	Plan               tfplan.Document           `json:"plan"`
	Summary            Summary                   `json:"summary"`
	Executed           []ExecutedAction          `json:"executed,omitempty"`
	Feedback           []executor.FeedbackRecord `json:"feedback,omitempty"`
	GeneratedDocuments []string                  `json:"generated_documents,omitempty"`
	Errors             []string                  `json:"errors,omitempty"`
}

func Apply

func Apply(ctx context.Context, opts Options) (*Result, error)

type Summary

type Summary struct {
	Create  int `json:"create"`
	Update  int `json:"update"`
	Delete  int `json:"delete"`
	Post    int `json:"post,omitempty"`
	Put     int `json:"put,omitempty"`
	Patch   int `json:"patch,omitempty"`
	Read    int `json:"read"`
	NoOp    int `json:"no_op"`
	Skipped int `json:"skipped"`
	Failed  int `json:"failed"`
	Blocked int `json:"blocked"`
}

Jump to

Keyboard shortcuts

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