Documentation ¶
Index ¶
- func ApplyTaskDescription(destroy bool) string
- func ByStatus(i, j *Run) int
- func ByUpdatedDesc(i, j *Run) int
- func PlanTaskDescription(destroy bool) string
- type Change
- type ChangeAction
- type CreateOptions
- type ListOptions
- type Report
- type ResourceChange
- type Run
- type Service
- func (s *Service) Apply(id resource.ID, opts *CreateOptions) (*task.Task, error)
- func (s *Service) Delete(id resource.ID) error
- func (s *Service) Get(runID resource.ID) (*Run, error)
- func (s *Service) List(opts ListOptions) []*Run
- func (s *Service) MultiApply(opts *CreateOptions, ids ...resource.ID) (*task.Group, error)
- func (s *Service) Plan(workspaceID resource.ID, opts CreateOptions) (*task.Task, error)
- type ServiceOptions
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyTaskDescription ¶ added in v0.4.0
func ByStatus ¶
ByStatus sorts runs according to the following order:
* Planning, Applying (most recent first) * Planned (most recent first) * PlanQueued,ApplyQueued (oldest first) * Scheduled (oldest first) * Pending (oldest first) * Applied,Errored,Canceled,Finished,NoChanges,Discarded (most recent first)
func ByUpdatedDesc ¶
func PlanTaskDescription ¶ added in v0.4.0
Types ¶
type Change ¶
type Change struct {
Actions []ChangeAction
}
Change represents the type of change being made
type ChangeAction ¶
type ChangeAction string
const ( CreateAction ChangeAction = "create" UpdateAction ChangeAction = "update" DeleteAction ChangeAction = "delete" )
type CreateOptions ¶
type CreateOptions struct { // TargetAddrs creates a plan targeting specific resources. TargetAddrs []state.ResourceAddress // Destroy creates a plan to destroy all resources. Destroy bool // contains filtered or unexported fields }
type ListOptions ¶
type Report ¶
type Report struct { Additions int `json:"additions"` Changes int `json:"changes"` Destructions int `json:"destructions"` }
Report reports a summary of additions, changes, and deletions of resources in a plan or an apply.
func (Report) HasChanges ¶
type ResourceChange ¶
type ResourceChange struct {
Change Change
}
ResourceChange represents a proposed change to a resource in a plan file
type Run ¶
type Run struct { resource.Common Created time.Time Updated time.Time Status Status PlanReport *Report ApplyReport *Report Changes bool ArtefactsPath string Destroy bool // contains filtered or unexported fields }
func (*Run) IsFinished ¶
func (*Run) ModulePath ¶ added in v0.2.0
func (*Run) WorkspaceID ¶
func (*Run) WorkspaceName ¶ added in v0.2.0
type Service ¶
func NewService ¶
func NewService(opts ServiceOptions) *Service
func (*Service) Apply ¶
Apply creates a task for a terraform apply.
If opts is non-nil, then a new run is created and auto-applied without creating a plan file. The ID must be the workspace ID on which to create the run.
If opts is nil, then it will apply an existing plan. The ID must specify an existing run that has successfully created a plan.
func (*Service) List ¶
func (s *Service) List(opts ListOptions) []*Run
func (*Service) MultiApply ¶ added in v0.3.4
MultiApply creates a task group of one or more apply tasks. See Apply() for info on parameters.
You cannot apply a combination of destory and non-destroy plans, because that is incompatible with the dependency graph that is created to order the tasks.
type ServiceOptions ¶
type Status ¶
type Status string
const ( Pending Status = "pending" PlanQueued Status = "plan queued" Planning Status = "planning" Planned Status = "planned" NoChanges Status = "no changes" ApplyQueued Status = "apply queued" Applying Status = "applying" Applied Status = "applied" Errored Status = "errored" Canceled Status = "canceled" Discarded Status = "discarded" MaxStatusLen = len(ApplyQueued) )