pulumi/cmd/backend.go
Matt Ellis f5dc3a2b53 Add a very barebones pulumi logs command
This is the smallest possible thing that could work for both the local
development case and the case where we are targeting the Pulumi
Service.

Pulling down the pulumiframework and component packages here is a bit
of a feel bad, but we plan to rework the model soon enough to a
provider model which will remove the need for us to hold on to this
code (and will bring back the factoring where the CLI does not have
baked in knowledge of the Pulumi Cloud Framework).

Fixes #527
2017-11-14 12:26:55 -08:00

35 lines
1 KiB
Go

// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
package cmd
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/pkg/component"
"github.com/pulumi/pulumi/pkg/engine"
"github.com/pulumi/pulumi/pkg/tokens"
)
type stackSummary struct {
Name tokens.QName
// May be "n/a" for an undeployed stack.
LastDeploy string
ResourceCount string
}
type StackCreationOptions struct {
Cloud string
}
var errHasResources = errors.New("stack has existing resources and force was false")
type pulumiBackend interface {
CreateStack(stackName tokens.QName, opts StackCreationOptions) error
GetStacks() ([]stackSummary, error)
RemoveStack(stackName tokens.QName, force bool) error
Preview(stackName tokens.QName, debug bool, opts engine.PreviewOptions) error
Update(stackName tokens.QName, debug bool, opts engine.DeployOptions) error
Destroy(stackName tokens.QName, debug bool, opts engine.DestroyOptions) error
GetLogs(stackName tokens.QName, query component.LogQuery) ([]component.LogEntry, error)
}