This is the initial step towards redefining Lumi as a library that runs atop vanilla Node.js/V8, rather than as its own runtime. This change is woefully incomplete but this includes some of the more stable pieces of my current work-in-progress. The new structure is that within the sdk/ directory we will have a client library per language. This client library contains the object model for Lumi (resources, properties, assets, config, etc), in addition to the "language runtime host" components required to interoperate with the Lumi resource monitor. This resource monitor is effectively what we call "Lumi" today, in that it's the thing orchestrating plans and deployments. Inside the sdk/ directory, you will find nodejs/, the Node.js client library, alongside proto/, the definitions for RPC interop between the different pieces of the system. This includes existing RPC definitions for resource providers, etc., in addition to the new ones for hosting different language runtimes from within Lumi. These new interfaces are surprisingly simple. There is effectively a bidirectional RPC channel between the Lumi resource monitor, represented by the lumirpc.ResourceMonitor interface, and each language runtime, represented by the lumirpc.LanguageRuntime interface. The overall orchestration goes as follows: 1) Lumi decides it needs to run a program written in language X, so it dynamically loads the language runtime plugin for language X. 2) Lumi passes that runtime a loopback address to its ResourceMonitor service, while language X will publish a connection back to its LanguageRuntime service, which Lumi will talk to. 3) Lumi then invokes LanguageRuntime.Run, passing information like the desired working directory, program name, arguments, and optional configuration variables to make available to the program. 4) The language X runtime receives this, unpacks it and sets up the necessary context, and then invokes the program. The program then calls into Lumi object model abstractions that internally communicate back to Lumi using the ResourceMonitor interface. 5) The key here is ResourceMonitor.NewResource, which Lumi uses to serialize state about newly allocated resources. Lumi receives these and registers them as part of the plan, doing the usual diffing, etc., to decide how to proceed. This interface is perhaps one of the most subtle parts of the new design, as it necessitates the use of promises internally to allow parallel evaluation of the resource plan, letting dataflow determine the available concurrency. 6) The program exits, and Lumi continues on its merry way. If the program fails, the RunResponse will include information about the failure. Due to (5), all properties on resources are now instances of a new Property<T> type. A Property<T> is just a thin wrapper over a T, but it encodes the special properties of Lumi resource properties. Namely, it is possible to create one out of a T, other Property<T>, Promise<T>, or to freshly allocate one. In all cases, the Property<T> does not "settle" until its final state is known. This cannot occur before the deployment actually completes, and so in general it's not safe to depend on concrete resolutions of values (unlike ordinary Promise<T>s which are usually expected to resolve). As a result, all derived computations are meant to use the `then` function (as in `someValue.then(v => v+x)`). Although this change includes tests that may be run in isolation to test the various RPC interactions, we are nowhere near finished. The remaining work primarily boils down to three things: 1) Wiring all of this up to the Lumi code. 2) Fixing the handful of known loose ends required to make this work, primarily around the serialization of properties (waiting on unresolved ones, serializing assets properly, etc). 3) Implementing lambda closure serialization as a native extension. This ongoing work is part of pulumi/pulumi-fabric#311.
714 lines
26 KiB
Go
714 lines
26 KiB
Go
// Code generated by protoc-gen-go.
|
|
// source: provider.proto
|
|
// DO NOT EDIT!
|
|
|
|
package lumirpc
|
|
|
|
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 (
|
|
context "golang.org/x/net/context"
|
|
grpc "google.golang.org/grpc"
|
|
)
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ = proto.Marshal
|
|
var _ = fmt.Errorf
|
|
var _ = math.Inf
|
|
|
|
type NameRequest 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"`
|
|
}
|
|
|
|
func (m *NameRequest) Reset() { *m = NameRequest{} }
|
|
func (m *NameRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*NameRequest) ProtoMessage() {}
|
|
func (*NameRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} }
|
|
|
|
func (m *NameRequest) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *NameRequest) GetProperties() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type NameResponse struct {
|
|
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
|
|
}
|
|
|
|
func (m *NameResponse) Reset() { *m = NameResponse{} }
|
|
func (m *NameResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*NameResponse) ProtoMessage() {}
|
|
func (*NameResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{1} }
|
|
|
|
func (m *NameResponse) GetName() string {
|
|
if m != nil {
|
|
return m.Name
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type CheckRequest 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"`
|
|
}
|
|
|
|
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{2} }
|
|
|
|
func (m *CheckRequest) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *CheckRequest) GetProperties() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
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"`
|
|
}
|
|
|
|
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{3} }
|
|
|
|
func (m *CheckResponse) GetDefaults() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Defaults
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *CheckResponse) GetFailures() []*CheckFailure {
|
|
if m != nil {
|
|
return m.Failures
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type CheckFailure struct {
|
|
Property string `protobuf:"bytes,1,opt,name=property" json:"property,omitempty"`
|
|
Reason string `protobuf:"bytes,2,opt,name=reason" json:"reason,omitempty"`
|
|
}
|
|
|
|
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{4} }
|
|
|
|
func (m *CheckFailure) GetProperty() string {
|
|
if m != nil {
|
|
return m.Property
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *CheckFailure) GetReason() string {
|
|
if m != nil {
|
|
return m.Reason
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type DiffRequest struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
Type string `protobuf:"bytes,2,opt,name=type" json:"type,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"`
|
|
}
|
|
|
|
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{5} }
|
|
|
|
func (m *DiffRequest) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *DiffRequest) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *DiffRequest) GetOlds() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Olds
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *DiffRequest) GetNews() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.News
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type DiffResponse struct {
|
|
Replaces []string `protobuf:"bytes,1,rep,name=replaces" json:"replaces,omitempty"`
|
|
}
|
|
|
|
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{6} }
|
|
|
|
func (m *DiffResponse) GetReplaces() []string {
|
|
if m != nil {
|
|
return m.Replaces
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type CreateRequest 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"`
|
|
}
|
|
|
|
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{7} }
|
|
|
|
func (m *CreateRequest) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *CreateRequest) GetProperties() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
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"`
|
|
}
|
|
|
|
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{8} }
|
|
|
|
func (m *CreateResponse) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *CreateResponse) GetProperties() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type GetRequest struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"`
|
|
}
|
|
|
|
func (m *GetRequest) Reset() { *m = GetRequest{} }
|
|
func (m *GetRequest) String() string { return proto.CompactTextString(m) }
|
|
func (*GetRequest) ProtoMessage() {}
|
|
func (*GetRequest) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{9} }
|
|
|
|
func (m *GetRequest) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *GetRequest) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type GetResponse struct {
|
|
Properties *google_protobuf.Struct `protobuf:"bytes,1,opt,name=properties" json:"properties,omitempty"`
|
|
}
|
|
|
|
func (m *GetResponse) Reset() { *m = GetResponse{} }
|
|
func (m *GetResponse) String() string { return proto.CompactTextString(m) }
|
|
func (*GetResponse) ProtoMessage() {}
|
|
func (*GetResponse) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{10} }
|
|
|
|
func (m *GetResponse) GetProperties() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type UpdateRequest struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
Type string `protobuf:"bytes,2,opt,name=type" json:"type,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"`
|
|
}
|
|
|
|
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{11} }
|
|
|
|
func (m *UpdateRequest) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *UpdateRequest) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *UpdateRequest) GetOlds() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Olds
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *UpdateRequest) GetNews() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.News
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type UpdateResponse struct {
|
|
Properties *google_protobuf.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{12} }
|
|
|
|
func (m *UpdateResponse) GetProperties() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
type DeleteRequest struct {
|
|
Id string `protobuf:"bytes,1,opt,name=id" json:"id,omitempty"`
|
|
Type string `protobuf:"bytes,2,opt,name=type" json:"type,omitempty"`
|
|
Properties *google_protobuf.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{13} }
|
|
|
|
func (m *DeleteRequest) GetId() string {
|
|
if m != nil {
|
|
return m.Id
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *DeleteRequest) GetType() string {
|
|
if m != nil {
|
|
return m.Type
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (m *DeleteRequest) GetProperties() *google_protobuf.Struct {
|
|
if m != nil {
|
|
return m.Properties
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func init() {
|
|
proto.RegisterType((*NameRequest)(nil), "lumirpc.NameRequest")
|
|
proto.RegisterType((*NameResponse)(nil), "lumirpc.NameResponse")
|
|
proto.RegisterType((*CheckRequest)(nil), "lumirpc.CheckRequest")
|
|
proto.RegisterType((*CheckResponse)(nil), "lumirpc.CheckResponse")
|
|
proto.RegisterType((*CheckFailure)(nil), "lumirpc.CheckFailure")
|
|
proto.RegisterType((*DiffRequest)(nil), "lumirpc.DiffRequest")
|
|
proto.RegisterType((*DiffResponse)(nil), "lumirpc.DiffResponse")
|
|
proto.RegisterType((*CreateRequest)(nil), "lumirpc.CreateRequest")
|
|
proto.RegisterType((*CreateResponse)(nil), "lumirpc.CreateResponse")
|
|
proto.RegisterType((*GetRequest)(nil), "lumirpc.GetRequest")
|
|
proto.RegisterType((*GetResponse)(nil), "lumirpc.GetResponse")
|
|
proto.RegisterType((*UpdateRequest)(nil), "lumirpc.UpdateRequest")
|
|
proto.RegisterType((*UpdateResponse)(nil), "lumirpc.UpdateResponse")
|
|
proto.RegisterType((*DeleteRequest)(nil), "lumirpc.DeleteRequest")
|
|
}
|
|
|
|
// Reference imports to suppress errors if they are not otherwise used.
|
|
var _ context.Context
|
|
var _ grpc.ClientConn
|
|
|
|
// This is a compile-time assertion to ensure that this generated file
|
|
// is compatible with the grpc package it is being compiled against.
|
|
const _ = grpc.SupportPackageIsVersion4
|
|
|
|
// Client API for ResourceProvider service
|
|
|
|
type ResourceProviderClient interface {
|
|
// Name names a given resource. Sometimes this will be assigned by a developer, and so the provider
|
|
// simply fetches it from the property bag; other times, the provider will assign this based on its own algorithm.
|
|
// In any case, resources with the same name must be safe to use interchangeably with one another.
|
|
Name(ctx context.Context, in *NameRequest, opts ...grpc.CallOption) (*NameResponse, error)
|
|
// Check validates that the given property bag is valid for a resource of the given type.
|
|
Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error)
|
|
// Diff checks what impacts a hypothetical update will have on the resource's properties.
|
|
Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error)
|
|
// Create allocates a new instance of the provided resource and returns its unique ID afterwards. (The input ID
|
|
// must be blank.) If this call fails, the resource must not have been created (i.e., it is "transacational").
|
|
Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
|
|
// Get reads the instance state identified by ID, returning a populated resource object, or nil if not found.
|
|
Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
|
|
// 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)
|
|
}
|
|
|
|
type resourceProviderClient struct {
|
|
cc *grpc.ClientConn
|
|
}
|
|
|
|
func NewResourceProviderClient(cc *grpc.ClientConn) ResourceProviderClient {
|
|
return &resourceProviderClient{cc}
|
|
}
|
|
|
|
func (c *resourceProviderClient) Name(ctx context.Context, in *NameRequest, opts ...grpc.CallOption) (*NameResponse, error) {
|
|
out := new(NameResponse)
|
|
err := grpc.Invoke(ctx, "/lumirpc.ResourceProvider/Name", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resourceProviderClient) Check(ctx context.Context, in *CheckRequest, opts ...grpc.CallOption) (*CheckResponse, error) {
|
|
out := new(CheckResponse)
|
|
err := grpc.Invoke(ctx, "/lumirpc.ResourceProvider/Check", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resourceProviderClient) Diff(ctx context.Context, in *DiffRequest, opts ...grpc.CallOption) (*DiffResponse, error) {
|
|
out := new(DiffResponse)
|
|
err := grpc.Invoke(ctx, "/lumirpc.ResourceProvider/Diff", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resourceProviderClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
|
|
out := new(CreateResponse)
|
|
err := grpc.Invoke(ctx, "/lumirpc.ResourceProvider/Create", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resourceProviderClient) Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error) {
|
|
out := new(GetResponse)
|
|
err := grpc.Invoke(ctx, "/lumirpc.ResourceProvider/Get", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resourceProviderClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) {
|
|
out := new(UpdateResponse)
|
|
err := grpc.Invoke(ctx, "/lumirpc.ResourceProvider/Update", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
func (c *resourceProviderClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*google_protobuf1.Empty, error) {
|
|
out := new(google_protobuf1.Empty)
|
|
err := grpc.Invoke(ctx, "/lumirpc.ResourceProvider/Delete", in, out, c.cc, opts...)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|
|
|
|
// Server API for ResourceProvider service
|
|
|
|
type ResourceProviderServer interface {
|
|
// Name names a given resource. Sometimes this will be assigned by a developer, and so the provider
|
|
// simply fetches it from the property bag; other times, the provider will assign this based on its own algorithm.
|
|
// In any case, resources with the same name must be safe to use interchangeably with one another.
|
|
Name(context.Context, *NameRequest) (*NameResponse, error)
|
|
// Check validates that the given property bag is valid for a resource of the given type.
|
|
Check(context.Context, *CheckRequest) (*CheckResponse, error)
|
|
// Diff checks what impacts a hypothetical update will have on the resource's properties.
|
|
Diff(context.Context, *DiffRequest) (*DiffResponse, error)
|
|
// Create allocates a new instance of the provided resource and returns its unique ID afterwards. (The input ID
|
|
// must be blank.) If this call fails, the resource must not have been created (i.e., it is "transacational").
|
|
Create(context.Context, *CreateRequest) (*CreateResponse, error)
|
|
// Get reads the instance state identified by ID, returning a populated resource object, or nil if not found.
|
|
Get(context.Context, *GetRequest) (*GetResponse, error)
|
|
// 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)
|
|
}
|
|
|
|
func RegisterResourceProviderServer(s *grpc.Server, srv ResourceProviderServer) {
|
|
s.RegisterService(&_ResourceProvider_serviceDesc, srv)
|
|
}
|
|
|
|
func _ResourceProvider_Name_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(NameRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceProviderServer).Name(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lumirpc.ResourceProvider/Name",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceProviderServer).Name(ctx, req.(*NameRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResourceProvider_Check_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CheckRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceProviderServer).Check(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lumirpc.ResourceProvider/Check",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceProviderServer).Check(ctx, req.(*CheckRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResourceProvider_Diff_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DiffRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceProviderServer).Diff(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lumirpc.ResourceProvider/Diff",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceProviderServer).Diff(ctx, req.(*DiffRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResourceProvider_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(CreateRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceProviderServer).Create(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lumirpc.ResourceProvider/Create",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceProviderServer).Create(ctx, req.(*CreateRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResourceProvider_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(GetRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceProviderServer).Get(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lumirpc.ResourceProvider/Get",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceProviderServer).Get(ctx, req.(*GetRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResourceProvider_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(UpdateRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceProviderServer).Update(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lumirpc.ResourceProvider/Update",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceProviderServer).Update(ctx, req.(*UpdateRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
func _ResourceProvider_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
|
in := new(DeleteRequest)
|
|
if err := dec(in); err != nil {
|
|
return nil, err
|
|
}
|
|
if interceptor == nil {
|
|
return srv.(ResourceProviderServer).Delete(ctx, in)
|
|
}
|
|
info := &grpc.UnaryServerInfo{
|
|
Server: srv,
|
|
FullMethod: "/lumirpc.ResourceProvider/Delete",
|
|
}
|
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
|
return srv.(ResourceProviderServer).Delete(ctx, req.(*DeleteRequest))
|
|
}
|
|
return interceptor(ctx, in, info, handler)
|
|
}
|
|
|
|
var _ResourceProvider_serviceDesc = grpc.ServiceDesc{
|
|
ServiceName: "lumirpc.ResourceProvider",
|
|
HandlerType: (*ResourceProviderServer)(nil),
|
|
Methods: []grpc.MethodDesc{
|
|
{
|
|
MethodName: "Name",
|
|
Handler: _ResourceProvider_Name_Handler,
|
|
},
|
|
{
|
|
MethodName: "Check",
|
|
Handler: _ResourceProvider_Check_Handler,
|
|
},
|
|
{
|
|
MethodName: "Diff",
|
|
Handler: _ResourceProvider_Diff_Handler,
|
|
},
|
|
{
|
|
MethodName: "Create",
|
|
Handler: _ResourceProvider_Create_Handler,
|
|
},
|
|
{
|
|
MethodName: "Get",
|
|
Handler: _ResourceProvider_Get_Handler,
|
|
},
|
|
{
|
|
MethodName: "Update",
|
|
Handler: _ResourceProvider_Update_Handler,
|
|
},
|
|
{
|
|
MethodName: "Delete",
|
|
Handler: _ResourceProvider_Delete_Handler,
|
|
},
|
|
},
|
|
Streams: []grpc.StreamDesc{},
|
|
Metadata: "provider.proto",
|
|
}
|
|
|
|
func init() { proto.RegisterFile("provider.proto", fileDescriptor3) }
|
|
|
|
var fileDescriptor3 = []byte{
|
|
// 546 bytes of a gzipped FileDescriptorProto
|
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xc4, 0x55, 0x5f, 0x6f, 0xd3, 0x30,
|
|
0x10, 0x6f, 0x9a, 0x52, 0xba, 0xeb, 0x5a, 0x21, 0xb3, 0x75, 0x55, 0xe0, 0x61, 0xf2, 0x53, 0x05,
|
|
0x52, 0x06, 0x9d, 0x26, 0x10, 0xbc, 0xb1, 0xb1, 0x89, 0x17, 0x84, 0x82, 0x78, 0xe0, 0xcf, 0x4b,
|
|
0xd6, 0x5c, 0x46, 0x44, 0x5a, 0x1b, 0xdb, 0x61, 0xea, 0x67, 0x40, 0x7c, 0x0b, 0x3e, 0x28, 0x8a,
|
|
0xed, 0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