edit

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package edit contains functions suitable for editing a snapshot in-place. It is designed to be used by higher-level tools that present a means for users to surgically edit their state.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteResource

func DeleteResource(snapshot *deploy.Snapshot, condemnedRes *resource.State) error

DeleteResource deletes a given resource from the snapshot, if it is possible to do so. A resource can only be deleted from a stack if there do not exist any resources that depend on it or descend from it. If such a resource does exist, DeleteResource will return an error instance of `ResourceHasDependenciesError`.

func LocateResource

func LocateResource(snap *deploy.Snapshot, urn resource.URN) []*resource.State

LocateResource returns all resources in the given shapshot that have the given URN.

func RenameStack added in v0.17.2

func RenameStack(snap *deploy.Snapshot, newName tokens.QName) error

RenameStack changes the `stackName` component of every URN in a snapshot. In addition, it rewrites the name of the root Stack resource itself.

func UnprotectResource

func UnprotectResource(_ *deploy.Snapshot, res *resource.State) error

UnprotectResource unprotects a resource.

Types

type OperationFunc

type OperationFunc func(*deploy.Snapshot, *resource.State) error

OperationFunc is the type of functions that edit resources within a snapshot. The edits are made in-place to the given snapshot and pertain to the specific passed-in resource.

type ResourceHasDependenciesError

type ResourceHasDependenciesError struct {
	Condemned    *resource.State
	Dependencies []*resource.State
}

ResourceHasDependenciesError is returned by DeleteResource if a resource can't be deleted due to the presence of resources that depend directly or indirectly upon it.

func (ResourceHasDependenciesError) Error

type ResourceProtectedError

type ResourceProtectedError struct {
	Condemned *resource.State
}

ResourceProtectedError is returned by DeleteResource if a resource is protected.

func (ResourceProtectedError) Error

Jump to

Keyboard shortcuts

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