Add a manifest to checkpoint files (#630)

This change adds a new manifest section to the checkpoint files.
The existing time moves into it, and we add to it the version of
the Pulumi CLI that created it, along with the names, types, and
versions of all plugins used to generate the file.  There is a
magic cookie that we also use during verification.

This is to help keep us sane when debugging problems "in the wild,"
and I'm sure we will add more to it over time (checksum, etc).

For example, after an up, you can now see this in `pulumi stack`:

```
Current stack is demo:
    Last updated at 2017-12-01 13:48:49.815740523 -0800 PST
    Pulumi version v0.8.3-79-g1ab99ad
    Plugin pulumi-provider-aws [resource] version v0.8.3-22-g4363e77
    Plugin pulumi-langhost-nodejs [language] version v0.8.3-79-g77bb6b6
    Checkpoint file is /Users/joeduffy/dev/code/src/github.com/pulumi/pulumi-aws/.pulumi/stacks/webserver/demo.json
```

This addresses pulumi/pulumi#628.
This commit is contained in:
Joe Duffy 2017-12-01 13:50:32 -08:00 committed by GitHub
parent 64705b0a73
commit 16ade183d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 930 additions and 235 deletions

View file

@ -4,7 +4,7 @@ include build/common.mk
PROJECT := github.com/pulumi/pulumi
PROJECT_PKGS := $(shell go list ./cmd/... ./pkg/... | grep -v /vendor/)
VERSION := $(shell git describe --tags 2>/dev/null)
VERSION := $(shell git describe --tags --dirty 2>/dev/null)
GOMETALINTERBIN := gometalinter
GOMETALINTER := ${GOMETALINTERBIN} --config=Gometalinter.json
@ -12,11 +12,11 @@ GOMETALINTER := ${GOMETALINTERBIN} --config=Gometalinter.json
TESTPARALLELISM := 10
build::
go install -ldflags "-X main.version=${VERSION}" ${PROJECT}
go install -ldflags "-X main.version=${VERSION}" ${PROJECT}/cmd/lumidl
go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=${VERSION}" ${PROJECT}
go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=${VERSION}" ${PROJECT}/cmd/lumidl
install::
GOBIN=$(PULUMI_BIN) go install -ldflags "-X main.version=${VERSION}" ${PROJECT}
GOBIN=$(PULUMI_BIN) go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=${VERSION}" ${PROJECT}
LINT_SUPPRESS="or be unexported"
lint::
@ -46,4 +46,3 @@ travis_cron: all coverage
travis_push: all publish
travis_pull_request: all
travis_api: all

View file

@ -49,7 +49,7 @@ func (b *localPulumiBackend) GetStacks() ([]stackSummary, error) {
// Ignore errors, just leave display settings as "n/a".
_, _, snapshot, _, err := getStack(stack)
if err == nil && snapshot != nil {
summary.LastDeploy = snapshot.Time.String()
summary.LastDeploy = snapshot.Manifest.Time.String()
summary.ResourceCount = strconv.Itoa(len(snapshot.Resources))
}

View file

@ -65,9 +65,9 @@ func (p localStackProvider) BeginMutation(name tokens.QName) (engine.SnapshotMut
}
func (m localStackMutation) End(snapshot *deploy.Snapshot) error {
contract.Assert(m.name == snapshot.Namespace)
contract.Assert(m.name == snapshot.Stack)
name, config, _, _, err := getStack(snapshot.Namespace)
name, config, _, _, err := getStack(snapshot.Stack)
if err != nil && !os.IsNotExist(err) {
return err
}

View file

@ -30,7 +30,7 @@ func init() {
}
// NewPulumiCmd creates a new Pulumi Cmd instance.
func NewPulumiCmd(version string) *cobra.Command {
func NewPulumiCmd() *cobra.Command {
var logFlow bool
var logToStderr bool
var tracing string
@ -69,7 +69,7 @@ func NewPulumiCmd(version string) *cobra.Command {
cmd.AddCommand(newStackCmd())
cmd.AddCommand(newPreviewCmd())
cmd.AddCommand(newUpdateCmd())
cmd.AddCommand(newVersionCmd(version))
cmd.AddCommand(newVersionCmd())
cmd.AddCommand(newInitCmd())
cmd.AddCommand(newLogsCmd())

View file

@ -38,13 +38,28 @@ func newStackCmd() *cobra.Command {
// First print general info about the current stack.
fmt.Printf("Current stack is %v:\n", stackName)
if snapshot != nil {
fmt.Printf(" Last updated at %v\n", snapshot.Time)
fmt.Printf(" Last updated at %v\n", snapshot.Manifest.Time)
var cliver string
if snapshot.Manifest.Version == "" {
cliver = "?"
} else {
cliver = snapshot.Manifest.Version
}
fmt.Printf(" Pulumi version %s\n", cliver)
for _, plugin := range snapshot.Manifest.Plugins {
var plugver string
if plugin.Version == "" {
plugver = "?"
} else {
plugver = plugin.Version
}
fmt.Printf(" Plugin %s [%s] version %s\n", plugin.Name, plugin.Type, plugver)
}
}
if len(config) > 0 {
fmt.Printf(" %v configuration variables set (see `pulumi config` for details)\n", len(config))
}
fmt.Printf(" Checkpoint file is %s\n", stackFile)
fmt.Printf(" (Use `pulumi stack select` to change stack; `pulumi stack ls` lists known ones)\n")
fmt.Printf("\n")
// Now show the resources.
@ -90,6 +105,10 @@ func newStackCmd() *cobra.Command {
}
}
}
fmt.Printf("\n")
fmt.Printf("Use `pulumi stack select` to change stack; `pulumi stack ls` lists known ones\n")
return nil
}),
}

View file

@ -6,16 +6,17 @@ import (
"fmt"
"github.com/pulumi/pulumi/pkg/util/cmdutil"
"github.com/pulumi/pulumi/pkg/version"
"github.com/spf13/cobra"
)
func newVersionCmd(version string) *cobra.Command {
func newVersionCmd() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Print Pulumi's version number",
Args: cmdutil.NoArgs,
Run: cmdutil.RunFunc(func(cmd *cobra.Command, args []string) error {
fmt.Printf("%v\n", version)
fmt.Printf("%v\n", version.Version)
return nil
}),
}

View file

@ -10,10 +10,8 @@ import (
"github.com/pulumi/pulumi/pkg/util/contract"
)
var version = "<unknown>" // Our Makefiles override this by pasing -X main.version to the linker
func main() {
if err := cmd.NewPulumiCmd(version).Execute(); err != nil {
if err := cmd.NewPulumiCmd().Execute(); err != nil {
_, err = fmt.Fprintf(os.Stderr, "An error occurred: %v\n", err)
contract.IgnoreError(err)
os.Exit(-1)

View file

@ -15,6 +15,7 @@ import (
"github.com/pulumi/pulumi/pkg/resource/plugin"
"github.com/pulumi/pulumi/pkg/tokens"
"github.com/pulumi/pulumi/pkg/util/contract"
"github.com/pulumi/pulumi/pkg/version"
)
// Options controls the planning and deployment process.
@ -536,7 +537,23 @@ func (iter *PlanIterator) Snap() *Snapshot {
}
}
return NewSnapshot(iter.p.Target().Name, time.Now(), resources)
// Now produce a manifest and snapshot.
v, plugs := iter.SnapVersions()
manifest := Manifest{
Time: time.Now(),
Version: v,
Plugins: plugs,
}
manifest.Magic = manifest.NewMagic()
return NewSnapshot(iter.p.Target().Name, manifest, resources)
}
// SnapVersions returns all versions used in the generation of this snapshot. Note that no attempt is made to
// "merge" with old version information. So, if a checkpoint doesn't end up loading all of the possible plugins
// it could ever load -- e.g., due to a failure -- there will be some resources in the checkpoint snapshot that
// were loaded by plugins that never got loaded this time around. In other words, this list is not stable.
func (iter *PlanIterator) SnapVersions() (string, []plugin.Info) {
return version.Version, iter.p.ctx.Host.ListPlugins()
}
// MarkStateSnapshot marks an old state snapshot as being processed. This is done to recover from failures partway

View file

@ -4,7 +4,6 @@ package deploy
import (
"testing"
"time"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
@ -24,7 +23,7 @@ func TestNullPlan(t *testing.T) {
ctx, err := plugin.NewContext(cmdutil.Diag(), nil, nil)
assert.Nil(t, err)
targ := &Target{Name: tokens.QName("null")}
prev := NewSnapshot(targ.Name, time.Now(), nil)
prev := NewSnapshot(targ.Name, Manifest{}, nil)
plan := NewPlan(ctx, targ, prev, NullSource, nil)
iter, err := plan.Start(Options{})
assert.Nil(t, err)
@ -45,7 +44,7 @@ func TestErrorPlan(t *testing.T) {
ctx, err := plugin.NewContext(cmdutil.Diag(), nil, nil)
assert.Nil(t, err)
targ := &Target{Name: tokens.QName("errs")}
prev := NewSnapshot(targ.Name, time.Now(), nil)
prev := NewSnapshot(targ.Name, Manifest{}, nil)
plan := NewPlan(ctx, targ, prev, &errorSource{err: errors.New("ITERATE"), duringIterate: true}, nil)
iter, err := plan.Start(Options{})
assert.Nil(t, iter)
@ -60,7 +59,7 @@ func TestErrorPlan(t *testing.T) {
ctx, err := plugin.NewContext(cmdutil.Diag(), nil, nil)
assert.Nil(t, err)
targ := &Target{Name: tokens.QName("errs")}
prev := NewSnapshot(targ.Name, time.Now(), nil)
prev := NewSnapshot(targ.Name, Manifest{}, nil)
plan := NewPlan(ctx, targ, prev, &errorSource{err: errors.New("NEXT"), duringIterate: false}, nil)
iter, err := plan.Start(Options{})
assert.Nil(t, err)
@ -188,7 +187,7 @@ func TestBasicCRUDPlan(t *testing.T) {
nil,
"",
)
oldsnap := NewSnapshot(ns, time.Now(), []*resource.State{oldResB, oldResC, oldResD})
oldsnap := NewSnapshot(ns, Manifest{}, []*resource.State{oldResB, oldResC, oldResD})
// Create the new resource objects a priori.
// - A is created:
@ -374,6 +373,9 @@ func (host *testProviderHost) Provider(pkg tokens.Package) (plugin.Provider, err
func (host *testProviderHost) LanguageRuntime(runtime string, monitorAddr string) (plugin.LanguageRuntime, error) {
return host.langhost(runtime, monitorAddr)
}
func (host *testProviderHost) ListPlugins() []plugin.Info {
return nil
}
type testProvider struct {
pkg tokens.Package
@ -420,3 +422,8 @@ func (prov *testProvider) Invoke(tok tokens.ModuleMember,
args resource.PropertyMap) (resource.PropertyMap, []plugin.CheckFailure, error) {
return prov.invoke(tok, args)
}
func (prov *testProvider) GetPluginInfo() (plugin.Info, error) {
return plugin.Info{
Name: "testProvider",
}, nil
}

View file

@ -3,11 +3,14 @@
package deploy
import (
"crypto/sha256"
"fmt"
"time"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/pkg/resource"
"github.com/pulumi/pulumi/pkg/resource/plugin"
"github.com/pulumi/pulumi/pkg/tokens"
)
@ -15,17 +18,34 @@ import (
// IDs, names, and properties; their dependencies; and more. A snapshot is a diffable entity and can be used to create
// or apply an infrastructure deployment plan in order to make reality match the snapshot state.
type Snapshot struct {
Namespace tokens.QName // the namespace target being deployed into.
Time time.Time // the time this snapshot was taken.
Stack tokens.QName // the stack being deployed into.
Manifest Manifest // a deployment manifest of versions, checksums, and so on.
Resources []*resource.State // fetches all resources and their associated states.
}
// Manifest captures versions for all binaries used to construct this snapshot.
type Manifest struct {
Time time.Time // the time this snapshot was taken.
Magic string // a magic cookie.
Version string // the pulumi command version.
Plugins []plugin.Info // the plugin versions also loaded.
}
// NewMagic creates a magic cookie out of a manifest; this can be used to check for tampering. This ignores
// any existing magic value already stored on the manifest.
func (m Manifest) NewMagic() string {
if m.Version == "" {
return ""
}
return fmt.Sprintf("%x", sha256.Sum256([]byte(m.Version)))
}
// NewSnapshot creates a snapshot from the given arguments. The resources must be in topologically sorted order.
// This property is not checked; for verification, please refer to the VerifyIntegrity function below.
func NewSnapshot(ns tokens.QName, time time.Time, resources []*resource.State) *Snapshot {
func NewSnapshot(stack tokens.QName, manifest Manifest, resources []*resource.State) *Snapshot {
return &Snapshot{
Namespace: ns,
Time: time,
Stack: stack,
Manifest: manifest,
Resources: resources,
}
}
@ -34,8 +54,14 @@ func NewSnapshot(ns tokens.QName, time time.Time, resources []*resource.State) *
// integrity verification is only performed on demand, and not automatically during snapshot construction.
func (snap *Snapshot) VerifyIntegrity() error {
if snap != nil {
// For now, we just verify that parents come before children. Eventually, we will capture the full resource
// DAG (see https://github.com/pulumi/pulumi/issues/624), on which we can then do additional verification.
// Ensure the magic cookie checks out.
if snap.Manifest.Magic != snap.Manifest.NewMagic() {
return errors.Errorf("magic cookie mismatch; possible tampering/corruption detected")
}
// Now check the resources. For now, we just verify that parents come before children, and that there aren't
// any duplicate URNs. Eventually, we will capture the full resource DAG (see
// https://github.com/pulumi/pulumi/issues/624), on which we can then do additional verification.
urns := make(map[resource.URN]*resource.State)
for i, state := range snap.Resources {
urn := state.URN

View file

@ -19,6 +19,8 @@ type Analyzer interface {
Name() tokens.QName
// Analyze analyzes a single resource object, and returns any errors that it finds.
Analyze(t tokens.Type, props resource.PropertyMap) ([]AnalyzeFailure, error)
// GetPluginInfo returns this plugin's information.
GetPluginInfo() (Info, error)
}
// AnalyzeFailure indicates that resource analysis failed; it contains the property and reason for the failure.

View file

@ -7,10 +7,11 @@ import (
"strings"
"github.com/golang/glog"
pbempty "github.com/golang/protobuf/ptypes/empty"
"github.com/pulumi/pulumi/pkg/resource"
"github.com/pulumi/pulumi/pkg/tokens"
lumirpc "github.com/pulumi/pulumi/sdk/proto/go"
pulumirpc "github.com/pulumi/pulumi/sdk/proto/go"
)
const AnalyzerPluginPrefix = "pulumi-analyzer-"
@ -20,7 +21,7 @@ type analyzer struct {
ctx *Context
name tokens.QName
plug *plugin
client lumirpc.AnalyzerClient
client pulumirpc.AnalyzerClient
}
// NewAnalyzer binds to a given analyzer's plugin by name and creates a gRPC connection to it. If the associated plugin
@ -39,7 +40,7 @@ func NewAnalyzer(host Host, ctx *Context, name tokens.QName) (Analyzer, error) {
ctx: ctx,
name: name,
plug: plug,
client: lumirpc.NewAnalyzerClient(plug.Conn),
client: pulumirpc.NewAnalyzerClient(plug.Conn),
}, nil
}
@ -53,7 +54,7 @@ func (a *analyzer) Analyze(t tokens.Type, props resource.PropertyMap) ([]Analyze
return nil, err
}
resp, err := a.client.Analyze(a.ctx.Request(), &lumirpc.AnalyzeRequest{
resp, err := a.client.Analyze(a.ctx.Request(), &pulumirpc.AnalyzeRequest{
Type: string(t),
Properties: mprops,
})
@ -73,6 +74,21 @@ func (a *analyzer) Analyze(t tokens.Type, props resource.PropertyMap) ([]Analyze
return failures, nil
}
// GetPluginInfo returns this plugin's information.
func (a *analyzer) GetPluginInfo() (Info, error) {
glog.V(7).Infof("analyzer[%v].GetPluginInfo() executing", a.name)
resp, err := a.client.GetPluginInfo(a.ctx.Request(), &pbempty.Empty{})
if err != nil {
glog.V(7).Infof("analyzer[%v].GetPluginInfo() failed: err=%v", a.name, err)
return Info{}, err
}
return Info{
Name: a.plug.Bin,
Type: AnalyzerType,
Version: resp.Version,
}, nil
}
// Close tears down the underlying plugin RPC connection and process.
func (a *analyzer) Close() error {
return a.plug.Close()

View file

@ -28,10 +28,29 @@ type Host interface {
// an implementation of this language runtime wasn't found, on an error occurs, a non-nil error is returned.
LanguageRuntime(runtime string, monitorAddr string) (LanguageRuntime, error)
// ListPlugins lists all plugins that got loaded, with version information.
ListPlugins() []Info
// Close reclaims any resources associated with the host.
Close() error
}
// Info contains information about a plugin that was loaded by the host.
type Info struct {
Name string
Type Type
Version string
}
// Type is the kind of plugin.
type Type string
const (
AnalyzerType = "analyzer"
ResourceType = "resource"
LanguageType = "language"
)
// NewDefaultHost implements the standard plugin logic, using the standard installation root to find them.
func NewDefaultHost(ctx *Context) (Host, error) {
host := &defaultHost{
@ -55,6 +74,7 @@ type defaultHost struct {
ctx *Context // the shared context for this host.
analyzers map[tokens.QName]Analyzer // a cache of analyzer plugins and their processes.
providers map[tokens.Package]Provider // a cache of provider plugins and their processes.
plugins []Info // a list of plugins allocated by this host.
server *hostServer // the server's RPC machinery.
}
@ -76,8 +96,15 @@ func (host *defaultHost) Analyzer(name tokens.QName) (Analyzer, error) {
// If not, try to load and bind to a plugin.
plug, err := NewAnalyzer(host, host.ctx, name)
if err == nil && plug != nil {
pi, plerr := plug.GetPluginInfo()
if plerr != nil {
return nil, plerr
}
host.plugins = append(host.plugins, pi)
host.analyzers[name] = plug // memoize the result.
}
return plug, err
}
@ -91,14 +118,36 @@ func (host *defaultHost) Provider(pkg tokens.Package) (Provider, error) {
// If not, try to load and bind to a plugin.
plug, err := NewProvider(host, host.ctx, pkg)
if err == nil && plug != nil {
pi, plerr := plug.GetPluginInfo()
if plerr != nil {
return nil, plerr
}
host.plugins = append(host.plugins, pi)
host.providers[pkg] = plug // memoize the result.
}
return plug, err
}
func (host *defaultHost) LanguageRuntime(runtime string, monitorAddr string) (LanguageRuntime, error) {
// Always load a fresh language runtime, since each has a unique resource monitor session.
return NewLanguageRuntime(host, host.ctx, runtime, monitorAddr)
plug, err := NewLanguageRuntime(host, host.ctx, runtime, monitorAddr)
if err != nil {
return nil, err
}
pi, err := plug.GetPluginInfo()
if err != nil {
return nil, err
}
host.plugins = append(host.plugins, pi)
return plug, nil
}
func (host *defaultHost) ListPlugins() []Info {
return host.plugins
}
func (host *defaultHost) Close() error {

View file

@ -17,6 +17,8 @@ type LanguageRuntime interface {
// the code must not assume that side-effects or final values resulting from resource deployments are actually
// available. If it is false, on the other hand, a real deployment is occurring and it may safely depend on these.
Run(info RunInfo) (string, error)
// GetPluginInfo returns this plugin's information.
GetPluginInfo() (Info, error)
}
// RunInfo contains all of the information required to perform a plan or deployment operation.

View file

@ -6,9 +6,10 @@ import (
"strings"
"github.com/golang/glog"
pbempty "github.com/golang/protobuf/ptypes/empty"
"github.com/pulumi/pulumi/pkg/tokens"
lumirpc "github.com/pulumi/pulumi/sdk/proto/go"
pulumirpc "github.com/pulumi/pulumi/sdk/proto/go"
)
const LanguagePluginPrefix = "pulumi-langhost-"
@ -18,7 +19,7 @@ type langhost struct {
ctx *Context
runtime string
plug *plugin
client lumirpc.LanguageRuntimeClient
client pulumirpc.LanguageRuntimeClient
}
// NewLanguageRuntime binds to a language's runtime plugin and then creates a gRPC connection to it. If the
@ -26,7 +27,7 @@ type langhost struct {
func NewLanguageRuntime(host Host, ctx *Context, runtime string, monitorAddr string) (LanguageRuntime, error) {
// Go ahead and attempt to load the plugin from the PATH.
srvexe := LanguagePluginPrefix + strings.Replace(runtime, tokens.QNameDelimiter, "_", -1)
plug, err := newPlugin(ctx, srvexe, "nodejs", []string{monitorAddr, host.ServerAddr()})
plug, err := newPlugin(ctx, srvexe, runtime, []string{monitorAddr, host.ServerAddr()})
if err != nil {
return nil, err
} else if plug == nil {
@ -37,7 +38,7 @@ func NewLanguageRuntime(host Host, ctx *Context, runtime string, monitorAddr str
ctx: ctx,
runtime: runtime,
plug: plug,
client: lumirpc.NewLanguageRuntimeClient(plug.Conn),
client: pulumirpc.NewLanguageRuntimeClient(plug.Conn),
}, nil
}
@ -53,7 +54,7 @@ func (h *langhost) Run(info RunInfo) (string, error) {
for k, v := range info.Config {
config[string(k)] = v
}
resp, err := h.client.Run(h.ctx.Request(), &lumirpc.RunRequest{
resp, err := h.client.Run(h.ctx.Request(), &pulumirpc.RunRequest{
Pwd: info.Pwd,
Program: info.Program,
Args: info.Args,
@ -75,6 +76,21 @@ func (h *langhost) Run(info RunInfo) (string, error) {
return progerr, nil
}
// GetPluginInfo returns this plugin's information.
func (h *langhost) GetPluginInfo() (Info, error) {
glog.V(7).Infof("langhost[%v].GetPluginInfo() executing", h.runtime)
resp, err := h.client.GetPluginInfo(h.ctx.Request(), &pbempty.Empty{})
if err != nil {
glog.V(7).Infof("langhost[%v].GetPluginInfo() failed: err=%v", h.runtime, err)
return Info{}, err
}
return Info{
Name: h.plug.Bin,
Type: LanguageType,
Version: resp.Version,
}, nil
}
// Close tears down the underlying plugin RPC connection and process.
func (h *langhost) Close() error {
return h.plug.Close()

View file

@ -30,6 +30,8 @@ type plugin struct {
stdoutDone <-chan bool
stderrDone <-chan bool
Bin string
Args []string
Conn *grpc.ClientConn
Proc *os.Process
Stdin io.WriteCloser
@ -209,6 +211,8 @@ func execPlugin(bin string, pluginArgs []string) (*plugin, error) {
}
return &plugin{
Bin: bin,
Args: args,
Proc: cmd.Process,
Stdin: in,
Stdout: out,

View file

@ -39,6 +39,8 @@ type Provider interface {
Delete(urn resource.URN, id resource.ID, props resource.PropertyMap) (resource.Status, error)
// Invoke dynamically executes a built-in function in the provider.
Invoke(tok tokens.ModuleMember, args resource.PropertyMap) (resource.PropertyMap, []CheckFailure, error)
// GetPluginInfo returns this plugin's information.
GetPluginInfo() (Info, error)
}
// CheckFailure indicates that a call to check failed; it contains the property and reason for the failure.

View file

@ -7,12 +7,13 @@ import (
"strings"
"github.com/golang/glog"
pbempty "github.com/golang/protobuf/ptypes/empty"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/pkg/resource"
"github.com/pulumi/pulumi/pkg/tokens"
"github.com/pulumi/pulumi/pkg/util/contract"
lumirpc "github.com/pulumi/pulumi/sdk/proto/go"
pulumirpc "github.com/pulumi/pulumi/sdk/proto/go"
)
const ProviderPluginPrefix = "pulumi-provider-"
@ -22,7 +23,7 @@ type provider struct {
ctx *Context
pkg tokens.Package
plug *plugin
client lumirpc.ResourceProviderClient
client pulumirpc.ResourceProviderClient
}
// NewProvider attempts to bind to a given package's resource plugin and then creates a gRPC connection to it. If the
@ -41,7 +42,7 @@ func NewProvider(host Host, ctx *Context, pkg tokens.Package) (Provider, error)
ctx: ctx,
pkg: pkg,
plug: plug,
client: lumirpc.NewResourceProviderClient(plug.Conn),
client: pulumirpc.NewResourceProviderClient(plug.Conn),
}, nil
}
@ -54,7 +55,7 @@ func (p *provider) Configure(vars map[tokens.ModuleMember]string) error {
for k, v := range vars {
config[string(k)] = v
}
_, err := p.client.Configure(p.ctx.Request(), &lumirpc.ConfigureRequest{Variables: config})
_, err := p.client.Configure(p.ctx.Request(), &pulumirpc.ConfigureRequest{Variables: config})
if err != nil {
glog.V(7).Infof("resource[%v].Configure(#vars=%v,...) failed: err=%v", p.pkg, len(vars), err)
return err
@ -70,7 +71,7 @@ func (p *provider) Check(urn resource.URN, props resource.PropertyMap) (resource
return nil, nil, err
}
resp, err := p.client.Check(p.ctx.Request(), &lumirpc.CheckRequest{
resp, err := p.client.Check(p.ctx.Request(), &pulumirpc.CheckRequest{
Urn: string(urn),
Properties: mprops,
})
@ -118,7 +119,7 @@ func (p *provider) Diff(urn resource.URN, id resource.ID,
return DiffResult{}, err
}
resp, err := p.client.Diff(p.ctx.Request(), &lumirpc.DiffRequest{
resp, err := p.client.Diff(p.ctx.Request(), &pulumirpc.DiffRequest{
Id: string(id),
Urn: string(urn),
Olds: molds,
@ -157,7 +158,7 @@ func (p *provider) Create(urn resource.URN, props resource.PropertyMap) (resourc
return "", nil, resource.StatusOK, err
}
resp, err := p.client.Create(p.ctx.Request(), &lumirpc.CreateRequest{
resp, err := p.client.Create(p.ctx.Request(), &pulumirpc.CreateRequest{
Urn: string(urn),
Properties: mprops,
})
@ -200,7 +201,7 @@ func (p *provider) Update(urn resource.URN, id resource.ID,
return nil, resource.StatusOK, err
}
req := &lumirpc.UpdateRequest{
req := &pulumirpc.UpdateRequest{
Id: string(id),
Urn: string(urn),
Olds: molds,
@ -233,7 +234,7 @@ func (p *provider) Delete(urn resource.URN, id resource.ID, props resource.Prope
}
glog.V(7).Infof("resource[%v].Delete(id=%v,urn=%v) executing", p.pkg, id, urn)
req := &lumirpc.DeleteRequest{
req := &pulumirpc.DeleteRequest{
Id: string(id),
Urn: string(urn),
Properties: mprops,
@ -259,7 +260,7 @@ func (p *provider) Invoke(tok tokens.ModuleMember, args resource.PropertyMap) (r
}
glog.V(7).Infof("resource[%v].Invoke(tok=%v,#args=%v) executing", tok, len(args))
resp, err := p.client.Invoke(p.ctx.Request(), &lumirpc.InvokeRequest{Tok: string(tok), Args: margs})
resp, err := p.client.Invoke(p.ctx.Request(), &pulumirpc.InvokeRequest{Tok: string(tok), Args: margs})
if err != nil {
glog.V(7).Infof("resource[%v].Invoke(tok=%v,#args=%v) failed: %v", p.pkg, tok, len(args), err)
return nil, nil, err
@ -282,6 +283,21 @@ func (p *provider) Invoke(tok tokens.ModuleMember, args resource.PropertyMap) (r
return ret, failures, nil
}
// GetPluginInfo returns this plugin's information.
func (p *provider) GetPluginInfo() (Info, error) {
glog.V(7).Infof("resource[%v].GetPluginInfo() executing", p.pkg)
resp, err := p.client.GetPluginInfo(p.ctx.Request(), &pbempty.Empty{})
if err != nil {
glog.V(7).Infof("resource[%v].GetPluginInfo() failed: err=%v", p.pkg, err)
return Info{}, err
}
return Info{
Name: p.plug.Bin,
Type: ResourceType,
Version: resp.Version,
}, nil
}
// Close tears down the underlying plugin RPC connection and process.
func (p *provider) Close() error {
return p.plug.Close()

View file

@ -11,6 +11,7 @@ import (
"github.com/pulumi/pulumi/pkg/resource"
"github.com/pulumi/pulumi/pkg/resource/config"
"github.com/pulumi/pulumi/pkg/resource/deploy"
"github.com/pulumi/pulumi/pkg/resource/plugin"
"github.com/pulumi/pulumi/pkg/tokens"
"github.com/pulumi/pulumi/pkg/util/contract"
"github.com/pulumi/pulumi/pkg/workspace"
@ -62,6 +63,20 @@ func DeserializeCheckpoint(chkpoint *Checkpoint) (tokens.QName,
var snap *deploy.Snapshot
name := chkpoint.Target
if latest := chkpoint.Latest; latest != nil {
// Unpack the versions.
manifest := deploy.Manifest{
Time: latest.Manifest.Time,
Magic: latest.Manifest.Magic,
Version: latest.Manifest.Version,
}
for _, plug := range latest.Manifest.Plugins {
manifest.Plugins = append(manifest.Plugins, plugin.Info{
Name: plug.Name,
Type: plug.Type,
Version: plug.Version,
})
}
// For every serialized resource vertex, create a ResourceDeployment out of it.
var resources []*resource.State
for _, res := range latest.Resources {
@ -72,7 +87,7 @@ func DeserializeCheckpoint(chkpoint *Checkpoint) (tokens.QName,
resources = append(resources, desres)
}
snap = deploy.NewSnapshot(name, chkpoint.Latest.Time, resources)
snap = deploy.NewSnapshot(name, manifest, resources)
}
return name, chkpoint.Config, snap, nil

View file

@ -8,6 +8,7 @@ import (
"github.com/pulumi/pulumi/pkg/resource"
"github.com/pulumi/pulumi/pkg/resource/deploy"
"github.com/pulumi/pulumi/pkg/resource/plugin"
"github.com/pulumi/pulumi/pkg/tokens"
"github.com/pulumi/pulumi/pkg/util/contract"
)
@ -16,10 +17,25 @@ import (
// to the actual Snapshot structure, except that it flattens and rearranges a few data structures for serializability.
// Over time, we also expect this to gather more information about deploys themselves.
type Deployment struct {
Time time.Time `json:"time" yaml:"time"` // the time of the deploy.
Manifest Manifest `json:"manifest" yaml:"manifest"` // the deployment's manifest.
Resources []Resource `json:"resources,omitempty" yaml:"resources,omitempty"` // an array of resources.
}
// Manifest captures meta-information about this checkpoint file, such as versions of binaries, etc.
type Manifest struct {
Time time.Time `json:"time" yaml:"time"` // the time of the deploy.
Magic string `json:"magic" yaml:"magic"` // a magic cookie.
Version string `json:"version" yaml:"version"` // the version of the Pulumi CLI.
Plugins []PluginInfo `json:"plugins,omitempty" yaml:"plugins,omitempty"` // the plugin binary versions.
}
// PluginInfo captures the version and information about a plugin.
type PluginInfo struct {
Name string `json:"name" yaml:"name"`
Type plugin.Type `json:"type" yaml:"type"`
Version string `json:"version" yaml:"version"`
}
// Resource is a serializable vertex within a LumiGL graph, specifically for resource snapshots.
// nolint: lll
type Resource struct {
@ -39,6 +55,20 @@ const RootPulumiStackTypeName tokens.Type = "pulumi:pulumi:Stack"
// SerializeDeployment serializes an entire snapshot as a deploy record.
func SerializeDeployment(snap *deploy.Snapshot) *Deployment {
// Capture the version information into a manifest.
manifest := Manifest{
Time: snap.Manifest.Time,
Magic: snap.Manifest.Magic,
Version: snap.Manifest.Version,
}
for _, plug := range snap.Manifest.Plugins {
manifest.Plugins = append(manifest.Plugins, PluginInfo{
Name: plug.Name,
Type: plug.Type,
Version: plug.Version,
})
}
// Serialize all vertices and only include a vertex section if non-empty.
var resources []Resource
for _, res := range snap.Resources {
@ -46,7 +76,7 @@ func SerializeDeployment(snap *deploy.Snapshot) *Deployment {
}
return &Deployment{
Time: snap.Time,
Manifest: manifest,
Resources: resources,
}
}

6
pkg/version/version.go Normal file
View file

@ -0,0 +1,6 @@
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
package version
// Version is initialized by the Go linker to contain the semver of this build.
var Version string

View file

@ -1,5 +1,7 @@
PROJECT_NAME := Pulumi Node.JS SDK
PROJECT_NAME := Pulumi Node.JS SDK
NODE_MODULE_NAME := pulumi
VERSION := $(shell git describe --tags --dirty 2>/dev/null)
include ../../build/common.mk
export PATH:=$(shell yarn bin 2>/dev/null):$(PATH)
@ -15,6 +17,10 @@ build::
cp -R ../proto/nodejs/. proto/
cd runtime/native/ && node-gyp build
tsc
cp package.json bin/
sed -i.bak "s/\$${VERSION}/$(VERSION)/g" bin/version.js bin/package.json && \
rm bin/version.js.bak && \
rm bin/package.json.bak
cp -R proto/. bin/proto/
mkdir -p bin/runtime/native/
cp -R runtime/native/build/. bin/runtime/native/build/

View file

@ -5,6 +5,7 @@ import * as path from "path";
import * as dynamic from "../../dynamic";
import * as resource from "../../resource";
import { version } from "../../version";
const requireFromString = require("require-from-string");
const grpc = require("grpc");
@ -12,6 +13,7 @@ const emptyproto = require("google-protobuf/google/protobuf/empty_pb.js");
const structproto = require("google-protobuf/google/protobuf/struct_pb.js");
const provproto = require("../../proto/provider_pb.js");
const provrpc = require("../../proto/provider_grpc_pb.js");
const plugproto = require("../../proto/plugin_pb.js");
const providerKey: string = "__provider";
@ -158,6 +160,12 @@ async function deleteRPC(call: any, callback: any): Promise<void> {
}
}
async function getPluginInfoRPC(call: any, callback: any): Promise<void> {
const resp: any = new plugproto.PluginInfo();
resp.setVersion(version);
callback(undefined, resp);
}
export function main(args: string[]): void {
// The program requires a single argument: the address of the RPC endpoint for the engine. It
// optionally also takes a second argument, a reference back to the engine, but this may be missing.
@ -178,6 +186,7 @@ export function main(args: string[]): void {
create: createRPC,
update: updateRPC,
delete: deleteRPC,
getPluginInfo: getPluginInfoRPC,
});
const port: number = server.bind(`0.0.0.0:0`, grpc.ServerCredentials.createInsecure());

View file

@ -14,4 +14,3 @@ import * as dynamic from "./dynamic";
import * as log from "./log";
import * as runtime from "./runtime";
export { asset, dynamic, log, runtime };

View file

@ -1,6 +1,6 @@
{
"name": "pulumi",
"version": "0.6.1",
"version": "${VERSION}",
"description": "Pulumi's Node.js SDK",
"repository": "https://github.com/pulumi/pulumi/sdk/nodejs",
"devDependencies": {

View file

@ -4,10 +4,12 @@ import * as childprocess from "child_process";
import * as os from "os";
import * as path from "path";
import * as runtime from "../runtime";
import { version } from "../version";
const grpc = require("grpc");
const langproto = require("../proto/language_pb.js");
const langrpc = require("../proto/language_grpc_pb.js");
const plugproto = require("../proto/plugin_pb.js");
/**
* monitorAddr is the current resource monitor address.
@ -39,7 +41,10 @@ export function serveLanguageHost(monitor: string, engine?: string, tracing?: st
// Now fire up the gRPC server and begin serving!
const server = new grpc.Server();
server.addService(langrpc.LanguageRuntimeService, { run: runRPC });
server.addService(langrpc.LanguageRuntimeService, {
run: runRPC,
getPluginInfo: getPluginInfoRPC,
});
const port: number = server.bind(`0.0.0.0:0`, grpc.ServerCredentials.createInsecure());
// Now we're done: the server is started, and gRPC keeps the even loop alive.
@ -194,3 +199,12 @@ function stripEOL(data: string | Buffer): string {
}
return dataString;
}
/**
* getPluginInfoRPC implements the RPC interface for plugin introspection.
*/
function getPluginInfoRPC(call: any, callback: any): void {
const resp = new plugproto.PluginInfo();
resp.setVersion(version);
callback(undefined, resp);
}

View file

@ -21,6 +21,7 @@
"errors.ts",
"metadata.ts",
"resource.ts",
"version",
"asset/index.ts",
"asset/asset.ts",

3
sdk/nodejs/version.ts Normal file
View file

@ -0,0 +1,3 @@
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
export let version = "${VERSION}";

View file

@ -2,6 +2,8 @@
syntax = "proto3";
import "plugin.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
package pulumirpc;
@ -11,6 +13,8 @@ package pulumirpc;
service Analyzer {
// Analyze analyzes a single resource object, and returns any errors that it finds.
rpc Analyze(AnalyzeRequest) returns (AnalyzeResponse) {}
// GetPluginInfo returns generic information about this plugin, like its version.
rpc GetPluginInfo(google.protobuf.Empty) returns (PluginInfo) {}
}
message AnalyzeRequest {
@ -26,4 +30,3 @@ message AnalyzeFailure {
string property = 1; // the property that the analyzer rejected (or "" if general).
string reason = 2; // the reason that the analyzer rejected the request.
}

View file

@ -24,5 +24,3 @@ message LogRequest {
LogSeverity severity = 1; // the logging level of this message.
string message = 2; // the contents of the logged message.
}

View file

@ -9,6 +9,7 @@ It is generated from these files:
analyzer.proto
engine.proto
language.proto
plugin.proto
provider.proto
resource.proto
@ -19,6 +20,7 @@ It has these top-level messages:
LogRequest
RunRequest
RunResponse
PluginInfo
ConfigureRequest
InvokeRequest
InvokeResponse
@ -41,7 +43,8 @@ package pulumirpc
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "github.com/golang/protobuf/ptypes/struct"
import google_protobuf "github.com/golang/protobuf/ptypes/empty"
import google_protobuf1 "github.com/golang/protobuf/ptypes/struct"
import (
context "golang.org/x/net/context"
@ -60,8 +63,8 @@ var _ = math.Inf
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type AnalyzeRequest struct {
Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
Properties *google_protobuf.Struct `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
Properties *google_protobuf1.Struct `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
}
func (m *AnalyzeRequest) Reset() { *m = AnalyzeRequest{} }
@ -76,7 +79,7 @@ func (m *AnalyzeRequest) GetType() string {
return ""
}
func (m *AnalyzeRequest) GetProperties() *google_protobuf.Struct {
func (m *AnalyzeRequest) GetProperties() *google_protobuf1.Struct {
if m != nil {
return m.Properties
}
@ -142,6 +145,8 @@ const _ = grpc.SupportPackageIsVersion4
type AnalyzerClient interface {
// Analyze analyzes a single resource object, and returns any errors that it finds.
Analyze(ctx context.Context, in *AnalyzeRequest, opts ...grpc.CallOption) (*AnalyzeResponse, error)
// GetPluginInfo returns generic information about this plugin, like its version.
GetPluginInfo(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*PluginInfo, error)
}
type analyzerClient struct {
@ -161,11 +166,22 @@ func (c *analyzerClient) Analyze(ctx context.Context, in *AnalyzeRequest, opts .
return out, nil
}
func (c *analyzerClient) GetPluginInfo(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*PluginInfo, error) {
out := new(PluginInfo)
err := grpc.Invoke(ctx, "/pulumirpc.Analyzer/GetPluginInfo", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Analyzer service
type AnalyzerServer interface {
// Analyze analyzes a single resource object, and returns any errors that it finds.
Analyze(context.Context, *AnalyzeRequest) (*AnalyzeResponse, error)
// GetPluginInfo returns generic information about this plugin, like its version.
GetPluginInfo(context.Context, *google_protobuf.Empty) (*PluginInfo, error)
}
func RegisterAnalyzerServer(s *grpc.Server, srv AnalyzerServer) {
@ -190,6 +206,24 @@ func _Analyzer_Analyze_Handler(srv interface{}, ctx context.Context, dec func(in
return interceptor(ctx, in, info, handler)
}
func _Analyzer_GetPluginInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(google_protobuf.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AnalyzerServer).GetPluginInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pulumirpc.Analyzer/GetPluginInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AnalyzerServer).GetPluginInfo(ctx, req.(*google_protobuf.Empty))
}
return interceptor(ctx, in, info, handler)
}
var _Analyzer_serviceDesc = grpc.ServiceDesc{
ServiceName: "pulumirpc.Analyzer",
HandlerType: (*AnalyzerServer)(nil),
@ -198,6 +232,10 @@ var _Analyzer_serviceDesc = grpc.ServiceDesc{
MethodName: "Analyze",
Handler: _Analyzer_Analyze_Handler,
},
{
MethodName: "GetPluginInfo",
Handler: _Analyzer_GetPluginInfo_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "analyzer.proto",
@ -206,21 +244,23 @@ var _Analyzer_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("analyzer.proto", fileDescriptor0) }
var fileDescriptor0 = []byte{
// 242 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x90, 0xb1, 0x4b, 0xc4, 0x30,
0x14, 0xc6, 0xad, 0xca, 0xd9, 0xbe, 0x83, 0x13, 0xde, 0xa0, 0xb5, 0x38, 0x94, 0x4e, 0x9d, 0x72,
0x50, 0x11, 0x67, 0x45, 0xc4, 0xc9, 0x21, 0xce, 0x0e, 0xbd, 0xe3, 0xdd, 0x51, 0xa8, 0x4d, 0x7c,
0x49, 0x86, 0xfa, 0xd7, 0x0b, 0x49, 0x0c, 0x37, 0x74, 0x7b, 0x8f, 0xef, 0xeb, 0xaf, 0xbf, 0x17,
0xd8, 0xf4, 0x53, 0x3f, 0xce, 0xbf, 0xc4, 0x42, 0xb3, 0xb2, 0x0a, 0x0b, 0xed, 0x46, 0xf7, 0x3d,
0xb0, 0xde, 0x57, 0xf7, 0x47, 0xa5, 0x8e, 0x23, 0x6d, 0x7d, 0xb0, 0x73, 0x87, 0xad, 0xb1, 0xec,
0xf6, 0x36, 0x14, 0x9b, 0x2f, 0xd8, 0x3c, 0x87, 0x4f, 0x25, 0xfd, 0x38, 0x32, 0x16, 0x11, 0x2e,
0xed, 0xac, 0xa9, 0xcc, 0xea, 0xac, 0x2d, 0xa4, 0x9f, 0xf1, 0x09, 0x40, 0xb3, 0xd2, 0xc4, 0x76,
0x20, 0x53, 0x9e, 0xd7, 0x59, 0xbb, 0xee, 0x6e, 0x45, 0x00, 0x8b, 0x7f, 0xb0, 0xf8, 0xf4, 0x60,
0x79, 0x52, 0x6d, 0xde, 0xe1, 0x3a, 0xe1, 0x8d, 0x56, 0x93, 0x21, 0x7c, 0x84, 0xfc, 0xd0, 0x0f,
0xa3, 0x63, 0x32, 0x65, 0x56, 0x5f, 0xb4, 0xeb, 0xee, 0x4e, 0x24, 0x5b, 0x11, 0xdb, 0x6f, 0xa1,
0x21, 0x53, 0xb5, 0x79, 0x4d, 0xa2, 0x31, 0xc3, 0x0a, 0xf2, 0xf8, 0xa7, 0x39, 0xca, 0xa6, 0x1d,
0x6f, 0x60, 0xc5, 0xd4, 0x1b, 0x35, 0x79, 0xd9, 0x42, 0xc6, 0xad, 0xfb, 0x80, 0x3c, 0x52, 0x18,
0x5f, 0xe0, 0x2a, 0xce, 0xb8, 0x60, 0x10, 0x9f, 0xa3, 0xaa, 0x96, 0xa2, 0x70, 0x4a, 0x73, 0xb6,
0x5b, 0xf9, 0xe3, 0x1f, 0xfe, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x30, 0x0e, 0x75, 0x80, 0x01,
0x00, 0x00,
// 287 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6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d, 0x79, 0x6f, 0x4d, 0xee, 0xfa, 0xa0, 0x41, 0x43, 0x06, 0xa3, 0x30, 0xa9, 0x0b,
0x61, 0xfb, 0x1e, 0x67, 0x30, 0x54, 0x54, 0x68, 0xd1, 0xba, 0xb0, 0xe3, 0x3c, 0x74, 0xd9, 0x67,
0x04, 0xa3, 0x80, 0x51, 0x78, 0x0b, 0xfb, 0xa1, 0xc6, 0x2d, 0x11, 0xc2, 0x3d, 0x18, 0xdb, 0x26,
0xf9, 0x5d, 0x92, 0x01, 0x5e, 0xc3, 0xe1, 0x23, 0x99, 0x17, 0xf7, 0x8d, 0xe7, 0xb6, 0x14, 0x38,
0xfb, 0x77, 0x96, 0xfb, 0xef, 0x67, 0xb0, 0xe3, 0x0d, 0xcc, 0xaf, 0x3d, 0x19, 0x2c, 0x87, 0xce,
0x78, 0xf1, 0x15, 0x00, 0x00, 0xff, 0xff, 0xff, 0x6d, 0x9c, 0x46, 0xee, 0x01, 0x00, 0x00,
}

View file

@ -7,7 +7,7 @@ package pulumirpc
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf1 "github.com/golang/protobuf/ptypes/empty"
import google_protobuf "github.com/golang/protobuf/ptypes/empty"
import (
context "golang.org/x/net/context"
@ -88,7 +88,7 @@ const _ = grpc.SupportPackageIsVersion4
type EngineClient interface {
// Log logs a global message in the engine, including errors and warnings.
Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
}
type engineClient struct {
@ -99,8 +99,8 @@ func NewEngineClient(cc *grpc.ClientConn) EngineClient {
return &engineClient{cc}
}
func (c *engineClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) {
out := new(google_protobuf1.Empty)
func (c *engineClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
out := new(google_protobuf.Empty)
err := grpc.Invoke(ctx, "/pulumirpc.Engine/Log", in, out, c.cc, opts...)
if err != nil {
return nil, err
@ -112,7 +112,7 @@ func (c *engineClient) Log(ctx context.Context, in *LogRequest, opts ...grpc.Cal
type EngineServer interface {
// Log logs a global message in the engine, including errors and warnings.
Log(context.Context, *LogRequest) (*google_protobuf1.Empty, error)
Log(context.Context, *LogRequest) (*google_protobuf.Empty, error)
}
func RegisterEngineServer(s *grpc.Server, srv EngineServer) {

View file

@ -7,6 +7,7 @@ package pulumirpc
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "github.com/golang/protobuf/ptypes/empty"
import (
context "golang.org/x/net/context"
@ -125,6 +126,8 @@ const _ = grpc.SupportPackageIsVersion4
type LanguageRuntimeClient interface {
Run(ctx context.Context, in *RunRequest, opts ...grpc.CallOption) (*RunResponse, error)
// GetPluginInfo returns generic information about this plugin, like its version.
GetPluginInfo(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*PluginInfo, error)
}
type languageRuntimeClient struct {
@ -144,10 +147,21 @@ func (c *languageRuntimeClient) Run(ctx context.Context, in *RunRequest, opts ..
return out, nil
}
func (c *languageRuntimeClient) GetPluginInfo(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*PluginInfo, error) {
out := new(PluginInfo)
err := grpc.Invoke(ctx, "/pulumirpc.LanguageRuntime/GetPluginInfo", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for LanguageRuntime service
type LanguageRuntimeServer interface {
Run(context.Context, *RunRequest) (*RunResponse, error)
// GetPluginInfo returns generic information about this plugin, like its version.
GetPluginInfo(context.Context, *google_protobuf.Empty) (*PluginInfo, error)
}
func RegisterLanguageRuntimeServer(s *grpc.Server, srv LanguageRuntimeServer) {
@ -172,6 +186,24 @@ func _LanguageRuntime_Run_Handler(srv interface{}, ctx context.Context, dec func
return interceptor(ctx, in, info, handler)
}
func _LanguageRuntime_GetPluginInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(google_protobuf.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LanguageRuntimeServer).GetPluginInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pulumirpc.LanguageRuntime/GetPluginInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LanguageRuntimeServer).GetPluginInfo(ctx, req.(*google_protobuf.Empty))
}
return interceptor(ctx, in, info, handler)
}
var _LanguageRuntime_serviceDesc = grpc.ServiceDesc{
ServiceName: "pulumirpc.LanguageRuntime",
HandlerType: (*LanguageRuntimeServer)(nil),
@ -180,6 +212,10 @@ var _LanguageRuntime_serviceDesc = grpc.ServiceDesc{
MethodName: "Run",
Handler: _LanguageRuntime_Run_Handler,
},
{
MethodName: "GetPluginInfo",
Handler: _LanguageRuntime_GetPluginInfo_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "language.proto",
@ -188,24 +224,27 @@ var _LanguageRuntime_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("language.proto", fileDescriptor2) }
var fileDescriptor2 = []byte{
// 290 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x91, 0x31, 0x4f, 0xc3, 0x30,
0x10, 0x85, 0x49, 0xd3, 0xa6, 0xed, 0x45, 0x02, 0x64, 0x41, 0x65, 0x65, 0x0a, 0x61, 0xc9, 0x94,
0xa1, 0x48, 0x88, 0xb2, 0x22, 0x06, 0x24, 0x26, 0xff, 0x03, 0x93, 0x9a, 0x28, 0xd4, 0xb1, 0x8d,
0x63, 0x83, 0xf2, 0x87, 0xf8, 0x9d, 0xc8, 0x8e, 0x1b, 0x10, 0x62, 0xbb, 0xef, 0xe9, 0xee, 0xe9,
0x3d, 0x1b, 0x4e, 0x39, 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x6a, 0x62, 0x85, 0x69, 0x3b,
0x86, 0x6e, 0x21, 0x76, 0xa9, 0x2e, 0xff, 0x2d, 0x96, 0x6d, 0xfe, 0xca, 0xa3, 0x7d, 0x71, 0xf2,
0x92, 0xf8, 0xaf, 0xba, 0xf9, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x17, 0x9b, 0x90, 0x0a, 0xbc, 0x01,
0x00, 0x00,
// 350 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x91, 0xdd, 0x4a, 0xfb, 0x30,
0x18, 0xc6, 0xd7, 0x75, 0xeb, 0xb6, 0xec, 0xff, 0x45, 0xf8, 0x3b, 0x42, 0x3d, 0xa9, 0xf5, 0xa4,
0x47, 0x1d, 0x4c, 0x10, 0xe7, 0x91, 0x20, 0x43, 0x04, 0x0f, 0x24, 0x77, 0x90, 0x75, 0x59, 0xa8,
0x4b, 0x93, 0x98, 0x26, 0x4a, 0xaf, 0xc1, 0xfb, 0xf0, 0x3a, 0x25, 0x69, 0xf7, 0x81, 0x78, 0xf6,
0xfe, 0xde, 0xbc, 0x79, 0x78, 0x1e, 0x1e, 0xf0, 0x87, 0x13, 0xc1, 0x2c, 0x61, 0x34, 0x57, 0x5a,
0x1a, 0x09, 0x27, 0xca, 0x72, 0x5b, 0x95, 0x5a, 0x15, 0xf1, 0x2f, 0xc5, 0x2d, 0x2b, 0x45, 0xfb,
0x10, 0x9f, 0x33, 0x29, 0x19, 0xa7, 0x73, 0x4f, 0x6b, 0xbb, 0x9d, 0xd3, 0x4a, 0x99, 0xa6, 0x7d,
0x4c, 0x3f, 0xfb, 0x00, 0x60, 0x2b, 0x30, 0x7d, 0xb5, 0xb4, 0x36, 0x10, 0x81, 0x91, 0xd2, 0xf2,
0x85, 0x16, 0x06, 0x05, 0x49, 0x90, 0x4d, 0xf0, 0x1e, 0xe1, 0x7f, 0x30, 0xac, 0x0d, 0x29, 0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, 0xf2, 0xf1, 0x3c, 0xed, 0xad, 0x23, 0x7f, 0x78,
0xf5, 0x15, 0x00, 0x00, 0xff, 0xff, 0x88, 0x1d, 0x6c, 0x98, 0x2a, 0x02, 0x00, 0x00,
}

47
sdk/proto/go/plugin.pb.go Normal file
View file

@ -0,0 +1,47 @@
// Code generated by protoc-gen-go.
// source: plugin.proto
// DO NOT EDIT!
package pulumirpc
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// PluginInfo is meta-information about a plugin that is used by the system.
type PluginInfo struct {
Version string `protobuf:"bytes,1,opt,name=version" json:"version,omitempty"`
}
func (m *PluginInfo) Reset() { *m = PluginInfo{} }
func (m *PluginInfo) String() string { return proto.CompactTextString(m) }
func (*PluginInfo) ProtoMessage() {}
func (*PluginInfo) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
func (m *PluginInfo) GetVersion() string {
if m != nil {
return m.Version
}
return ""
}
func init() {
proto.RegisterType((*PluginInfo)(nil), "pulumirpc.PluginInfo")
}
func init() { proto.RegisterFile("plugin.proto", fileDescriptor3) }
var fileDescriptor3 = []byte{
// 85 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x29, 0xc8, 0x29, 0x4d,
0xcf, 0xcc, 0xd3, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x2c, 0x28, 0xcd, 0x29, 0xcd, 0xcd,
0x2c, 0x2a, 0x48, 0x56, 0x52, 0xe3, 0xe2, 0x0a, 0x00, 0x4b, 0x79, 0xe6, 0xa5, 0xe5, 0x0b, 0x49,
0x70, 0xb1, 0x97, 0xa5, 0x16, 0x15, 0x67, 0xe6, 0xe7, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06,
0xc1, 0xb8, 0x49, 0x6c, 0x60, 0x9d, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x02, 0xec, 0x88,
0x3e, 0x49, 0x00, 0x00, 0x00,
}

View file

@ -7,8 +7,8 @@ package pulumirpc
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf1 "github.com/golang/protobuf/ptypes/empty"
import google_protobuf "github.com/golang/protobuf/ptypes/struct"
import google_protobuf "github.com/golang/protobuf/ptypes/empty"
import google_protobuf1 "github.com/golang/protobuf/ptypes/struct"
import (
context "golang.org/x/net/context"
@ -27,7 +27,7 @@ type ConfigureRequest struct {
func (m *ConfigureRequest) Reset() { *m = ConfigureRequest{} }
func (m *ConfigureRequest) String() string { return proto.CompactTextString(m) }
func (*ConfigureRequest) ProtoMessage() {}
func (*ConfigureRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
func (*ConfigureRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} }
func (m *ConfigureRequest) GetVariables() map[string]string {
if m != nil {
@ -37,14 +37,14 @@ func (m *ConfigureRequest) GetVariables() map[string]string {
}
type InvokeRequest struct {
Tok string `protobuf:"bytes,1,opt,name=tok" json:"tok,omitempty"`
Args *google_protobuf.Struct `protobuf:"bytes,2,opt,name=args" json:"args,omitempty"`
Tok string `protobuf:"bytes,1,opt,name=tok" json:"tok,omitempty"`
Args *google_protobuf1.Struct `protobuf:"bytes,2,opt,name=args" json:"args,omitempty"`
}
func (m *InvokeRequest) Reset() { *m = InvokeRequest{} }
func (m *InvokeRequest) String() string { return proto.CompactTextString(m) }
func (*InvokeRequest) ProtoMessage() {}
func (*InvokeRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} }
func (*InvokeRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} }
func (m *InvokeRequest) GetTok() string {
if m != nil {
@ -53,7 +53,7 @@ func (m *InvokeRequest) GetTok() string {
return ""
}
func (m *InvokeRequest) GetArgs() *google_protobuf.Struct {
func (m *InvokeRequest) GetArgs() *google_protobuf1.Struct {
if m != nil {
return m.Args
}
@ -61,16 +61,16 @@ func (m *InvokeRequest) GetArgs() *google_protobuf.Struct {
}
type InvokeResponse struct {
Return *google_protobuf.Struct `protobuf:"bytes,1,opt,name=return" json:"return,omitempty"`
Failures []*CheckFailure `protobuf:"bytes,2,rep,name=failures" json:"failures,omitempty"`
Return *google_protobuf1.Struct `protobuf:"bytes,1,opt,name=return" json:"return,omitempty"`
Failures []*CheckFailure `protobuf:"bytes,2,rep,name=failures" json:"failures,omitempty"`
}
func (m *InvokeResponse) Reset() { *m = InvokeResponse{} }
func (m *InvokeResponse) String() string { return proto.CompactTextString(m) }
func (*InvokeResponse) ProtoMessage() {}
func (*InvokeResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{2} }
func (*InvokeResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} }
func (m *InvokeResponse) GetReturn() *google_protobuf.Struct {
func (m *InvokeResponse) GetReturn() *google_protobuf1.Struct {
if m != nil {
return m.Return
}
@ -85,14 +85,14 @@ func (m *InvokeResponse) GetFailures() []*CheckFailure {
}
type CheckRequest struct {
Urn string `protobuf:"bytes,1,opt,name=urn" json:"urn,omitempty"`
Properties *google_protobuf.Struct `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
Urn string `protobuf:"bytes,1,opt,name=urn" json:"urn,omitempty"`
Properties *google_protobuf1.Struct `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
}
func (m *CheckRequest) Reset() { *m = CheckRequest{} }
func (m *CheckRequest) String() string { return proto.CompactTextString(m) }
func (*CheckRequest) ProtoMessage() {}
func (*CheckRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{3} }
func (*CheckRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{3} }
func (m *CheckRequest) GetUrn() string {
if m != nil {
@ -101,7 +101,7 @@ func (m *CheckRequest) GetUrn() string {
return ""
}
func (m *CheckRequest) GetProperties() *google_protobuf.Struct {
func (m *CheckRequest) GetProperties() *google_protobuf1.Struct {
if m != nil {
return m.Properties
}
@ -109,16 +109,16 @@ func (m *CheckRequest) GetProperties() *google_protobuf.Struct {
}
type CheckResponse struct {
Defaults *google_protobuf.Struct `protobuf:"bytes,1,opt,name=defaults" json:"defaults,omitempty"`
Failures []*CheckFailure `protobuf:"bytes,2,rep,name=failures" json:"failures,omitempty"`
Defaults *google_protobuf1.Struct `protobuf:"bytes,1,opt,name=defaults" json:"defaults,omitempty"`
Failures []*CheckFailure `protobuf:"bytes,2,rep,name=failures" json:"failures,omitempty"`
}
func (m *CheckResponse) Reset() { *m = CheckResponse{} }
func (m *CheckResponse) String() string { return proto.CompactTextString(m) }
func (*CheckResponse) ProtoMessage() {}
func (*CheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{4} }
func (*CheckResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{4} }
func (m *CheckResponse) GetDefaults() *google_protobuf.Struct {
func (m *CheckResponse) GetDefaults() *google_protobuf1.Struct {
if m != nil {
return m.Defaults
}
@ -140,7 +140,7 @@ type CheckFailure struct {
func (m *CheckFailure) Reset() { *m = CheckFailure{} }
func (m *CheckFailure) String() string { return proto.CompactTextString(m) }
func (*CheckFailure) ProtoMessage() {}
func (*CheckFailure) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{5} }
func (*CheckFailure) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{5} }
func (m *CheckFailure) GetProperty() string {
if m != nil {
@ -157,16 +157,16 @@ func (m *CheckFailure) GetReason() string {
}
type DiffRequest struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Urn string `protobuf:"bytes,2,opt,name=urn" json:"urn,omitempty"`
Olds *google_protobuf.Struct `protobuf:"bytes,3,opt,name=olds" json:"olds,omitempty"`
News *google_protobuf.Struct `protobuf:"bytes,4,opt,name=news" json:"news,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Urn string `protobuf:"bytes,2,opt,name=urn" json:"urn,omitempty"`
Olds *google_protobuf1.Struct `protobuf:"bytes,3,opt,name=olds" json:"olds,omitempty"`
News *google_protobuf1.Struct `protobuf:"bytes,4,opt,name=news" json:"news,omitempty"`
}
func (m *DiffRequest) Reset() { *m = DiffRequest{} }
func (m *DiffRequest) String() string { return proto.CompactTextString(m) }
func (*DiffRequest) ProtoMessage() {}
func (*DiffRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{6} }
func (*DiffRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{6} }
func (m *DiffRequest) GetId() string {
if m != nil {
@ -182,14 +182,14 @@ func (m *DiffRequest) GetUrn() string {
return ""
}
func (m *DiffRequest) GetOlds() *google_protobuf.Struct {
func (m *DiffRequest) GetOlds() *google_protobuf1.Struct {
if m != nil {
return m.Olds
}
return nil
}
func (m *DiffRequest) GetNews() *google_protobuf.Struct {
func (m *DiffRequest) GetNews() *google_protobuf1.Struct {
if m != nil {
return m.News
}
@ -204,7 +204,7 @@ type DiffResponse struct {
func (m *DiffResponse) Reset() { *m = DiffResponse{} }
func (m *DiffResponse) String() string { return proto.CompactTextString(m) }
func (*DiffResponse) ProtoMessage() {}
func (*DiffResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{7} }
func (*DiffResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{7} }
func (m *DiffResponse) GetReplaces() []string {
if m != nil {
@ -221,14 +221,14 @@ func (m *DiffResponse) GetStables() []string {
}
type CreateRequest struct {
Urn string `protobuf:"bytes,1,opt,name=urn" json:"urn,omitempty"`
Properties *google_protobuf.Struct `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
Urn string `protobuf:"bytes,1,opt,name=urn" json:"urn,omitempty"`
Properties *google_protobuf1.Struct `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
}
func (m *CreateRequest) Reset() { *m = CreateRequest{} }
func (m *CreateRequest) String() string { return proto.CompactTextString(m) }
func (*CreateRequest) ProtoMessage() {}
func (*CreateRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{8} }
func (*CreateRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{8} }
func (m *CreateRequest) GetUrn() string {
if m != nil {
@ -237,7 +237,7 @@ func (m *CreateRequest) GetUrn() string {
return ""
}
func (m *CreateRequest) GetProperties() *google_protobuf.Struct {
func (m *CreateRequest) GetProperties() *google_protobuf1.Struct {
if m != nil {
return m.Properties
}
@ -245,14 +245,14 @@ func (m *CreateRequest) GetProperties() *google_protobuf.Struct {
}
type CreateResponse struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Properties *google_protobuf.Struct `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Properties *google_protobuf1.Struct `protobuf:"bytes,2,opt,name=properties" json:"properties,omitempty"`
}
func (m *CreateResponse) Reset() { *m = CreateResponse{} }
func (m *CreateResponse) String() string { return proto.CompactTextString(m) }
func (*CreateResponse) ProtoMessage() {}
func (*CreateResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{9} }
func (*CreateResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{9} }
func (m *CreateResponse) GetId() string {
if m != nil {
@ -261,7 +261,7 @@ func (m *CreateResponse) GetId() string {
return ""
}
func (m *CreateResponse) GetProperties() *google_protobuf.Struct {
func (m *CreateResponse) GetProperties() *google_protobuf1.Struct {
if m != nil {
return m.Properties
}
@ -269,16 +269,16 @@ func (m *CreateResponse) GetProperties() *google_protobuf.Struct {
}
type UpdateRequest struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Urn string `protobuf:"bytes,2,opt,name=urn" json:"urn,omitempty"`
Olds *google_protobuf.Struct `protobuf:"bytes,3,opt,name=olds" json:"olds,omitempty"`
News *google_protobuf.Struct `protobuf:"bytes,4,opt,name=news" json:"news,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Urn string `protobuf:"bytes,2,opt,name=urn" json:"urn,omitempty"`
Olds *google_protobuf1.Struct `protobuf:"bytes,3,opt,name=olds" json:"olds,omitempty"`
News *google_protobuf1.Struct `protobuf:"bytes,4,opt,name=news" json:"news,omitempty"`
}
func (m *UpdateRequest) Reset() { *m = UpdateRequest{} }
func (m *UpdateRequest) String() string { return proto.CompactTextString(m) }
func (*UpdateRequest) ProtoMessage() {}
func (*UpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{10} }
func (*UpdateRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{10} }
func (m *UpdateRequest) GetId() string {
if m != nil {
@ -294,14 +294,14 @@ func (m *UpdateRequest) GetUrn() string {
return ""
}
func (m *UpdateRequest) GetOlds() *google_protobuf.Struct {
func (m *UpdateRequest) GetOlds() *google_protobuf1.Struct {
if m != nil {
return m.Olds
}
return nil
}
func (m *UpdateRequest) GetNews() *google_protobuf.Struct {
func (m *UpdateRequest) GetNews() *google_protobuf1.Struct {
if m != nil {
return m.News
}
@ -309,15 +309,15 @@ func (m *UpdateRequest) GetNews() *google_protobuf.Struct {
}
type UpdateResponse struct {
Properties *google_protobuf.Struct `protobuf:"bytes,1,opt,name=properties" json:"properties,omitempty"`
Properties *google_protobuf1.Struct `protobuf:"bytes,1,opt,name=properties" json:"properties,omitempty"`
}
func (m *UpdateResponse) Reset() { *m = UpdateResponse{} }
func (m *UpdateResponse) String() string { return proto.CompactTextString(m) }
func (*UpdateResponse) ProtoMessage() {}
func (*UpdateResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{11} }
func (*UpdateResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{11} }
func (m *UpdateResponse) GetProperties() *google_protobuf.Struct {
func (m *UpdateResponse) GetProperties() *google_protobuf1.Struct {
if m != nil {
return m.Properties
}
@ -325,15 +325,15 @@ func (m *UpdateResponse) GetProperties() *google_protobuf.Struct {
}
type DeleteRequest struct {
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Urn string `protobuf:"bytes,2,opt,name=urn" json:"urn,omitempty"`
Properties *google_protobuf.Struct `protobuf:"bytes,3,opt,name=properties" json:"properties,omitempty"`
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
Urn string `protobuf:"bytes,2,opt,name=urn" json:"urn,omitempty"`
Properties *google_protobuf1.Struct `protobuf:"bytes,3,opt,name=properties" json:"properties,omitempty"`
}
func (m *DeleteRequest) Reset() { *m = DeleteRequest{} }
func (m *DeleteRequest) String() string { return proto.CompactTextString(m) }
func (*DeleteRequest) ProtoMessage() {}
func (*DeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{12} }
func (*DeleteRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{12} }
func (m *DeleteRequest) GetId() string {
if m != nil {
@ -349,7 +349,7 @@ func (m *DeleteRequest) GetUrn() string {
return ""
}
func (m *DeleteRequest) GetProperties() *google_protobuf.Struct {
func (m *DeleteRequest) GetProperties() *google_protobuf1.Struct {
if m != nil {
return m.Properties
}
@ -384,7 +384,7 @@ const _ = grpc.SupportPackageIsVersion4
type ResourceProviderClient interface {
// Configure configures the resource provider with "globals" that control its behavior.
Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
// Invoke dynamically executes a built-in function in the provider.
Invoke(ctx context.Context, in *InvokeRequest, opts ...grpc.CallOption) (*InvokeResponse, error)
// Check validates that the given property bag is valid for a resource of the given type.
@ -397,7 +397,9 @@ type ResourceProviderClient interface {
// Update updates an existing resource with new values.
Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
// Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.
Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
// GetPluginInfo returns generic information about this plugin, like its version.
GetPluginInfo(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*PluginInfo, error)
}
type resourceProviderClient struct {
@ -408,8 +410,8 @@ func NewResourceProviderClient(cc *grpc.ClientConn) ResourceProviderClient {
return &resourceProviderClient{cc}
}
func (c *resourceProviderClient) Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) {
out := new(google_protobuf1.Empty)
func (c *resourceProviderClient) Configure(ctx context.Context, in *ConfigureRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
out := new(google_protobuf.Empty)
err := grpc.Invoke(ctx, "/pulumirpc.ResourceProvider/Configure", in, out, c.cc, opts...)
if err != nil {
return nil, err
@ -462,8 +464,8 @@ func (c *resourceProviderClient) Update(ctx context.Context, in *UpdateRequest,
return out, nil
}
func (c *resourceProviderClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) {
out := new(google_protobuf1.Empty)
func (c *resourceProviderClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
out := new(google_protobuf.Empty)
err := grpc.Invoke(ctx, "/pulumirpc.ResourceProvider/Delete", in, out, c.cc, opts...)
if err != nil {
return nil, err
@ -471,11 +473,20 @@ func (c *resourceProviderClient) Delete(ctx context.Context, in *DeleteRequest,
return out, nil
}
func (c *resourceProviderClient) GetPluginInfo(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*PluginInfo, error) {
out := new(PluginInfo)
err := grpc.Invoke(ctx, "/pulumirpc.ResourceProvider/GetPluginInfo", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for ResourceProvider service
type ResourceProviderServer interface {
// Configure configures the resource provider with "globals" that control its behavior.
Configure(context.Context, *ConfigureRequest) (*google_protobuf1.Empty, error)
Configure(context.Context, *ConfigureRequest) (*google_protobuf.Empty, error)
// Invoke dynamically executes a built-in function in the provider.
Invoke(context.Context, *InvokeRequest) (*InvokeResponse, error)
// Check validates that the given property bag is valid for a resource of the given type.
@ -488,7 +499,9 @@ type ResourceProviderServer interface {
// Update updates an existing resource with new values.
Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
// Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.
Delete(context.Context, *DeleteRequest) (*google_protobuf1.Empty, error)
Delete(context.Context, *DeleteRequest) (*google_protobuf.Empty, error)
// GetPluginInfo returns generic information about this plugin, like its version.
GetPluginInfo(context.Context, *google_protobuf.Empty) (*PluginInfo, error)
}
func RegisterResourceProviderServer(s *grpc.Server, srv ResourceProviderServer) {
@ -621,6 +634,24 @@ func _ResourceProvider_Delete_Handler(srv interface{}, ctx context.Context, dec
return interceptor(ctx, in, info, handler)
}
func _ResourceProvider_GetPluginInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(google_protobuf.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ResourceProviderServer).GetPluginInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/pulumirpc.ResourceProvider/GetPluginInfo",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ResourceProviderServer).GetPluginInfo(ctx, req.(*google_protobuf.Empty))
}
return interceptor(ctx, in, info, handler)
}
var _ResourceProvider_serviceDesc = grpc.ServiceDesc{
ServiceName: "pulumirpc.ResourceProvider",
HandlerType: (*ResourceProviderServer)(nil),
@ -653,53 +684,58 @@ var _ResourceProvider_serviceDesc = grpc.ServiceDesc{
MethodName: "Delete",
Handler: _ResourceProvider_Delete_Handler,
},
{
MethodName: "GetPluginInfo",
Handler: _ResourceProvider_GetPluginInfo_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "provider.proto",
}
func init() { proto.RegisterFile("provider.proto", fileDescriptor3) }
func init() { proto.RegisterFile("provider.proto", fileDescriptor4) }
var fileDescriptor3 = []byte{
// 625 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xc4, 0x54, 0xdb, 0x6a, 0xdb, 0x4c,
0x10, 0x8e, 0x2c, 0xc7, 0xbf, 0x3d, 0x89, 0x8d, 0x59, 0x7e, 0x12, 0x55, 0xe9, 0x45, 0xd0, 0x55,
0x68, 0x40, 0x81, 0xe4, 0xa2, 0x07, 0x02, 0x81, 0x1c, 0x4a, 0x73, 0x53, 0x8a, 0x4a, 0x0b, 0xe9,
0x9d, 0x62, 0x8f, 0x5c, 0xd5, 0x8a, 0x56, 0xdd, 0x5d, 0xb9, 0xf8, 0x11, 0x4a, 0xdf, 0xa0, 0x4f,
0xd5, 0x47, 0x2a, 0xda, 0x83, 0xa2, 0xb5, 0xdb, 0x38, 0x0d, 0x94, 0xde, 0x69, 0x35, 0xdf, 0x7c,
0x33, 0xdf, 0x9c, 0x60, 0x50, 0x30, 0x3a, 0x4b, 0xc7, 0xc8, 0xc2, 0x82, 0x51, 0x41, 0x49, 0xaf,
0x28, 0xb3, 0xf2, 0x26, 0x65, 0xc5, 0xc8, 0xdf, 0x99, 0x50, 0x3a, 0xc9, 0xf0, 0x40, 0x1a, 0xae,
0xcb, 0xe4, 0x00, 0x6f, 0x0a, 0x31, 0x57, 0x38, 0xff, 0xf1, 0xa2, 0x91, 0x0b, 0x56, 0x8e, 0x84,
0xb2, 0x06, 0xdf, 0x1d, 0x18, 0x9e, 0xd1, 0x3c, 0x49, 0x27, 0x25, 0xc3, 0x08, 0x3f, 0x97, 0xc8,
0x05, 0x79, 0x05, 0xbd, 0x59, 0xcc, 0xd2, 0xf8, 0x3a, 0x43, 0xee, 0x39, 0xbb, 0xee, 0xde, 0xc6,
0xe1, 0x93, 0xb0, 0x0e, 0x17, 0x2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, 0x85, 0x45, 0x15, 0x2f, 0x58, 0x23, 0xc7, 0xb0, 0x2e, 0x77,
0x95, 0x2c, 0xed, 0xb5, 0x71, 0xf7, 0x96, 0x0d, 0xb5, 0xf7, 0x73, 0x68, 0x57, 0x9b, 0x41, 0xb6,
0x1a, 0x98, 0xc6, 0xd6, 0xfa, 0xdb, 0x4b, 0xff, 0x6b, 0xd7, 0x13, 0xe8, 0xa8, 0x91, 0xb5, 0x32,
0xb7, 0x36, 0xc4, 0xca, 0xdc, 0x9e, 0x6f, 0x45, 0xa0, 0x46, 0xc1, 0x22, 0xb0, 0x46, 0xd5, 0x22,
0xb0, 0xe7, 0x46, 0x4a, 0xef, 0xa8, 0x01, 0xb0, 0x08, 0xac, 0x99, 0xf8, 0x7d, 0xe5, 0xaf, 0x3b,
0xf2, 0xcf, 0xd1, 0xcf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x50, 0xfd, 0xf8, 0x7e, 0x07, 0x00,
0x00,
var fileDescriptor4 = []byte{
// 654 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xc4, 0x55, 0x4d, 0x6f, 0xd3, 0x4c,
0x10, 0xae, 0x93, 0x34, 0x6f, 0x32, 0x6d, 0xa2, 0x68, 0xf5, 0xd2, 0x1a, 0x97, 0x43, 0xe5, 0x53,
0x45, 0x25, 0x57, 0x6a, 0x0f, 0x7c, 0xa8, 0x52, 0x51, 0x3f, 0x80, 0x5e, 0x50, 0x65, 0x04, 0x52,
0xb9, 0xb9, 0xc9, 0x38, 0x98, 0xb8, 0x5e, 0xb3, 0xde, 0x0d, 0xca, 0x4f, 0x40, 0xdc, 0x38, 0xf2,
0x6b, 0x91, 0xf7, 0xc3, 0xf5, 0x36, 0x90, 0x94, 0x4a, 0x88, 0x5b, 0xc6, 0xf3, 0xcc, 0x33, 0xf3,
0xcc, 0xce, 0x4c, 0xa0, 0x9f, 0x33, 0x3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, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x57, 0xdb, 0x15, 0xce, 0x07, 0x00, 0x00,
}

View file

@ -7,8 +7,8 @@ package pulumirpc
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf1 "github.com/golang/protobuf/ptypes/empty"
import google_protobuf "github.com/golang/protobuf/ptypes/struct"
import google_protobuf "github.com/golang/protobuf/ptypes/empty"
import google_protobuf1 "github.com/golang/protobuf/ptypes/struct"
import (
context "golang.org/x/net/context"
@ -22,17 +22,17 @@ var _ = math.Inf
// RegisterResourceRequest contains information about a resource object that was newly allocated.
type RegisterResourceRequest struct {
Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
Parent string `protobuf:"bytes,3,opt,name=parent" json:"parent,omitempty"`
Custom bool `protobuf:"varint,4,opt,name=custom" json:"custom,omitempty"`
Object *google_protobuf.Struct `protobuf:"bytes,5,opt,name=object" json:"object,omitempty"`
Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
Parent string `protobuf:"bytes,3,opt,name=parent" json:"parent,omitempty"`
Custom bool `protobuf:"varint,4,opt,name=custom" json:"custom,omitempty"`
Object *google_protobuf1.Struct `protobuf:"bytes,5,opt,name=object" json:"object,omitempty"`
}
func (m *RegisterResourceRequest) Reset() { *m = RegisterResourceRequest{} }
func (m *RegisterResourceRequest) String() string { return proto.CompactTextString(m) }
func (*RegisterResourceRequest) ProtoMessage() {}
func (*RegisterResourceRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{0} }
func (*RegisterResourceRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{0} }
func (m *RegisterResourceRequest) GetType() string {
if m != nil {
@ -62,7 +62,7 @@ func (m *RegisterResourceRequest) GetCustom() bool {
return false
}
func (m *RegisterResourceRequest) GetObject() *google_protobuf.Struct {
func (m *RegisterResourceRequest) GetObject() *google_protobuf1.Struct {
if m != nil {
return m.Object
}
@ -72,17 +72,17 @@ func (m *RegisterResourceRequest) GetObject() *google_protobuf.Struct {
// RegisterResourceResponse is returned by the engine after a resource has finished being initialized. It includes the
// auto-assigned URN, the provider-assigned ID, and any other properties initialized by the engine.
type RegisterResourceResponse struct {
Urn string `protobuf:"bytes,1,opt,name=urn" json:"urn,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"`
Object *google_protobuf.Struct `protobuf:"bytes,3,opt,name=object" json:"object,omitempty"`
Stable bool `protobuf:"varint,4,opt,name=stable" json:"stable,omitempty"`
Stables []string `protobuf:"bytes,5,rep,name=stables" json:"stables,omitempty"`
Urn string `protobuf:"bytes,1,opt,name=urn" json:"urn,omitempty"`
Id string `protobuf:"bytes,2,opt,name=id" json:"id,omitempty"`
Object *google_protobuf1.Struct `protobuf:"bytes,3,opt,name=object" json:"object,omitempty"`
Stable bool `protobuf:"varint,4,opt,name=stable" json:"stable,omitempty"`
Stables []string `protobuf:"bytes,5,rep,name=stables" json:"stables,omitempty"`
}
func (m *RegisterResourceResponse) Reset() { *m = RegisterResourceResponse{} }
func (m *RegisterResourceResponse) String() string { return proto.CompactTextString(m) }
func (*RegisterResourceResponse) ProtoMessage() {}
func (*RegisterResourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{1} }
func (*RegisterResourceResponse) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{1} }
func (m *RegisterResourceResponse) GetUrn() string {
if m != nil {
@ -98,7 +98,7 @@ func (m *RegisterResourceResponse) GetId() string {
return ""
}
func (m *RegisterResourceResponse) GetObject() *google_protobuf.Struct {
func (m *RegisterResourceResponse) GetObject() *google_protobuf1.Struct {
if m != nil {
return m.Object
}
@ -121,14 +121,14 @@ func (m *RegisterResourceResponse) GetStables() []string {
// RegisterResourceOutputsRequest adds extra resource outputs created by the program after registration has occurred.
type RegisterResourceOutputsRequest struct {
Urn string `protobuf:"bytes,1,opt,name=urn" json:"urn,omitempty"`
Outputs *google_protobuf.Struct `protobuf:"bytes,2,opt,name=outputs" json:"outputs,omitempty"`
Urn string `protobuf:"bytes,1,opt,name=urn" json:"urn,omitempty"`
Outputs *google_protobuf1.Struct `protobuf:"bytes,2,opt,name=outputs" json:"outputs,omitempty"`
}
func (m *RegisterResourceOutputsRequest) Reset() { *m = RegisterResourceOutputsRequest{} }
func (m *RegisterResourceOutputsRequest) String() string { return proto.CompactTextString(m) }
func (*RegisterResourceOutputsRequest) ProtoMessage() {}
func (*RegisterResourceOutputsRequest) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{2} }
func (*RegisterResourceOutputsRequest) Descriptor() ([]byte, []int) { return fileDescriptor5, []int{2} }
func (m *RegisterResourceOutputsRequest) GetUrn() string {
if m != nil {
@ -137,7 +137,7 @@ func (m *RegisterResourceOutputsRequest) GetUrn() string {
return ""
}
func (m *RegisterResourceOutputsRequest) GetOutputs() *google_protobuf.Struct {
func (m *RegisterResourceOutputsRequest) GetOutputs() *google_protobuf1.Struct {
if m != nil {
return m.Outputs
}
@ -163,7 +163,7 @@ const _ = grpc.SupportPackageIsVersion4
type ResourceMonitorClient interface {
Invoke(ctx context.Context, in *InvokeRequest, opts ...grpc.CallOption) (*InvokeResponse, error)
RegisterResource(ctx context.Context, in *RegisterResourceRequest, opts ...grpc.CallOption) (*RegisterResourceResponse, error)
RegisterResourceOutputs(ctx context.Context, in *RegisterResourceOutputsRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error)
RegisterResourceOutputs(ctx context.Context, in *RegisterResourceOutputsRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error)
}
type resourceMonitorClient struct {
@ -192,8 +192,8 @@ func (c *resourceMonitorClient) RegisterResource(ctx context.Context, in *Regist
return out, nil
}
func (c *resourceMonitorClient) RegisterResourceOutputs(ctx context.Context, in *RegisterResourceOutputsRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) {
out := new(google_protobuf1.Empty)
func (c *resourceMonitorClient) RegisterResourceOutputs(ctx context.Context, in *RegisterResourceOutputsRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) {
out := new(google_protobuf.Empty)
err := grpc.Invoke(ctx, "/pulumirpc.ResourceMonitor/RegisterResourceOutputs", in, out, c.cc, opts...)
if err != nil {
return nil, err
@ -206,7 +206,7 @@ func (c *resourceMonitorClient) RegisterResourceOutputs(ctx context.Context, in
type ResourceMonitorServer interface {
Invoke(context.Context, *InvokeRequest) (*InvokeResponse, error)
RegisterResource(context.Context, *RegisterResourceRequest) (*RegisterResourceResponse, error)
RegisterResourceOutputs(context.Context, *RegisterResourceOutputsRequest) (*google_protobuf1.Empty, error)
RegisterResourceOutputs(context.Context, *RegisterResourceOutputsRequest) (*google_protobuf.Empty, error)
}
func RegisterResourceMonitorServer(s *grpc.Server, srv ResourceMonitorServer) {
@ -288,9 +288,9 @@ var _ResourceMonitor_serviceDesc = grpc.ServiceDesc{
Metadata: "resource.proto",
}
func init() { proto.RegisterFile("resource.proto", fileDescriptor4) }
func init() { proto.RegisterFile("resource.proto", fileDescriptor5) }
var fileDescriptor4 = []byte{
var fileDescriptor5 = []byte{
// 374 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x92, 0xcf, 0x4a, 0xf3, 0x40,
0x14, 0xc5, 0x9b, 0xa4, 0x4d, 0xbf, 0xce, 0x07, 0xb5, 0xcc, 0xa2, 0x1d, 0xa3, 0x48, 0x88, 0x9b,

View file

@ -2,12 +2,17 @@
syntax = "proto3";
import "plugin.proto";
import "google/protobuf/empty.proto";
package pulumirpc;
// LanguageRuntime is the interface that the planning monitor uses to drive execution of an interpreter responsible
// for confguring and creating resource objects.
service LanguageRuntime {
rpc Run(RunRequest) returns (RunResponse) {}
// GetPluginInfo returns generic information about this plugin, like its version.
rpc GetPluginInfo(google.protobuf.Empty) returns (PluginInfo) {}
}
// RunRequest asks the interpreter to execute a program.

View file

@ -6,8 +6,21 @@
'use strict';
var grpc = require('grpc');
var analyzer_pb = require('./analyzer_pb.js');
var plugin_pb = require('./plugin_pb.js');
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js');
function serialize_google_protobuf_Empty(arg) {
if (!(arg instanceof google_protobuf_empty_pb.Empty)) {
throw new Error('Expected argument of type google.protobuf.Empty');
}
return new Buffer(arg.serializeBinary());
}
function deserialize_google_protobuf_Empty(buffer_arg) {
return google_protobuf_empty_pb.Empty.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_pulumirpc_AnalyzeRequest(arg) {
if (!(arg instanceof analyzer_pb.AnalyzeRequest)) {
throw new Error('Expected argument of type pulumirpc.AnalyzeRequest');
@ -30,6 +43,17 @@ function deserialize_pulumirpc_AnalyzeResponse(buffer_arg) {
return analyzer_pb.AnalyzeResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_pulumirpc_PluginInfo(arg) {
if (!(arg instanceof plugin_pb.PluginInfo)) {
throw new Error('Expected argument of type pulumirpc.PluginInfo');
}
return new Buffer(arg.serializeBinary());
}
function deserialize_pulumirpc_PluginInfo(buffer_arg) {
return plugin_pb.PluginInfo.deserializeBinary(new Uint8Array(buffer_arg));
}
// Analyzer is a pluggable service that checks entire projects/stacks/snapshots, and/or individual resources,
// for arbitrary issues. These might be style, policy, correctness, security, or performance related.
@ -46,6 +70,18 @@ var AnalyzerService = exports.AnalyzerService = {
responseSerialize: serialize_pulumirpc_AnalyzeResponse,
responseDeserialize: deserialize_pulumirpc_AnalyzeResponse,
},
// GetPluginInfo returns generic information about this plugin, like its version.
getPluginInfo: {
path: '/pulumirpc.Analyzer/GetPluginInfo',
requestStream: false,
responseStream: false,
requestType: google_protobuf_empty_pb.Empty,
responseType: plugin_pb.PluginInfo,
requestSerialize: serialize_google_protobuf_Empty,
requestDeserialize: deserialize_google_protobuf_Empty,
responseSerialize: serialize_pulumirpc_PluginInfo,
responseDeserialize: deserialize_pulumirpc_PluginInfo,
},
};
exports.AnalyzerClient = grpc.makeGenericClientConstructor(AnalyzerService);

View file

@ -11,6 +11,8 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var plugin_pb = require('./plugin_pb.js');
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js');
goog.exportSymbol('proto.pulumirpc.AnalyzeFailure', null, global);
goog.exportSymbol('proto.pulumirpc.AnalyzeRequest', null, global);

View file

@ -6,6 +6,30 @@
'use strict';
var grpc = require('grpc');
var language_pb = require('./language_pb.js');
var plugin_pb = require('./plugin_pb.js');
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
function serialize_google_protobuf_Empty(arg) {
if (!(arg instanceof google_protobuf_empty_pb.Empty)) {
throw new Error('Expected argument of type google.protobuf.Empty');
}
return new Buffer(arg.serializeBinary());
}
function deserialize_google_protobuf_Empty(buffer_arg) {
return google_protobuf_empty_pb.Empty.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_pulumirpc_PluginInfo(arg) {
if (!(arg instanceof plugin_pb.PluginInfo)) {
throw new Error('Expected argument of type pulumirpc.PluginInfo');
}
return new Buffer(arg.serializeBinary());
}
function deserialize_pulumirpc_PluginInfo(buffer_arg) {
return plugin_pb.PluginInfo.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_pulumirpc_RunRequest(arg) {
if (!(arg instanceof language_pb.RunRequest)) {
@ -44,6 +68,18 @@ var LanguageRuntimeService = exports.LanguageRuntimeService = {
responseSerialize: serialize_pulumirpc_RunResponse,
responseDeserialize: deserialize_pulumirpc_RunResponse,
},
// GetPluginInfo returns generic information about this plugin, like its version.
getPluginInfo: {
path: '/pulumirpc.LanguageRuntime/GetPluginInfo',
requestStream: false,
responseStream: false,
requestType: google_protobuf_empty_pb.Empty,
responseType: plugin_pb.PluginInfo,
requestSerialize: serialize_google_protobuf_Empty,
requestDeserialize: deserialize_google_protobuf_Empty,
responseSerialize: serialize_pulumirpc_PluginInfo,
responseDeserialize: deserialize_pulumirpc_PluginInfo,
},
};
exports.LanguageRuntimeClient = grpc.makeGenericClientConstructor(LanguageRuntimeService);

View file

@ -11,6 +11,8 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var plugin_pb = require('./plugin_pb.js');
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
goog.exportSymbol('proto.pulumirpc.RunRequest', null, global);
goog.exportSymbol('proto.pulumirpc.RunResponse', null, global);

View file

@ -0,0 +1,157 @@
/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
goog.exportSymbol('proto.pulumirpc.PluginInfo', null, global);
/**
* Generated by JsPbCodeGenerator.
* @param {Array=} opt_data Optional initial data array, typically from a
* server response, or constructed directly in Javascript. The array is used
* in place and becomes part of the constructed object. It is not cloned.
* If no data is provided, the constructed object will be empty, but still
* valid.
* @extends {jspb.Message}
* @constructor
*/
proto.pulumirpc.PluginInfo = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.pulumirpc.PluginInfo, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.pulumirpc.PluginInfo.displayName = 'proto.pulumirpc.PluginInfo';
}
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto suitable for use in Soy templates.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS.
* @param {boolean=} opt_includeInstance Whether to include the JSPB instance
* for transitional soy proto support: http://goto/soy-param-migration
* @return {!Object}
*/
proto.pulumirpc.PluginInfo.prototype.toObject = function(opt_includeInstance) {
return proto.pulumirpc.PluginInfo.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Whether to include the JSPB
* instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.PluginInfo} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.PluginInfo.toObject = function(includeInstance, msg) {
var f, obj = {
version: jspb.Message.getFieldWithDefault(msg, 1, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.pulumirpc.PluginInfo}
*/
proto.pulumirpc.PluginInfo.deserializeBinary = function(bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.pulumirpc.PluginInfo;
return proto.pulumirpc.PluginInfo.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.pulumirpc.PluginInfo} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.pulumirpc.PluginInfo}
*/
proto.pulumirpc.PluginInfo.deserializeBinaryFromReader = function(msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {string} */ (reader.readString());
msg.setVersion(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.pulumirpc.PluginInfo.prototype.serializeBinary = function() {
var writer = new jspb.BinaryWriter();
proto.pulumirpc.PluginInfo.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.PluginInfo} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.PluginInfo.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
f = message.getVersion();
if (f.length > 0) {
writer.writeString(
1,
f
);
}
};
/**
* optional string version = 1;
* @return {string}
*/
proto.pulumirpc.PluginInfo.prototype.getVersion = function() {
return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
};
/** @param {string} value */
proto.pulumirpc.PluginInfo.prototype.setVersion = function(value) {
jspb.Message.setField(this, 1, value);
};
goog.object.extend(exports, proto.pulumirpc);

View file

@ -6,6 +6,7 @@
'use strict';
var grpc = require('grpc');
var provider_pb = require('./provider_pb.js');
var plugin_pb = require('./plugin_pb.js');
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js');
@ -130,6 +131,17 @@ function deserialize_pulumirpc_InvokeResponse(buffer_arg) {
return provider_pb.InvokeResponse.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_pulumirpc_PluginInfo(arg) {
if (!(arg instanceof plugin_pb.PluginInfo)) {
throw new Error('Expected argument of type pulumirpc.PluginInfo');
}
return new Buffer(arg.serializeBinary());
}
function deserialize_pulumirpc_PluginInfo(buffer_arg) {
return plugin_pb.PluginInfo.deserializeBinary(new Uint8Array(buffer_arg));
}
function serialize_pulumirpc_UpdateRequest(arg) {
if (!(arg instanceof provider_pb.UpdateRequest)) {
throw new Error('Expected argument of type pulumirpc.UpdateRequest');
@ -241,6 +253,18 @@ var ResourceProviderService = exports.ResourceProviderService = {
responseSerialize: serialize_google_protobuf_Empty,
responseDeserialize: deserialize_google_protobuf_Empty,
},
// GetPluginInfo returns generic information about this plugin, like its version.
getPluginInfo: {
path: '/pulumirpc.ResourceProvider/GetPluginInfo',
requestStream: false,
responseStream: false,
requestType: google_protobuf_empty_pb.Empty,
responseType: plugin_pb.PluginInfo,
requestSerialize: serialize_google_protobuf_Empty,
requestDeserialize: deserialize_google_protobuf_Empty,
responseSerialize: serialize_pulumirpc_PluginInfo,
responseDeserialize: deserialize_pulumirpc_PluginInfo,
},
};
exports.ResourceProviderClient = grpc.makeGenericClientConstructor(ResourceProviderService);

View file

@ -11,6 +11,7 @@ var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var plugin_pb = require('./plugin_pb.js');
var google_protobuf_empty_pb = require('google-protobuf/google/protobuf/empty_pb.js');
var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js');
goog.exportSymbol('proto.pulumirpc.CheckFailure', null, global);

10
sdk/proto/plugin.proto Normal file
View file

@ -0,0 +1,10 @@
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
syntax = "proto3";
package pulumirpc;
// PluginInfo is meta-information about a plugin that is used by the system.
message PluginInfo {
string version = 1; // the semver for this plugin.
}

View file

@ -2,6 +2,7 @@
syntax = "proto3";
import "plugin.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/struct.proto";
@ -25,6 +26,8 @@ service ResourceProvider {
rpc Update(UpdateRequest) returns (UpdateResponse) {}
// Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.
rpc Delete(DeleteRequest) returns (google.protobuf.Empty) {}
// GetPluginInfo returns generic information about this plugin, like its version.
rpc GetPluginInfo(google.protobuf.Empty) returns (PluginInfo) {}
}
message ConfigureRequest {
@ -94,4 +97,3 @@ message DeleteRequest {
string urn = 2; // the Pulumi URN for this resource.
google.protobuf.Struct properties = 3; // the current properties on the resource.
}