pulumi/pkg/resource/resource.go
joeduffy 35aa6b7559 Rename pulumi/lumi to pulumi/pulumi-fabric
We are renaming Lumi to Pulumi Fabric.  This change simply renames the
pulumi/lumi repo to pulumi/pulumi-fabric, without the CLI tools and other
changes that will follow soon afterwards.
2017-08-02 09:25:22 -07:00

28 lines
831 B
Go

// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
package resource
import (
"github.com/pulumi/pulumi-fabric/pkg/tokens"
)
// Resource is an instance of a resource with an ID, type, and bag of state.
type Resource interface {
URN() URN // the resource's object URN: a human-friendly, unique name for the resource.
Type() tokens.Type // the resource's type.
}
// Status is returned when an error has occurred during a resource provider operation. It indicates whether the
// operation could be rolled back cleanly (OK). If not, it means the resource was left in an indeterminate state.
type Status int
const (
StatusOK Status = iota
StatusUnknown
)
// HasURN returns true if the resource has been assigned a universal resource name (URN).
func HasURN(r Resource) bool {
return r.URN() != ""
}