cloudplan

package
v1.6.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright (c) HashiCorp, Inc. SPDX-License-Identifier: MPL-2.0

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidHostname = errors.New("invalid hostname")
View Source
var ErrInvalidRemotePlanFormat = errors.New("invalid remote plan format, must be 1")
View Source
var ErrInvalidRunID = errors.New("invalid run ID")

Functions

This section is empty.

Types

type RemotePlanJSON

type RemotePlanJSON struct {
	// The raw bytes of json we got from the API.
	JSONBytes []byte
	// Indicates whether the json bytes are the "redacted json plan" format, or
	// the unredacted stable "external json plan" format. These formats are
	// actually very different under the hood; the redacted one can be decoded
	// directly into a jsonformat.Plan struct and is intended for formatting a
	// plan for human consumption, while the unredacted one matches what is
	// returned by the jsonplan.Marshal() function, cannot be directly decoded
	// into a public type (it's actually a jsonplan.plan struct), and will
	// generally be spat back out verbatim.
	Redacted bool
	// Normal/destroy/refresh. Required by (jsonformat.Renderer).RenderHumanPlan.
	Mode plans.Mode
	// Unchanged/errored. Required by (jsonformat.Renderer).RenderHumanPlan.
	Qualities []plans.Quality
	// A human-readable header with a link to view the associated run in the
	// Terraform Cloud UI.
	RunHeader string
	// A human-readable footer with information relevant to the likely next
	// actions for this plan.
	RunFooter string
}

RemotePlanJSON is a wrapper struct that associates a pre-baked JSON plan with several pieces of metadata that can't be derived directly from the JSON contents and must instead be discovered from a tfe.Run or tfe.Plan. The wrapper is useful for moving data between the Cloud backend (which is the only thing able to fetch the JSON and determine values for the metadata) and the command.ShowCommand and views.Show interface (which need to have all of this information together).

type SavedPlanBookmark

type SavedPlanBookmark struct {
	RemotePlanFormat int    `json:"remote_plan_format"`
	RunID            string `json:"run_id"`
	Hostname         string `json:"hostname"`
}

func LoadSavedPlanBookmark

func LoadSavedPlanBookmark(filepath string) (SavedPlanBookmark, error)

func NewSavedPlanBookmark

func NewSavedPlanBookmark(runID, hostname string) SavedPlanBookmark

func (*SavedPlanBookmark) Save

func (s *SavedPlanBookmark) Save(filepath string) error

Jump to

Keyboard shortcuts

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