Merge pull request #415 from pulumi/340_components

Implement components
This commit is contained in:
Joe Duffy 2017-10-15 05:54:43 -07:00 committed by GitHub
commit 3169dae6e0
28 changed files with 578 additions and 185 deletions

View file

@ -2,7 +2,7 @@
import * as pulumi from "pulumi";
class Add extends pulumi.Resource {
class Add extends pulumi.CustomResource {
public readonly sum: pulumi.Computed<number>;
constructor(name: string, left: pulumi.ComputedValue<number>, right: pulumi.ComputedValue<number>) {
@ -10,7 +10,7 @@ class Add extends pulumi.Resource {
}
}
class Mul extends pulumi.Resource {
class Mul extends pulumi.CustomResource {
public readonly product: pulumi.Computed<number>;
constructor(name: string, left: pulumi.ComputedValue<number>, right: pulumi.ComputedValue<number>) {
@ -18,7 +18,7 @@ class Mul extends pulumi.Resource {
}
}
class Sub extends pulumi.Resource {
class Sub extends pulumi.CustomResource {
public readonly difference: pulumi.Computed<number>;
constructor(name: string, left: pulumi.ComputedValue<number>, right: pulumi.ComputedValue<number>) {
@ -26,7 +26,7 @@ class Sub extends pulumi.Resource {
}
}
class Div extends pulumi.Resource {
class Div extends pulumi.CustomResource {
public readonly quotient: pulumi.Computed<number>;
public readonly remainder: pulumi.Computed<number>;

View file

@ -321,6 +321,17 @@ func printResourceProperties(b *bytes.Buffer, urn resource.URN, old *resource.St
b.WriteString(fmt.Sprintf("%s[urn=%s]\n", indent, urn))
}
// If this resource has children, also print a summary of those out too.
var children []resource.URN
if new != nil {
children = new.Children
} else {
children = old.Children
}
for _, child := range children {
b.WriteString(fmt.Sprintf("%s=> %s\n", indent, child))
}
if !summary {
// Print all of the properties associated with this resource.
if old == nil && new != nil {

View file

@ -176,16 +176,10 @@ func (iter *PlanIterator) Next() (Step, error) {
// aren't any steps to perform (in other words, the actual known state is equivalent to the goal state). It is
// possible to return multiple steps if the current resource state necessitates it (e.g., replacements).
func (iter *PlanIterator) nextResourceSteps(goal SourceGoal) ([]Step, error) {
// Fetch the provider for this resource type.
res := goal.Resource()
prov, err := iter.Provider(res.Type)
if err != nil {
return nil, err
}
var invalid bool // will be set to true if this object fails validation.
// Use the resource goal state name to produce a globally unique URN.
res := goal.Resource()
urn := resource.NewURN(iter.p.Target().Name, iter.p.source.Pkg(), res.Type, res.Name)
if iter.urns[urn] {
invalid = true
@ -196,7 +190,7 @@ func (iter *PlanIterator) nextResourceSteps(goal SourceGoal) ([]Step, error) {
// Produce a new state object that we'll build up as operations are performed. It begins with empty outputs.
// Ultimately, this is what will get serialized into the checkpoint file.
new := resource.NewState(res.Type, urn, "", res.Properties, nil, nil)
new := resource.NewState(res.Type, urn, res.Custom, "", res.Properties, nil, nil, res.Children)
// If there is an old resource, apply its default properties before going any further.
old, hasold := iter.p.Olds()[urn]
@ -209,13 +203,27 @@ func (iter *PlanIterator) nextResourceSteps(goal SourceGoal) ([]Step, error) {
}
}
// Ensure the provider is okay with this resource and see if it has any new defaults to contribute.
// Fetch the provider for this resource type, assuming it isn't just a logical one.
var prov plugin.Provider
var err error
if res.Custom {
if prov, err = iter.Provider(res.Type); err != nil {
return nil, err
}
}
inputs := new.AllInputs()
defaults, failures, err := prov.Check(urn, inputs)
if err != nil {
return nil, err
} else if iter.issueCheckErrors(new, urn, failures) {
invalid = true
// Ensure the provider is okay with this resource and see if it has any new defaults to contribute.
var defaults resource.PropertyMap
if prov != nil {
var failures []plugin.CheckFailure
defaults, failures, err = prov.Check(urn, inputs)
if err != nil {
return nil, err
} else if iter.issueCheckErrors(new, urn, failures) {
invalid = true
}
}
// If there are any new defaults, apply them, and use the combined view for various operations below.
@ -226,13 +234,15 @@ func (iter *PlanIterator) nextResourceSteps(goal SourceGoal) ([]Step, error) {
// Next, give each analyzer -- if any -- a chance to inspect the resource too.
for _, a := range iter.p.analyzers {
analyzer, err := iter.p.ctx.Host.Analyzer(a)
var analyzer plugin.Analyzer
analyzer, err = iter.p.ctx.Host.Analyzer(a)
if err != nil {
return nil, err
} else if analyzer == nil {
return nil, goerr.Errorf("analyzer '%v' could not be loaded from your $PATH", a)
}
failures, err := analyzer.Analyze(new.Type, inputs)
var failures []plugin.AnalyzeFailure
failures, err = analyzer.Analyze(new.Type, inputs)
if err != nil {
return nil, err
}
@ -266,31 +276,42 @@ func (iter *PlanIterator) nextResourceSteps(goal SourceGoal) ([]Step, error) {
oldinputs := old.AllInputs()
if !oldinputs.DeepEquals(inputs) {
// The properties changed; we need to figure out whether to do an update or replacement.
diff, err := prov.Diff(urn, old.ID, oldinputs, inputs)
if err != nil {
return nil, err
var diff plugin.DiffResult
if prov != nil {
if diff, err = prov.Diff(urn, old.ID, oldinputs, inputs); err != nil {
return nil, err
}
}
// This is either an update or a replacement; check for the latter first, and handle it specially.
if diff.Replace() {
iter.replaces[urn] = true
// If we are going to perform a replacement, we need to recompute the default values. The above logic
// had assumed that we were going to carry them over from the old resource, which is no longer true.
defaults, failures, err := prov.Check(urn, new.Inputs)
if err != nil {
return nil, err
} else if iter.issueCheckErrors(new, urn, failures) {
return nil, goerr.New("One or more resource validation errors occurred; refusing to proceed")
if prov != nil {
var failures []plugin.CheckFailure
defaults, failures, err = prov.Check(urn, new.Inputs)
if err != nil {
return nil, err
} else if iter.issueCheckErrors(new, urn, failures) {
return nil, goerr.New("One or more resource validation errors occurred; refusing to proceed")
}
}
new.Defaults = defaults
if glog.V(7) {
glog.V(7).Infof("Planner decided to replace '%v' (oldprops=%v inputs=%v)",
urn, oldinputs, new.AllInputs())
}
return []Step{
NewCreateReplacementStep(iter, goal, old, new, diff.ReplaceKeys),
NewReplaceStep(iter, old, new, diff.ReplaceKeys),
}, nil
}
// If we fell through, it's an update.
iter.updates[urn] = true
if glog.V(7) {
glog.V(7).Infof("Planner decided to update '%v' (oldprops=%v inputs=%v",

View file

@ -158,15 +158,16 @@ func TestBasicCRUDPlan(t *testing.T) {
urnD := resource.NewURN(ns, pkgname, typD, namD)
// Create the old resources snapshot.
oldResB := resource.NewState(typB, urnB, resource.ID("b-b-b"),
oldResB := resource.NewState(typB, urnB, true, resource.ID("b-b-b"),
resource.PropertyMap{
"bf1": resource.NewStringProperty("b-value"),
"bf2": resource.NewNumberProperty(42),
},
make(resource.PropertyMap),
nil,
nil,
)
oldResC := resource.NewState(typC, urnC, resource.ID("c-c-c"),
oldResC := resource.NewState(typC, urnC, true, resource.ID("c-c-c"),
resource.PropertyMap{
"cf1": resource.NewStringProperty("c-value"),
"cf2": resource.NewNumberProperty(83),
@ -176,36 +177,38 @@ func TestBasicCRUDPlan(t *testing.T) {
"outta1": resource.NewStringProperty("populated during skip/step"),
"outta234": resource.NewNumberProperty(99881122),
},
nil,
)
oldResD := resource.NewState(typD, urnD, resource.ID("d-d-d"),
oldResD := resource.NewState(typD, urnD, true, resource.ID("d-d-d"),
resource.PropertyMap{
"df1": resource.NewStringProperty("d-value"),
"df2": resource.NewNumberProperty(167),
},
make(resource.PropertyMap),
nil,
nil,
)
oldsnap := NewSnapshot(ns, time.Now(), []*resource.State{oldResB, oldResC, oldResD}, nil)
// Create the new resource objects a priori.
// - A is created:
newResA := resource.NewGoal(typA, namA, resource.PropertyMap{
newResA := resource.NewGoal(typA, namA, true, resource.PropertyMap{
"af1": resource.NewStringProperty("a-value"),
"af2": resource.NewNumberProperty(42),
})
}, nil)
newStateA := &testSourceGoal{Goal: newResA}
// - B is updated:
newResB := resource.NewGoal(typB, namB, resource.PropertyMap{
newResB := resource.NewGoal(typB, namB, true, resource.PropertyMap{
"bf1": resource.NewStringProperty("b-value"),
// delete the bf2 field, and add bf3.
"bf3": resource.NewBoolProperty(true),
})
}, nil)
newStateB := &testSourceGoal{Goal: newResB}
// - C has no changes:
newResC := resource.NewGoal(typC, namC, resource.PropertyMap{
newResC := resource.NewGoal(typC, namC, true, resource.PropertyMap{
"cf1": resource.NewStringProperty("c-value"),
"cf2": resource.NewNumberProperty(83),
})
}, nil)
newStateC := &testSourceGoal{Goal: newResC}
// - No D; it is deleted.

View file

@ -266,16 +266,24 @@ func (rm *resmon) NewResource(ctx context.Context,
if err != nil {
return nil, err
}
var children []resource.URN
for _, child := range req.GetChildren() {
children = append(children, resource.URN(child))
}
goal := &evalSourceGoal{
goal: resource.NewGoal(
tokens.Type(req.GetType()),
tokens.QName(req.GetName()),
req.GetCustom(),
props,
children,
),
done: make(chan *evalState),
}
glog.V(5).Infof("ResourceMonitor.NewResource received: t=%v, name=%v, #props=%v",
goal.goal.Type, goal.goal.Name, len(goal.goal.Properties))
glog.V(5).Infof("ResourceMonitor.NewResource received: t=%v, name=%v, custom=%v, #props=%v, #children=%v",
goal.goal.Type, goal.goal.Name, goal.goal.Custom, len(goal.goal.Properties), len(goal.goal.Children))
rm.reschan <- goal
// Now block waiting for the operation to finish.

View file

@ -43,7 +43,7 @@ func NewSameStep(iter *PlanIterator, goal SourceGoal, old *resource.State, new *
contract.Assert(goal != nil)
contract.Assert(old != nil)
contract.Assert(old.URN != "")
contract.Assert(old.ID != "")
contract.Assert(old.ID != "" || !old.Custom)
contract.Assert(new != nil)
contract.Assert(new.URN != "")
contract.Assert(new.ID == "")
@ -107,7 +107,7 @@ func NewCreateReplacementStep(iter *PlanIterator, goal SourceGoal,
contract.Assert(goal != nil)
contract.Assert(old != nil)
contract.Assert(old.URN != "")
contract.Assert(old.ID != "")
contract.Assert(old.ID != "" || !old.Custom)
contract.Assert(new != nil)
contract.Assert(new.URN != "")
contract.Assert(new.ID == "")
@ -138,20 +138,24 @@ func (s *CreateStep) Keys() []resource.PropertyKey { return s.keys }
func (s *CreateStep) Logical() bool { return !s.replacing }
func (s *CreateStep) Apply() (resource.Status, error) {
// Invoke the Create RPC function for this provider:
prov, err := getProvider(s)
if err != nil {
return resource.StatusOK, err
}
id, outs, rst, err := prov.Create(s.URN(), s.new.AllInputs())
if err != nil {
return rst, err
}
contract.Assert(id != "")
if s.new.Custom {
// Invoke the Create RPC function for this provider:
prov, err := getProvider(s)
if err != nil {
return resource.StatusOK, err
}
id, outs, rst, err := prov.Create(s.URN(), s.new.AllInputs())
if err != nil {
return rst, err
}
contract.Assert(id != "")
// Copy any of the default and output properties on the live object state.
s.new.ID = id
s.new.Outputs = outs
// Copy any of the default and output properties on the live object state.
s.new.ID = id
s.new.Outputs = outs
}
// And finish the overall operation.
s.goal.Done(s.new, false, nil)
s.iter.AppendStateSnapshot(s.new)
return resource.StatusOK, nil
@ -175,7 +179,7 @@ var _ MutatingStep = (*DeleteStep)(nil)
func NewDeleteStep(iter *PlanIterator, old *resource.State, replacing bool) Step {
contract.Assert(old != nil)
contract.Assert(old.URN != "")
contract.Assert(old.ID != "")
contract.Assert(old.ID != "" || !old.Custom)
return &DeleteStep{
iter: iter,
old: old,
@ -198,13 +202,15 @@ func (s *DeleteStep) New() *resource.State { return nil }
func (s *DeleteStep) Logical() bool { return !s.replacing }
func (s *DeleteStep) Apply() (resource.Status, error) {
// Invoke the Delete RPC function for this provider:
prov, err := getProvider(s)
if err != nil {
return resource.StatusOK, err
}
if rst, err := prov.Delete(s.URN(), s.old.ID, s.old.All()); err != nil {
return rst, err
if s.old.Custom {
// Invoke the Delete RPC function for this provider:
prov, err := getProvider(s)
if err != nil {
return resource.StatusOK, err
}
if rst, err := prov.Delete(s.URN(), s.old.ID, s.old.All()); err != nil {
return rst, err
}
}
s.iter.MarkStateSnapshot(s.old)
return resource.StatusOK, nil
@ -230,7 +236,7 @@ func NewUpdateStep(iter *PlanIterator, goal SourceGoal, old *resource.State,
new *resource.State, stables []resource.PropertyKey) Step {
contract.Assert(old != nil)
contract.Assert(old.URN != "")
contract.Assert(old.ID != "")
contract.Assert(old.ID != "" || !old.Custom)
contract.Assert(new != nil)
contract.Assert(new.URN != "")
contract.Assert(new.ID == "")
@ -254,19 +260,23 @@ func (s *UpdateStep) New() *resource.State { return s.new }
func (s *UpdateStep) Logical() bool { return true }
func (s *UpdateStep) Apply() (resource.Status, error) {
// Invoke the Update RPC function for this provider:
prov, err := getProvider(s)
if err != nil {
return resource.StatusOK, err
}
outs, rst, upderr := prov.Update(s.URN(), s.old.ID, s.old.AllInputs(), s.new.AllInputs())
if upderr != nil {
return rst, upderr
if s.new.Custom {
// Invoke the Update RPC function for this provider:
prov, err := getProvider(s)
if err != nil {
return resource.StatusOK, err
}
outs, rst, upderr := prov.Update(s.URN(), s.old.ID, s.old.AllInputs(), s.new.AllInputs())
if upderr != nil {
return rst, upderr
}
// Now copy any output state back in case the update triggered cascading updates to other properties.
s.new.ID = s.old.ID
s.new.Outputs = outs
}
// Now copy any output state back in case the update triggered cascading updates to other properties.
s.new.ID = s.old.ID
s.new.Outputs = outs
// Finally, mark this operation as complete.
s.goal.Done(s.new, false, s.stables)
s.iter.MarkStateSnapshot(s.old)
s.iter.AppendStateSnapshot(s.new)
@ -293,7 +303,7 @@ type ReplaceStep struct {
func NewReplaceStep(iter *PlanIterator, old *resource.State, new *resource.State, keys []resource.PropertyKey) Step {
contract.Assert(old != nil)
contract.Assert(old.URN != "")
contract.Assert(old.ID != "")
contract.Assert(old.ID != "" || !old.Custom)
contract.Assert(new != nil)
contract.Assert(new.URN != "")
contract.Assert(new.ID == "")

View file

@ -52,9 +52,15 @@ func DeserializeCheckpoint(chkpoint *Checkpoint) (*deploy.Target, *deploy.Snapsh
defaults := DeserializeProperties(res.Defaults)
outputs := DeserializeProperties(res.Outputs)
var children []resource.URN
for _, child := range res.Children {
children = append(children, resource.URN(child))
}
// And now just produce a resource object using the information available.
state := resource.NewState(res.Type, kvp.Key, res.ID, inputs, defaults, outputs)
resources = append(resources, state)
resources = append(resources,
resource.NewState(res.Type, kvp.Key, res.Custom, res.ID,
inputs, defaults, outputs, children))
}
}

View file

@ -6,6 +6,7 @@ import (
"bytes"
"encoding/json"
"reflect"
"sort"
"time"
"github.com/pulumi/pulumi/pkg/resource"
@ -25,11 +26,13 @@ type Deployment struct {
// Resource is a serializable vertex within a LumiGL graph, specifically for resource snapshots.
type Resource struct {
ID resource.ID `json:"id"` // the provider ID for this resource, if any.
Custom bool `json:"custom"` // true if a custom resource managed by a plugin.
ID resource.ID `json:"id,omitempty"` // the provider ID for this resource, if any.
Type tokens.Type `json:"type"` // this resource's full type token.
Inputs map[string]interface{} `json:"inputs,omitempty"` // the input properties from the program.
Defaults map[string]interface{} `json:"defaults,omitempty"` // the default property values from the provider.
Outputs map[string]interface{} `json:"outputs,omitempty"` // the output properties from the resource provider.
Children []string `json:"children,omitempty"` // an optional list of child resources.
}
// SerializeDeployment serializes an entire snapshot as a deploy record.
@ -71,9 +74,18 @@ func SerializeResource(res *resource.State) *Resource {
outputs = SerializeProperties(outp)
}
// Sort the list of children.
var children []string
for _, child := range res.Children {
children = append(children, string(child))
}
sort.Strings(children)
return &Resource{
Custom: res.Custom,
ID: res.ID,
Type: res.Type,
Children: children,
Inputs: inputs,
Defaults: defaults,
Outputs: outputs,

View file

@ -21,6 +21,7 @@ func TestDeploymentSerialization(t *testing.T) {
tokens.Type("Test"),
tokens.QName("resource-x"),
),
true,
resource.ID("test-resource-x"),
resource.NewPropertyMapFromMap(map[string]interface{}{
"in-nil": nil,
@ -52,6 +53,7 @@ func TestDeploymentSerialization(t *testing.T) {
},
"out-empty-map": map[string]interface{}{},
}),
nil,
)
dep := SerializeResource(res)

View file

@ -10,10 +10,18 @@ import (
type Goal struct {
Type tokens.Type // the type of resource.
Name tokens.QName // the name for the resource's URN.
Custom bool // true if this resource is custom, managed by a plugin.
Properties PropertyMap // the resource's property state.
Children []URN // an optional list of child resource URNs.
}
// NewGoal allocates a new resource goal state.
func NewGoal(t tokens.Type, name tokens.QName, props PropertyMap) *Goal {
return &Goal{Type: t, Name: name, Properties: props}
func NewGoal(t tokens.Type, name tokens.QName, custom bool, props PropertyMap, children []URN) *Goal {
return &Goal{
Type: t,
Name: name,
Custom: custom,
Properties: props,
Children: children,
}
}

View file

@ -13,23 +13,29 @@ import (
type State struct {
Type tokens.Type // the resource's type.
URN URN // the resource's object urn, a human-friendly, unique name for the resource.
ID ID // the resource's unique ID, assigned by the resource provider (or blank if uncreated).
Custom bool // true if the resource is custom, managed by a plugin.
ID ID // the resource's unique ID, assigned by the resource provider (or blank if none/uncreated).
Inputs PropertyMap // the resource's input properties (as specified by the program).
Defaults PropertyMap // the resource's default property values (if any, given by the provider).
Outputs PropertyMap // the resource's complete output state (as returned by the resource provider).
Children []URN // an optional list of children belonging to this parent resource.
}
// NewState creates a new resource value from existing resource state information.
func NewState(t tokens.Type, urn URN, id ID, inputs PropertyMap, defaults PropertyMap, outputs PropertyMap) *State {
func NewState(t tokens.Type, urn URN, custom bool, id ID,
inputs PropertyMap, defaults PropertyMap, outputs PropertyMap, children []URN) *State {
contract.Assert(t != "")
contract.Assert(custom || id == "")
contract.Assert(inputs != nil)
return &State{
Type: t,
URN: urn,
Custom: custom,
ID: id,
Inputs: inputs,
Defaults: defaults,
Outputs: outputs,
Children: children,
}
}

View file

@ -9,20 +9,112 @@ export type URN = string; // an automatically generated logical URN, used to sta
* Resource represents a class whose CRUD operations are implemented by a provider plugin.
*/
export abstract class Resource {
/**
* parentScope tracks the currently active parent to automatically parent children to.
*/
private static parentScope: (Resource | undefined)[] = [];
/**
* urn is the stable logical URN used to distinctly address a resource, both before and after deployments.
*/
public readonly urn: Promise<URN>;
/**
* id is the provider-assigned unique ID for this resource. It is set during deployments and may be missing
* (undefined) during planning phases.
* children tracks those resources that are created as a result of this one. It may be appended to using
* the adopt API, but the list is frozen as soon as the resource's final state has been computed.
*/
public readonly children: Resource[];
/**
* withParent executes a callback, body, and any resources allocated within become parent's children.
*/
protected static withParent<T>(parent: Resource, body: () => T): T {
Resource.parentScope.push(parent);
try {
return body();
}
finally {
Resource.parentScope.pop();
}
}
/**
* Creates a new initialized resource object.
*/
constructor() {
this.children = [];
runtime.initResource(this);
// If there is a parent scope, automatically add this to it as a child.
if (Resource.parentScope.length) {
const parent: Resource | undefined = Resource.parentScope[Resource.parentScope.length-1];
if (parent) {
parent.adopt(this);
}
}
}
/**
* finished returns true if registration has been completed for this resource.
*/
private finished(): boolean {
return runtime.isRegistered(this);
}
/**
* Marks another resource as a child of this one. This automatically tags resources that
* are related to one another, for purposes of presentation, filtering, and so on.
*/
protected adopt(child: Resource): void {
if (this.finished()) {
throw new Error("May not adopt new children after a resource's registration");
}
this.children.push(child);
}
/**
* Creates and registers a new resource object. t is the fully qualified type token and name is the "name" part
* to use in creating a stable and globally unique URN for the object. dependsOn is an optional list of other
* resources that this resource depends on, controlling the order in which we perform resource operations.
*
* @param t The type of the resource.
* @param name The _unqiue_ name of the resource.
* @param custom True to indicate that this is a custom resource, managed by a plugin.
* @param props The arguments to use to populate the new resource.
* @param dependsOn Optional additional explicit dependencies on other resources.
*/
protected register(t: string, name: string, custom: boolean, props: ComputedValues, dependsOn?: Resource[]) {
if (!t) {
throw new Error("Missing resource type argument");
}
if (!name) {
throw new Error("Missing resource name argument (for URN creation)");
}
// Now kick off the resource registration. If we are actually performing a deployment, this resource's
// properties will be resolved asynchronously after the operation completes, so that dependent computations
// resolve normally. If we are just planning, on the other hand, values will never resolve.
runtime.registerResource(this, t, name, custom, props, this.children, dependsOn);
}
}
/**
* CustomResource is a resource whose create, read, update, and delete (CRUD) operations are managed by performing
* external operations on some physical entity. The engine understands how to diff and perform partial updates of
* them, and these CRUD operations are implemented in a dynamically loaded plugin for the defining package.
*/
export abstract class CustomResource extends Resource {
/**
* id is the provider-assigned unique ID for this managed resource. It is set during deployments and may be
* missing (undefined) during planning phases.
*/
public readonly id: Computed<ID>;
/**
* creates and registers a new resource object. t is the fully qualified type token and name is the "name" part
* Creates and registers a new managed resource. t is the fully qualified type token and name is the "name" part
* to use in creating a stable and globally unique URN for the object. dependsOn is an optional list of other
* resources that this resource depends on, controlling the order in which we perform resource operations.
* Creating an instance does not necessarily perform a create on the physical entity which it represents, and
* instead, this is dependent upon the diffing of the new goal state compared to the current known resource state.
*
* @param t The type of the resource.
* @param name The _unqiue_ name of the resource.
@ -30,17 +122,36 @@ export abstract class Resource {
* @param dependsOn Optional additional explicit dependencies on other resources.
*/
constructor(t: string, name: string, props: ComputedValues, dependsOn?: Resource[]) {
if (t === undefined || t === "") {
throw new Error("Missing resource type argument");
}
if (name === undefined || name === "") {
throw new Error("Missing resource name argument (for URN creation)");
}
super();
this.register(t, name, true, props, dependsOn);
}
}
// Now kick off the resource registration. If we are actually performing a deployment, this resource's
// properties will be resolved asynchronously after the operation completes, so that dependent computations
// resolve normally. If we are just planning, on the other hand, values will never resolve.
runtime.registerResource(this, t, name, props, dependsOn);
/**
* ComponentResource is a resource that aggregates one or more other child resources into a higher level abstraction.
* The component resource itself is a resource, but does not require custom CRUD operations for provisioning.
*/
export abstract class ComponentResource extends Resource {
/**
* Creates and registers a new component resource. t is the fully qualified type token and name is the "name" part
* to use in creating a stable and globally unique URN for the object. init is used to generate whatever children
* will be parented to this component resource. dependsOn is an optional list of other resources that this
* resource depends on, controlling the order in which we perform resource operations.
*
* @param t The type of the resource.
* @param name The _unqiue_ name of the resource.
* @param props The arguments to use to populate the new resource.
* @param init The callback that will allocate child resources.
* @param dependsOn Optional additional explicit dependencies on other resources.
*/
constructor(t: string, name: string, props: ComputedValues,
init: () => void | ComputedValues | undefined, dependsOn?: Resource[]) {
super();
const values: void | ComputedValues | undefined = Resource.withParent(this, init);
// IDEA: in the future, it would be nice to split inputs and outputs in the Pulumi metadata. This would let
// us display them differently. That implies fairly sizable changes to the RPC interfaces, however, so
// for now we simply cram both values (outputs) and props (inputs) together into the same property bag.
this.register(t, name, false, Object.assign({}, values, props), dependsOn);
}
}

View file

@ -1,7 +1,7 @@
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
import * as log from "../log";
import { ID, ComputedValue, ComputedValues, Resource, URN } from "../resource";
import { ID, Computed, ComputedValue, ComputedValues, Resource, URN } from "../resource";
import { errorString, debuggablePromise } from "./debuggable";
import { PropertyTransfer, transferProperties, resolveProperties } from "./rpc";
import { excessiveDebugOutput, getMonitor, options, rpcKeepAlive, serialize } from "./settings";
@ -16,29 +16,81 @@ let langproto = require("../proto/languages_pb.js");
*/
let resourceChain: Promise<void> = Promise.resolve();
/**
* registrations tracks all resources that have finished being registered.
*/
let registrations = new Set<Resource>();
/**
* pendingRegistrations is used to track all unfinished resources so that we can resolve their URNs when done.
*/
let pendingRegistrations = new Map<Resource, (urn: URN | undefined) => void>();
/**
* isRegistered returns true if the resource has begun being registered (no guarantee that it has finished yet).
*/
export function isRegistered(res: Resource): boolean {
return registrations.has(res);
}
/**
* initResource initializes a new resource object.
*/
export function initResource(res: Resource): void {
if (registrations.has(res) || pendingRegistrations.has(res)) {
throw new Error("Illegal attempt to initialize resource more than once");
}
// Simply initialize the URN property and get prepared to resolve it later on.
(res as any).urn = debuggablePromise(new Promise<URN | undefined>((resolve) => {
pendingRegistrations.set(res, resolve);
}));
}
/**
* registerResource registers a new resource object with a given type t and name. It returns the auto-generated URN
* and the ID that will resolve after the deployment has completed. All properties will be initialized to property
* objects that the registration operation will resolve at the right time (or remain unresolved for deployments).
*/
export function registerResource(res: Resource, t: string, name: string, props: ComputedValues | undefined,
dependsOn: Resource[] | undefined): void {
log.debug(`Registering resource: t=${t}, name=${name}` +
export function registerResource(res: Resource, t: string, name: string, custom: boolean,
props: ComputedValues | undefined, children: Resource[], dependsOn: Resource[] | undefined): void {
log.debug(`Registering resource: t=${t}, name=${name}, custom=${custom}` +
(excessiveDebugOutput ? `, props=${JSON.stringify(props)}` : ``));
// Ensure we're not registering more than once.
if (registrations.has(res)) {
throw new Error("Illegal attempt to register resource more than once");
}
registrations.add(res);
// Look up to ensure that this resource has been initialized.
let resolveURN: ((url: URN | undefined) => void) | undefined = pendingRegistrations.get(res);
if (!resolveURN) {
throw new Error("Cannot register a resource that hasn't yet been initialized");
}
// Pre-allocate an error so we have a clean stack to print even if an asynchronous operation occurs.
let createError: Error = new Error(`Resouce '${name}' [${t}] could not be created`);
// Store a URN and ID property, plus any passed in, on the resource object. Note that we do these using any
// casts because they are typically readonly and this function is in cahoots with the initialization process.
let resolveURN: (v: URN | undefined) => void;
(<any>res).urn = debuggablePromise(new Promise<URN | undefined>((resolve) => { resolveURN = resolve; }));
let resolveID: (v: ID | undefined) => void;
(<any>res).id = debuggablePromise(new Promise<ID | undefined>((resolve) => { resolveID = resolve; }));
// If a custom resource, make room for the ID property.
let resolveID: ((v: ID | undefined) => void) | undefined;
if (custom) {
(res as any).id = debuggablePromise(new Promise<ID | undefined>((resolve) => { resolveID = resolve; }));
}
// Ensure we depend on any children plus any explicit dependsOns.
let allDependsOn: Resource[] | undefined;
for (const depends of [ children, dependsOn ]) {
if (depends && depends.length) {
if (!allDependsOn) {
allDependsOn = [];
}
allDependsOn = allDependsOn.concat(depends);
}
}
// Now "transfer" all input properties; this simply awaits any promises and resolves when they all do.
let transfer: Promise<PropertyTransfer> = debuggablePromise(
transferProperties(res, `resource:${name}[${t}]`, props, dependsOn));
transferProperties(res, `resource:${name}[${t}]`, props, allDependsOn));
// Serialize the invocation if necessary.
let resourceOp: Promise<void> = debuggablePromise(resourceChain.then(async () => {
@ -58,12 +110,20 @@ export function registerResource(res: Resource, t: string, name: string, props:
log.debug(`Resource RPC prepared: t=${t}, name=${name}` +
(excessiveDebugOutput ? `, obj=${JSON.stringify(obj)}` : ``));
// Create a list of child URNs.
let childURNs: URN[] = [];
for (let child of children) {
childURNs.push(await child.urn);
}
// Fetch the monitor and make an RPC request.
let monitor: any = getMonitor();
if (monitor) {
let req = new langproto.NewResourceRequest();
req.setType(t);
req.setName(name);
req.setChildrenList(childURNs);
req.setCustom(custom);
req.setObject(obj);
let resp: any = await debuggablePromise(new Promise((resolve, reject) => {
@ -98,16 +158,18 @@ export function registerResource(res: Resource, t: string, name: string, props:
}
}
finally {
// The resolution will always have a valid URN, even during planning, and it is final (doesn't change).
resolveURN(urn);
// If an ID is present, then it's safe to say it's final, because the resource planner wouldn't hand
// it back to us otherwise (e.g., if the resource was being replaced, it would be missing). If it isn't
// available, ensure the ID gets resolved, just resolve it to undefined (indicating it isn't known).
resolveID(id || undefined);
if (resolveID) {
resolveID(id || undefined);
}
// Finally propagate any other properties that were given to us as outputs.
// Propagate any other properties that were given to us as outputs.
resolveProperties(res, result, t, name, props, propsStruct, stable, stables);
// Finally, the resolution will always have a valid URN, even during planning; set it.
resolveURN!(urn);
}
}));

View file

@ -2,7 +2,7 @@
import * as asset from "../asset";
import * as log from "../log";
import { ComputedValue, ComputedValues, Resource } from "../resource";
import { ComputedValue, ComputedValues, CustomResource, Resource } from "../resource";
import { errorString, debuggablePromise } from "./debuggable";
import { excessiveDebugOutput, options } from "./settings";
@ -28,7 +28,7 @@ export function transferProperties(onto: any | undefined, label: string, props:
// If the dependsOn array is present, make sure we wait on those.
if (dependsOn) {
for (let dep of dependsOn) {
eventuals.push(dep.id);
eventuals.push(dep.urn);
}
}
@ -197,7 +197,7 @@ async function serializeProperty(prop: any, ctx?: string): Promise<any> {
}
return elems;
}
else if (prop instanceof Resource) {
else if (prop instanceof CustomResource) {
// Resources aren't serializable; instead, we serialize them as references to the ID property.
if (excessiveDebugOutput) {
log.debug(`Serialize property [${ctx}]: resource ID`);

View file

@ -2,7 +2,7 @@
let pulumi = require("../../../../../");
class MyResource extends pulumi.Resource {
class MyResource extends pulumi.CustomResource {
constructor(name) {
super("test:index:MyResource", name);
}

View file

@ -2,7 +2,7 @@
let pulumi = require("../../../../../");
class MyResource extends pulumi.Resource {
class MyResource extends pulumi.CustomResource {
constructor(name) {
super("test:index:MyResource", name);
}

View file

@ -4,7 +4,7 @@
let assert = require("assert");
let pulumi = require("../../../../../");
class MyResource extends pulumi.Resource {
class MyResource extends pulumi.CustomResource {
constructor(name) {
super("test:index:MyResource", name, {
// First a few basic properties that are resolved to values.

View file

@ -2,7 +2,7 @@
let pulumi = require("../../../../../");
exports.MyResource = class MyResource extends pulumi.Resource {
exports.MyResource = class MyResource extends pulumi.CustomResource {
constructor(name, seq) {
super("test:index:MyResource", name, {
// First a few basic properties that are resolved to values.

View file

@ -3,7 +3,7 @@
let assert = require("assert");
let pulumi = require("../../../../../");
class ResourceA extends pulumi.Resource {
class ResourceA extends pulumi.CustomResource {
constructor(name) {
super("test:index:ResourceA", name, {
"inprop": 777,
@ -12,7 +12,7 @@ class ResourceA extends pulumi.Resource {
}
}
class ResourceB extends pulumi.Resource {
class ResourceB extends pulumi.CustomResource {
constructor(name, other) {
super("test:index:ResourceB", name, {
"otherIn": other.inprop,

View file

@ -2,7 +2,7 @@
let pulumi = require("../../../../../");
class FileResource extends pulumi.Resource {
class FileResource extends pulumi.CustomResource {
constructor(name, data) {
super("test:index:FileResource", name, {
"data": data,

View file

@ -3,7 +3,7 @@
let pulumi = require("../../../../../");
let fs = require("fs");
class FileResource extends pulumi.Resource {
class FileResource extends pulumi.CustomResource {
constructor(name, data) {
super("test:index:FileResource", name, {
"data": data,

View file

@ -2,7 +2,7 @@
let pulumi = require("../../../../../");
class MyResource extends pulumi.Resource {
class MyResource extends pulumi.CustomResource {
constructor(name, deps) {
super("test:index:MyResource", name, {}, deps);
}

View file

@ -95,9 +95,11 @@ func (m *RunResponse) GetError() string {
// NewResourceRequest contains information about a resource object that was newly allocated.
type NewResourceRequest struct {
Type string `protobuf:"bytes,1,opt,name=type" json:"type,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
Object *google_protobuf.Struct `protobuf:"bytes,3,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"`
Children []string `protobuf:"bytes,3,rep,name=children" json:"children,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"`
}
func (m *NewResourceRequest) Reset() { *m = NewResourceRequest{} }
@ -119,6 +121,20 @@ func (m *NewResourceRequest) GetName() string {
return ""
}
func (m *NewResourceRequest) GetChildren() []string {
if m != nil {
return m.Children
}
return nil
}
func (m *NewResourceRequest) GetCustom() bool {
if m != nil {
return m.Custom
}
return false
}
func (m *NewResourceRequest) GetObject() *google_protobuf.Struct {
if m != nil {
return m.Object
@ -354,34 +370,36 @@ var _ResourceMonitor_serviceDesc = grpc.ServiceDesc{
func init() { proto.RegisterFile("languages.proto", fileDescriptor2) }
var fileDescriptor2 = []byte{
// 458 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x52, 0x4d, 0x8f, 0xd3, 0x30,
0x10, 0x25, 0x4d, 0x1b, 0xb6, 0x13, 0x69, 0x8b, 0x0c, 0x2c, 0x26, 0x02, 0x14, 0xc2, 0x25, 0xa7,
0x54, 0x2a, 0x12, 0x62, 0xb9, 0x70, 0x40, 0x1c, 0x56, 0x82, 0x3d, 0x98, 0x5f, 0x90, 0xa6, 0xb3,
0x51, 0x68, 0x62, 0x07, 0xc7, 0xee, 0x2a, 0x7f, 0x85, 0x23, 0x3f, 0x92, 0x33, 0x8a, 0x3f, 0x96,
0x02, 0xcb, 0x61, 0x6f, 0xef, 0x8d, 0x9f, 0x67, 0x9e, 0xe7, 0x19, 0x56, 0x6d, 0xc9, 0x6b, 0x5d,
0xd6, 0x38, 0x14, 0xbd, 0x14, 0x4a, 0x90, 0x65, 0xaf, 0x5b, 0xdd, 0x35, 0xb2, 0xaf, 0x92, 0x67,
0xb5, 0x10, 0x75, 0x8b, 0x6b, 0x73, 0xb0, 0xd5, 0x57, 0xeb, 0x41, 0x49, 0x5d, 0x29, 0x2b, 0x4c,
0x4e, 0x7b, 0x29, 0x0e, 0xcd, 0x0e, 0xa5, 0xe5, 0xd9, 0xcf, 0x00, 0x80, 0x69, 0xce, 0xf0, 0x9b,
0xc6, 0x41, 0x91, 0x07, 0x10, 0xf6, 0xd7, 0x3b, 0x1a, 0xa4, 0x41, 0xbe, 0x64, 0x13, 0x24, 0x14,
0xee, 0xf7, 0x52, 0xd4, 0xb2, 0xec, 0xe8, 0xcc, 0x54, 0x3d, 0x25, 0x04, 0xe6, 0xa5, 0xac, 0x07,
0x1a, 0xa6, 0x61, 0xbe, 0x64, 0x06, 0x93, 0x73, 0x88, 0x2a, 0xc1, 0xaf, 0x9a, 0x9a, 0xce, 0xd3,
0x30, 0x8f, 0x37, 0x2f, 0x8b, 0x1b, 0x63, 0xc5, 0xef, 0x31, 0xc5, 0x07, 0xa3, 0xf9, 0xc8, 0x95,
0x1c, 0x99, 0xbb, 0x40, 0xce, 0x20, 0xda, 0xc9, 0x91, 0x69, 0x4e, 0x17, 0x69, 0x90, 0x9f, 0x30,
0xc7, 0x48, 0x02, 0x27, 0x7d, 0x29, 0xcb, 0xb6, 0xc5, 0x96, 0x46, 0x69, 0x90, 0x2f, 0xd8, 0x0d,
0x4f, 0xce, 0x21, 0x3e, 0x6a, 0x35, 0xb9, 0xdf, 0xe3, 0xe8, 0xdd, 0xef, 0x71, 0x24, 0x8f, 0x60,
0x71, 0x28, 0x5b, 0x8d, 0xce, 0xbb, 0x25, 0xef, 0x66, 0x6f, 0x83, 0xec, 0x15, 0xc4, 0xc6, 0xd0,
0xd0, 0x0b, 0x3e, 0xe0, 0x24, 0x44, 0x29, 0x85, 0x74, 0x97, 0x2d, 0xc9, 0x3a, 0x20, 0x97, 0x78,
0xcd, 0x70, 0x10, 0x5a, 0x56, 0xe8, 0x97, 0x44, 0x60, 0xae, 0xc6, 0x1e, 0x9d, 0xd4, 0xe0, 0xa9,
0xc6, 0xcb, 0xce, 0xcf, 0x31, 0x98, 0xac, 0x21, 0x12, 0xdb, 0xaf, 0x58, 0x29, 0x1a, 0xa6, 0x41,
0x1e, 0x6f, 0x9e, 0x14, 0x36, 0x9a, 0xc2, 0x47, 0x53, 0x7c, 0x31, 0xd1, 0x30, 0x27, 0xcb, 0xbe,
0x07, 0xf0, 0xf0, 0x8f, 0x79, 0xce, 0xdc, 0x29, 0xcc, 0x1a, 0x1f, 0xca, 0xac, 0xd9, 0x4d, 0xef,
0xd4, 0x92, 0xbb, 0x59, 0x13, 0xbc, 0xf3, 0xa8, 0x69, 0xdb, 0x83, 0x2a, 0xb7, 0x2d, 0xd2, 0xb9,
0xdd, 0xb6, 0x65, 0x53, 0xdc, 0x16, 0x0d, 0x74, 0x61, 0x72, 0xf5, 0x74, 0x73, 0x01, 0xab, 0x4f,
0xee, 0xd7, 0x31, 0xcd, 0x55, 0xd3, 0x21, 0x79, 0x03, 0xe1, 0x94, 0xd0, 0xe3, 0x5b, 0x43, 0x4e,
0xce, 0xfe, 0x2e, 0xdb, 0xd7, 0x64, 0xf7, 0x36, 0x3f, 0x02, 0x58, 0xf9, 0x47, 0x7e, 0x16, 0xbc,
0x51, 0x42, 0x92, 0xf7, 0x10, 0x5d, 0xf0, 0x83, 0xd8, 0x23, 0xa1, 0x47, 0xf7, 0x6c, 0xc9, 0x77,
0x7c, 0x7a, 0xcb, 0x89, 0x6f, 0x4a, 0x2e, 0x21, 0x3e, 0xda, 0x1d, 0x79, 0x7e, 0xa4, 0xfd, 0x37,
0xc3, 0xe4, 0xc5, 0xff, 0x8e, 0x7d, 0xbf, 0x6d, 0x64, 0x56, 0xf7, 0xfa, 0x57, 0x00, 0x00, 0x00,
0xff, 0xff, 0xb0, 0xbc, 0x47, 0x30, 0x6c, 0x03, 0x00, 0x00,
// 481 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x52, 0x4d, 0x6f, 0xd3, 0x40,
0x10, 0xc5, 0x71, 0x62, 0x9a, 0x89, 0xd4, 0xa0, 0x05, 0xca, 0x62, 0x01, 0x0a, 0xe1, 0x92, 0x93,
0x23, 0x05, 0x09, 0x51, 0x2e, 0x1c, 0x10, 0x87, 0x4a, 0xd0, 0xc3, 0xf2, 0x0b, 0x1c, 0x67, 0x6a,
0x4c, 0x9c, 0x5d, 0xb3, 0x1f, 0xa9, 0xf2, 0x57, 0xb8, 0xc1, 0x8f, 0xe4, 0x8c, 0xf6, 0x2b, 0x18,
0x28, 0x52, 0x6f, 0xf3, 0x66, 0x67, 0x67, 0xde, 0xbc, 0x37, 0x30, 0x6d, 0x4b, 0x5e, 0x9b, 0xb2,
0x46, 0x55, 0x74, 0x52, 0x68, 0x41, 0xc6, 0x9d, 0x69, 0xcd, 0xae, 0x91, 0x5d, 0x95, 0x3f, 0xa9,
0x85, 0xa8, 0x5b, 0x5c, 0xba, 0x87, 0xb5, 0xb9, 0x5a, 0x2a, 0x2d, 0x4d, 0xa5, 0x7d, 0x61, 0x7e,
0xda, 0x49, 0xb1, 0x6f, 0x36, 0x28, 0x3d, 0x9e, 0xff, 0x4c, 0x00, 0x98, 0xe1, 0x0c, 0xbf, 0x1a,
0x54, 0x9a, 0xdc, 0x83, 0xb4, 0xbb, 0xde, 0xd0, 0x64, 0x96, 0x2c, 0xc6, 0xcc, 0x86, 0x84, 0xc2,
0xdd, 0x4e, 0x8a, 0x5a, 0x96, 0x3b, 0x3a, 0x70, 0xd9, 0x08, 0x09, 0x81, 0x61, 0x29, 0x6b, 0x45,
0xd3, 0x59, 0xba, 0x18, 0x33, 0x17, 0x93, 0x73, 0xc8, 0x2a, 0xc1, 0xaf, 0x9a, 0x9a, 0x0e, 0x67,
0xe9, 0x62, 0xb2, 0x7a, 0x5e, 0x1c, 0x89, 0x15, 0xbf, 0xc7, 0x14, 0xef, 0x5c, 0xcd, 0x7b, 0xae,
0xe5, 0x81, 0x85, 0x0f, 0xe4, 0x0c, 0xb2, 0x8d, 0x3c, 0x30, 0xc3, 0xe9, 0x68, 0x96, 0x2c, 0x4e,
0x58, 0x40, 0x24, 0x87, 0x93, 0xae, 0x94, 0x65, 0xdb, 0x62, 0x4b, 0xb3, 0x59, 0xb2, 0x18, 0xb1,
0x23, 0xce, 0xcf, 0x61, 0xd2, 0x6b, 0x65, 0xd9, 0x6f, 0xf1, 0x10, 0xd9, 0x6f, 0xf1, 0x40, 0x1e,
0xc0, 0x68, 0x5f, 0xb6, 0x06, 0x03, 0x77, 0x0f, 0xde, 0x0c, 0x5e, 0x27, 0xf3, 0x17, 0x30, 0x71,
0x84, 0x54, 0x27, 0xb8, 0x42, 0x5b, 0x88, 0x52, 0x0a, 0x19, 0x3e, 0x7b, 0x30, 0xff, 0x9e, 0x00,
0xb9, 0xc4, 0x6b, 0x86, 0x4a, 0x18, 0x59, 0x61, 0x54, 0x89, 0xc0, 0x50, 0x1f, 0x3a, 0x0c, 0xb5,
0x2e, 0xb6, 0x39, 0x5e, 0xee, 0xe2, 0x20, 0x17, 0x5b, 0xea, 0xd5, 0xe7, 0xa6, 0xdd, 0x48, 0xe4,
0x41, 0xa5, 0x23, 0xb6, 0xeb, 0x56, 0x46, 0x69, 0xb1, 0xa3, 0x43, 0xbf, 0xae, 0x47, 0x64, 0x09,
0x99, 0x58, 0x7f, 0xc1, 0x4a, 0x3b, 0x19, 0x26, 0xab, 0x47, 0x85, 0xf7, 0xb3, 0x88, 0x7e, 0x16,
0x9f, 0x9c, 0x9f, 0x2c, 0x94, 0xcd, 0xbf, 0x25, 0x70, 0xff, 0x0f, 0x8e, 0x61, 0xa3, 0x53, 0x18,
0x34, 0xd1, 0xc9, 0x41, 0xb3, 0xb1, 0xe2, 0x18, 0xc9, 0x03, 0x3f, 0x1b, 0xf6, 0x46, 0xa5, 0xb7,
0x1a, 0x65, 0x39, 0x2b, 0x5d, 0xae, 0x5b, 0x8c, 0x9c, 0x3d, 0xb2, 0x37, 0xe2, 0x23, 0x45, 0x47,
0x6e, 0xcd, 0x08, 0x57, 0x17, 0x30, 0xfd, 0x10, 0x4e, 0x95, 0x19, 0xae, 0x9b, 0x1d, 0x92, 0x57,
0x90, 0x5a, 0x5b, 0x1f, 0xde, 0x78, 0x19, 0xf9, 0xd9, 0xdf, 0x69, 0xbf, 0xcd, 0xfc, 0xce, 0xea,
0x47, 0x02, 0xd3, 0xb8, 0xe4, 0x47, 0xc1, 0x1b, 0x2d, 0x24, 0x79, 0x0b, 0xd9, 0x05, 0xdf, 0x8b,
0x2d, 0x12, 0xda, 0xfb, 0xe7, 0x53, 0xb1, 0xe3, 0xe3, 0x1b, 0x5e, 0x62, 0x53, 0x72, 0x09, 0x93,
0x9e, 0x76, 0xe4, 0x69, 0xaf, 0xf6, 0x5f, 0xdf, 0xf3, 0x67, 0xff, 0x7b, 0x8e, 0xfd, 0xd6, 0x99,
0x93, 0xee, 0xe5, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x87, 0xec, 0xd9, 0x9d, 0xa1, 0x03, 0x00,
0x00,
}

View file

@ -38,7 +38,9 @@ service ResourceMonitor {
message NewResourceRequest {
string type = 1; // the type of the object allocated.
string name = 2; // the name, for URN purposes, of the object.
google.protobuf.Struct object = 3; // an object produced by the interpreter/source.
repeated string children = 3; // an optional list of child URNs belonging to this parent resource.
bool custom = 4; // true if the resource is a custom, managed by a plugin's CRUD operations.
google.protobuf.Struct object = 5; // an object produced by the interpreter/source.
}
// NewResourceResponse reflects back the properties initialized during creation, if applicable.

View file

@ -1,6 +1,8 @@
/**
* @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!
@ -56,6 +58,7 @@ proto.pulumirpc.AnalyzeRequest.prototype.toObject = function(opt_includeInstance
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.AnalyzeRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.AnalyzeRequest.toObject = function(includeInstance, msg) {
var f, obj = {
@ -131,6 +134,7 @@ proto.pulumirpc.AnalyzeRequest.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.AnalyzeRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.AnalyzeRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -247,6 +251,7 @@ proto.pulumirpc.AnalyzeResponse.prototype.toObject = function(opt_includeInstanc
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.AnalyzeResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.AnalyzeResponse.toObject = function(includeInstance, msg) {
var f, obj = {
@ -318,6 +323,7 @@ proto.pulumirpc.AnalyzeResponse.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.AnalyzeResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.AnalyzeResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -334,8 +340,6 @@ proto.pulumirpc.AnalyzeResponse.serializeBinaryToWriter = function(message, writ
/**
* repeated AnalyzeFailure failures = 1;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<!proto.pulumirpc.AnalyzeFailure>}
*/
proto.pulumirpc.AnalyzeResponse.prototype.getFailuresList = function() {
@ -408,6 +412,7 @@ proto.pulumirpc.AnalyzeFailure.prototype.toObject = function(opt_includeInstance
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.AnalyzeFailure} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.AnalyzeFailure.toObject = function(includeInstance, msg) {
var f, obj = {
@ -482,6 +487,7 @@ proto.pulumirpc.AnalyzeFailure.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.AnalyzeFailure} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.AnalyzeFailure.serializeBinaryToWriter = function(message, writer) {
var f = undefined;

View file

@ -1,6 +1,8 @@
/**
* @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!
@ -55,6 +57,7 @@ proto.pulumirpc.LogRequest.prototype.toObject = function(opt_includeInstance) {
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.LogRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.LogRequest.toObject = function(includeInstance, msg) {
var f, obj = {
@ -129,6 +132,7 @@ proto.pulumirpc.LogRequest.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.LogRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.LogRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;

View file

@ -1,6 +1,8 @@
/**
* @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!
@ -65,12 +67,13 @@ proto.pulumirpc.RunRequest.prototype.toObject = function(opt_includeInstance) {
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.RunRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.RunRequest.toObject = function(includeInstance, msg) {
var f, obj = {
pwd: jspb.Message.getFieldWithDefault(msg, 1, ""),
program: jspb.Message.getFieldWithDefault(msg, 2, ""),
argsList: jspb.Message.getField(msg, 3),
argsList: jspb.Message.getRepeatedField(msg, 3),
configMap: (f = msg.getConfigMap()) ? f.toObject(includeInstance, undefined) : [],
dryrun: jspb.Message.getFieldWithDefault(msg, 5, false),
parallel: jspb.Message.getFieldWithDefault(msg, 6, 0)
@ -161,6 +164,7 @@ proto.pulumirpc.RunRequest.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.RunRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.RunRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -238,12 +242,10 @@ proto.pulumirpc.RunRequest.prototype.setProgram = function(value) {
/**
* repeated string args = 3;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<string>}
*/
proto.pulumirpc.RunRequest.prototype.getArgsList = function() {
return /** @type {!Array.<string>} */ (jspb.Message.getField(this, 3));
return /** @type {!Array.<string>} */ (jspb.Message.getRepeatedField(this, 3));
};
@ -360,6 +362,7 @@ proto.pulumirpc.RunResponse.prototype.toObject = function(opt_includeInstance) {
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.RunResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.RunResponse.toObject = function(includeInstance, msg) {
var f, obj = {
@ -429,6 +432,7 @@ proto.pulumirpc.RunResponse.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.RunResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.RunResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -469,12 +473,19 @@ proto.pulumirpc.RunResponse.prototype.setError = function(value) {
* @constructor
*/
proto.pulumirpc.NewResourceRequest = function(opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
jspb.Message.initialize(this, opt_data, 0, -1, proto.pulumirpc.NewResourceRequest.repeatedFields_, null);
};
goog.inherits(proto.pulumirpc.NewResourceRequest, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.pulumirpc.NewResourceRequest.displayName = 'proto.pulumirpc.NewResourceRequest';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.pulumirpc.NewResourceRequest.repeatedFields_ = [3];
if (jspb.Message.GENERATE_TO_OBJECT) {
@ -500,11 +511,14 @@ proto.pulumirpc.NewResourceRequest.prototype.toObject = function(opt_includeInst
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.NewResourceRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.NewResourceRequest.toObject = function(includeInstance, msg) {
var f, obj = {
type: jspb.Message.getFieldWithDefault(msg, 1, ""),
name: jspb.Message.getFieldWithDefault(msg, 2, ""),
childrenList: jspb.Message.getRepeatedField(msg, 3),
custom: jspb.Message.getFieldWithDefault(msg, 4, false),
object: (f = msg.getObject()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f)
};
@ -551,6 +565,14 @@ proto.pulumirpc.NewResourceRequest.deserializeBinaryFromReader = function(msg, r
msg.setName(value);
break;
case 3:
var value = /** @type {string} */ (reader.readString());
msg.addChildren(value);
break;
case 4:
var value = /** @type {boolean} */ (reader.readBool());
msg.setCustom(value);
break;
case 5:
var value = new google_protobuf_struct_pb.Struct;
reader.readMessage(value,google_protobuf_struct_pb.Struct.deserializeBinaryFromReader);
msg.setObject(value);
@ -580,6 +602,7 @@ proto.pulumirpc.NewResourceRequest.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.NewResourceRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.NewResourceRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -597,10 +620,24 @@ proto.pulumirpc.NewResourceRequest.serializeBinaryToWriter = function(message, w
f
);
}
f = message.getChildrenList();
if (f.length > 0) {
writer.writeRepeatedString(
3,
f
);
}
f = message.getCustom();
if (f) {
writer.writeBool(
4,
f
);
}
f = message.getObject();
if (f != null) {
writer.writeMessage(
3,
5,
f,
google_protobuf_struct_pb.Struct.serializeBinaryToWriter
);
@ -639,18 +676,64 @@ proto.pulumirpc.NewResourceRequest.prototype.setName = function(value) {
/**
* optional google.protobuf.Struct object = 3;
* repeated string children = 3;
* @return {!Array.<string>}
*/
proto.pulumirpc.NewResourceRequest.prototype.getChildrenList = function() {
return /** @type {!Array.<string>} */ (jspb.Message.getRepeatedField(this, 3));
};
/** @param {!Array.<string>} value */
proto.pulumirpc.NewResourceRequest.prototype.setChildrenList = function(value) {
jspb.Message.setField(this, 3, value || []);
};
/**
* @param {!string} value
* @param {number=} opt_index
*/
proto.pulumirpc.NewResourceRequest.prototype.addChildren = function(value, opt_index) {
jspb.Message.addToRepeatedField(this, 3, value, opt_index);
};
proto.pulumirpc.NewResourceRequest.prototype.clearChildrenList = function() {
this.setChildrenList([]);
};
/**
* optional bool custom = 4;
* Note that Boolean fields may be set to 0/1 when serialized from a Java server.
* You should avoid comparisons like {@code val === true/false} in those cases.
* @return {boolean}
*/
proto.pulumirpc.NewResourceRequest.prototype.getCustom = function() {
return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 4, false));
};
/** @param {boolean} value */
proto.pulumirpc.NewResourceRequest.prototype.setCustom = function(value) {
jspb.Message.setField(this, 4, value);
};
/**
* optional google.protobuf.Struct object = 5;
* @return {?proto.google.protobuf.Struct}
*/
proto.pulumirpc.NewResourceRequest.prototype.getObject = function() {
return /** @type{?proto.google.protobuf.Struct} */ (
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 3));
jspb.Message.getWrapperField(this, google_protobuf_struct_pb.Struct, 5));
};
/** @param {?proto.google.protobuf.Struct|undefined} value */
proto.pulumirpc.NewResourceRequest.prototype.setObject = function(value) {
jspb.Message.setWrapperField(this, 3, value);
jspb.Message.setWrapperField(this, 5, value);
};
@ -664,7 +747,7 @@ proto.pulumirpc.NewResourceRequest.prototype.clearObject = function() {
* @return {!boolean}
*/
proto.pulumirpc.NewResourceRequest.prototype.hasObject = function() {
return jspb.Message.getField(this, 3) != null;
return jspb.Message.getField(this, 5) != null;
};
@ -718,6 +801,7 @@ proto.pulumirpc.NewResourceResponse.prototype.toObject = function(opt_includeIns
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.NewResourceResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.NewResourceResponse.toObject = function(includeInstance, msg) {
var f, obj = {
@ -725,7 +809,7 @@ proto.pulumirpc.NewResourceResponse.toObject = function(includeInstance, msg) {
urn: jspb.Message.getFieldWithDefault(msg, 2, ""),
object: (f = msg.getObject()) && google_protobuf_struct_pb.Struct.toObject(includeInstance, f),
stable: jspb.Message.getFieldWithDefault(msg, 4, false),
stablesList: jspb.Message.getField(msg, 5)
stablesList: jspb.Message.getRepeatedField(msg, 5)
};
if (includeInstance) {
@ -808,6 +892,7 @@ proto.pulumirpc.NewResourceResponse.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.NewResourceResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.NewResourceResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -929,12 +1014,10 @@ proto.pulumirpc.NewResourceResponse.prototype.setStable = function(value) {
/**
* repeated string stables = 5;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<string>}
*/
proto.pulumirpc.NewResourceResponse.prototype.getStablesList = function() {
return /** @type {!Array.<string>} */ (jspb.Message.getField(this, 5));
return /** @type {!Array.<string>} */ (jspb.Message.getRepeatedField(this, 5));
};

View file

@ -1,6 +1,8 @@
/**
* @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!
@ -67,6 +69,7 @@ proto.pulumirpc.ConfigureRequest.prototype.toObject = function(opt_includeInstan
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.ConfigureRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.ConfigureRequest.toObject = function(includeInstance, msg) {
var f, obj = {
@ -138,6 +141,7 @@ proto.pulumirpc.ConfigureRequest.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.ConfigureRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.ConfigureRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -209,6 +213,7 @@ proto.pulumirpc.InvokeRequest.prototype.toObject = function(opt_includeInstance)
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.InvokeRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.InvokeRequest.toObject = function(includeInstance, msg) {
var f, obj = {
@ -284,6 +289,7 @@ proto.pulumirpc.InvokeRequest.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.InvokeRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.InvokeRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -400,6 +406,7 @@ proto.pulumirpc.InvokeResponse.prototype.toObject = function(opt_includeInstance
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.InvokeResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.InvokeResponse.toObject = function(includeInstance, msg) {
var f, obj = {
@ -477,6 +484,7 @@ proto.pulumirpc.InvokeResponse.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.InvokeResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.InvokeResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -531,8 +539,6 @@ proto.pulumirpc.InvokeResponse.prototype.hasReturn = function() {
/**
* repeated CheckFailure failures = 2;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<!proto.pulumirpc.CheckFailure>}
*/
proto.pulumirpc.InvokeResponse.prototype.getFailuresList = function() {
@ -605,6 +611,7 @@ proto.pulumirpc.CheckRequest.prototype.toObject = function(opt_includeInstance)
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.CheckRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.CheckRequest.toObject = function(includeInstance, msg) {
var f, obj = {
@ -680,6 +687,7 @@ proto.pulumirpc.CheckRequest.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.CheckRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.CheckRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -796,6 +804,7 @@ proto.pulumirpc.CheckResponse.prototype.toObject = function(opt_includeInstance)
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.CheckResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.CheckResponse.toObject = function(includeInstance, msg) {
var f, obj = {
@ -873,6 +882,7 @@ proto.pulumirpc.CheckResponse.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.CheckResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.CheckResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -927,8 +937,6 @@ proto.pulumirpc.CheckResponse.prototype.hasDefaults = function() {
/**
* repeated CheckFailure failures = 2;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<!proto.pulumirpc.CheckFailure>}
*/
proto.pulumirpc.CheckResponse.prototype.getFailuresList = function() {
@ -1001,6 +1009,7 @@ proto.pulumirpc.CheckFailure.prototype.toObject = function(opt_includeInstance)
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.CheckFailure} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.CheckFailure.toObject = function(includeInstance, msg) {
var f, obj = {
@ -1075,6 +1084,7 @@ proto.pulumirpc.CheckFailure.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.CheckFailure} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.CheckFailure.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -1168,6 +1178,7 @@ proto.pulumirpc.DiffRequest.prototype.toObject = function(opt_includeInstance) {
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.DiffRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.DiffRequest.toObject = function(includeInstance, msg) {
var f, obj = {
@ -1254,6 +1265,7 @@ proto.pulumirpc.DiffRequest.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.DiffRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.DiffRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -1430,11 +1442,12 @@ proto.pulumirpc.DiffResponse.prototype.toObject = function(opt_includeInstance)
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.DiffResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.DiffResponse.toObject = function(includeInstance, msg) {
var f, obj = {
replacesList: jspb.Message.getField(msg, 1),
stablesList: jspb.Message.getField(msg, 2)
replacesList: jspb.Message.getRepeatedField(msg, 1),
stablesList: jspb.Message.getRepeatedField(msg, 2)
};
if (includeInstance) {
@ -1504,6 +1517,7 @@ proto.pulumirpc.DiffResponse.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.DiffResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.DiffResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -1526,12 +1540,10 @@ proto.pulumirpc.DiffResponse.serializeBinaryToWriter = function(message, writer)
/**
* repeated string replaces = 1;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<string>}
*/
proto.pulumirpc.DiffResponse.prototype.getReplacesList = function() {
return /** @type {!Array.<string>} */ (jspb.Message.getField(this, 1));
return /** @type {!Array.<string>} */ (jspb.Message.getRepeatedField(this, 1));
};
@ -1557,12 +1569,10 @@ proto.pulumirpc.DiffResponse.prototype.clearReplacesList = function() {
/**
* repeated string stables = 2;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<string>}
*/
proto.pulumirpc.DiffResponse.prototype.getStablesList = function() {
return /** @type {!Array.<string>} */ (jspb.Message.getField(this, 2));
return /** @type {!Array.<string>} */ (jspb.Message.getRepeatedField(this, 2));
};
@ -1629,6 +1639,7 @@ proto.pulumirpc.CreateRequest.prototype.toObject = function(opt_includeInstance)
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.CreateRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.CreateRequest.toObject = function(includeInstance, msg) {
var f, obj = {
@ -1704,6 +1715,7 @@ proto.pulumirpc.CreateRequest.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.CreateRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.CreateRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -1813,6 +1825,7 @@ proto.pulumirpc.CreateResponse.prototype.toObject = function(opt_includeInstance
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.CreateResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.CreateResponse.toObject = function(includeInstance, msg) {
var f, obj = {
@ -1888,6 +1901,7 @@ proto.pulumirpc.CreateResponse.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.CreateResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.CreateResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -1997,6 +2011,7 @@ proto.pulumirpc.UpdateRequest.prototype.toObject = function(opt_includeInstance)
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.UpdateRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.UpdateRequest.toObject = function(includeInstance, msg) {
var f, obj = {
@ -2083,6 +2098,7 @@ proto.pulumirpc.UpdateRequest.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.UpdateRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.UpdateRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -2252,6 +2268,7 @@ proto.pulumirpc.UpdateResponse.prototype.toObject = function(opt_includeInstance
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.UpdateResponse} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.UpdateResponse.toObject = function(includeInstance, msg) {
var f, obj = {
@ -2322,6 +2339,7 @@ proto.pulumirpc.UpdateResponse.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.UpdateResponse} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.UpdateResponse.serializeBinaryToWriter = function(message, writer) {
var f = undefined;
@ -2409,6 +2427,7 @@ proto.pulumirpc.DeleteRequest.prototype.toObject = function(opt_includeInstance)
* http://goto/soy-param-migration
* @param {!proto.pulumirpc.DeleteRequest} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.DeleteRequest.toObject = function(includeInstance, msg) {
var f, obj = {
@ -2489,6 +2508,7 @@ proto.pulumirpc.DeleteRequest.prototype.serializeBinary = function() {
* format), writing to the given BinaryWriter.
* @param {!proto.pulumirpc.DeleteRequest} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.pulumirpc.DeleteRequest.serializeBinaryToWriter = function(message, writer) {
var f = undefined;