The very first cut of .NET Support

Just enough to manually invoke the resource providers, but code like
the following worked:

```
[matell@matell bucket]$ cat Pulumi.yaml
name: bucket
runtime: dotnet
[matell@matell bucket]$ cat main.csx
using Pulumi;
using System;
using System.Runtime.InteropServices;

Config config = new Config("bucket");
CustomResource r = new CustomResource("aws:s3/bucket:Bucket", config["name"]);
[matell@matell bucket]$ pulumi update
Performing changes:
info: Running with 🍹 on .NET Core 4.6.00001.0 on Linux 4.14.11-300.fc27.x86_64 #1 SMP Wed Jan 3 13:52:28 UTC 2018
+ pulumi:pulumi:Stack: (create)
    [urn=urn:pulumi:dotnet-testing:🪣:pulumi:pulumi:Stack::bucket-dotnet-testing]
    + aws:s3/bucket:Bucket: (create)
        [urn=urn:pulumi:dotnet-testing:🪣:aws:s3/bucket:Bucket::hello-aws-from-dotnet]
        acl         : "private"
        bucket      : "hello-aws-from-dotnet-a37c2a3"
        forceDestroy: false
        ---outputs:---
        arn                              : "arn:aws:s3:::hello-aws-from-dotnet-a37c2a3"
        bucketDomainName                 : "hello-aws-from-dotnet-a37c2a3.s3.amazonaws.com"
        hostedZoneId                     : "Z3BJ6K6RIION7M"
        id                               : "hello-aws-from-dotnet-a37c2a3"
        region                           : "us-west-2"
        requestPayer                     : "BucketOwner"
        versioning                       : [
            [0]: {
                enabled  : false
                mfaDelete: false
            }
        ]
info: 2 changes performed:
    + 2 resources created
Update duration: 11.799058053s
[matell@matell bucket]$
```
This commit is contained in:
Matt Ellis 2018-03-04 21:38:52 -08:00
parent 683f80ded8
commit 7deaf24987
28 changed files with 6897 additions and 0 deletions

3
sdk/dotnet/.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
[Bb]in/
[Oo]bj/

View file

@ -0,0 +1,28 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.0/DummyHost.dll",
"args": [],
"cwd": "${workspaceFolder}",
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
"console": "internalConsole",
"stopAtEntry": false,
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickProcess}"
}
]
}

View file

@ -0,0 +1,27 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/pulumi-language-dotnet-exec.csproj"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"-r",
"linux-x64",
"${workspaceFolder}/pulumi-language-dotnet-exec.csproj"
],
"problemMatcher": "$msCompile"
}
]
}

View file

@ -0,0 +1,63 @@
using Grpc.Core;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp.Scripting;
using Microsoft.CodeAnalysis.Scripting;
using Microsoft.CodeAnalysis.Scripting.Hosting;
using Mono.Options;
using Pulumi;
using Pulumirpc;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.IO;
using System.Runtime.InteropServices;
namespace Pulumi.Host
{
class Program
{
static void Main(string[] args)
{
string monitor = "";
string engine = "";
string project = "";
string stack = "";
string pwd = "";
string dryRun = "";
int parallel = 1;
string tracing = "";
OptionSet o = new OptionSet {
{"monitor=", "", m => monitor = m },
{"engine=", "", e => engine = e},
{"project=", "", p => project = p},
{"stack=", "", s => stack = s },
{"pwd=", "", wd => pwd = wd},
{"dry_run=", dry => dryRun = dry},
{"parallel=", (int n) => parallel = n},
{"tracing=", t => tracing = t},
};
List<string> extra = o.Parse(args);
Channel engineChannel = new Channel(engine, ChannelCredentials.Insecure);
Channel monitorChannel = new Channel(monitor, ChannelCredentials.Insecure);
Runtime.Initialize(new Runtime.Settings(new Engine.EngineClient(engineChannel),
new ResourceMonitor.ResourceMonitorClient(monitorChannel),
stack, project, parallel, true));
Console.WriteLine($"Running with \U0001F379 on {RuntimeInformation.FrameworkDescription} on {RuntimeInformation.OSDescription}");
Script<object> script = CSharpScript.Create(File.OpenRead("main.csx"));
script.Compile();
Runtime.RunInStack(() => {
script.RunAsync().Wait();
});
engineChannel.ShutdownAsync().Wait();
monitorChannel.ShutdownAsync().Wait();
}
}
}

View file

@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\Pulumirpc\Pulumirpc.csproj" />
<ProjectReference Include="..\Pulumi\Pulumi.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Grpc.Core" Version="1.10.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.6.1" />
<PackageReference Include="Mono.Options" Version="5.3.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
<PackageReference Include="System.Threading.ThreadPool" Version="4.3.0" />
</ItemGroup>
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
namespace Pulumi
{
public class ComponentResource : Resource
{
public ComponentResource(string type, string name, Dictionary<string, object> properties = null, ResourceOptions options = default(ResourceOptions))
{
Register(type, name, false, properties, options);
}
}
}

View file

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Pulumi {
public class Config {
private string m_prefix;
private static Dictionary<string, string> s_config = loadConfig();
static Dictionary<string, string> loadConfig() {
string envValue = Environment.GetEnvironmentVariable("PULUMI_CONFIG");
if (envValue != null) {
return JsonConvert.DeserializeObject<Dictionary<string, string>>(envValue);
}
return new Dictionary<string, string>();
}
public Config(string name) {
m_prefix = name;
}
private string FullKey(string name) {
return m_prefix + ":" + name;
}
public string this[string name] {
get {
return s_config[FullKey(name)];
}
}
}
}

View file

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
namespace Pulumi {
public class CustomResource : Resource {
public string Id {get; internal set;}
public CustomResource(string type, string name, Dictionary<string, object> properties = null, ResourceOptions options = default(ResourceOptions)) {
var res = Register(type, name, true, properties, options);
Id = res.Id;
}
}
}

19
sdk/dotnet/Pulumi/Log.cs Normal file
View file

@ -0,0 +1,19 @@
using Pulumirpc;
namespace Pulumi {
public static class Log {
public static void Info(string format, params object[] args) {
Runtime.Engine.Log(new Pulumirpc.LogRequest {
Severity = LogSeverity.Info,
Message = string.Format(format, args)
});
}
public static void Warning(string format, params object[] args) {
Runtime.Engine.Log(new Pulumirpc.LogRequest {
Severity = LogSeverity.Warning,
Message = string.Format(format, args)
});
}
}
}

View file

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<ItemGroup>
<ProjectReference Include="..\Pulumirpc\Pulumirpc.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
</ItemGroup>
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,44 @@
using Pulumirpc;
using System;
using System.Collections.Generic;
namespace Pulumi
{
public abstract class Resource
{
public string Urn { get; private set; }
public const string UnkownResourceId = "04da6b54-80e4-46f7-96ec-b56ff0331ba9";
public Resource()
{
}
protected RegisterResourceResponse Register(string type, string name, bool custom, Dictionary<string, object> properties, ResourceOptions options) {
if (string.IsNullOrEmpty(type))
{
throw new ArgumentException(nameof(type));
}
if (string.IsNullOrEmpty(name))
{
throw new ArgumentException(nameof(name));
}
RegisterResourceResponse res = Runtime.Monitor.RegisterResource(
new RegisterResourceRequest()
{
Type = type,
Name = name,
Custom = custom,
Protect = false,
Object = new Google.Protobuf.WellKnownTypes.Struct(),
Parent = options.Parent?.Urn ?? Runtime.Root?.Urn ?? "",
});
Urn = res.Urn;
return res;
}
}
}

View file

@ -0,0 +1,17 @@
using System;
namespace Pulumi {
public struct ResourceOptions {
public static ResourceOptions None = default(ResourceOptions);
public Resource Parent {get; set;}
public Resource[] DependsOn {get; set;}
public bool Protect {get; set;}
public ResourceOptions WithParent(Resource parent) {
var n = this;
n.Parent = parent;
return n;
}
}
}

View file

@ -0,0 +1,55 @@
using System;
using Pulumirpc;
namespace Pulumi
{
public static class Runtime
{
public static string Stack { get; private set; }
public static Engine.EngineClient Engine { get; private set; }
public static ResourceMonitor.ResourceMonitorClient Monitor { get; private set; }
public static string Project { get; private set; }
public static bool DryRun { get; private set; }
internal static ComponentResource Root {get; private set;}
public static void Initialize(Settings settings)
{
Engine = settings.Engine;
Monitor = settings.Monitor;
Project = settings.Project;
Stack = settings.Stack;
DryRun = DryRun;
}
public static void RunInStack(Action run)
{
Root = new ComponentResource("pulumi:pulumi:Stack", $"{Runtime.Project}-{Runtime.Stack}", null, ResourceOptions.None);
run();
}
public class Settings
{
public string Project { get; set; }
public Engine.EngineClient Engine { get; set; }
public ResourceMonitor.ResourceMonitorClient Monitor { get; set; }
public string Stack { get; set; }
public int Parallel { get; set; }
public bool DryRun { get; set; }
public Settings(Engine.EngineClient engineClient, ResourceMonitor.ResourceMonitorClient monitorClient, string stack, string project, int parallel, bool dryRun)
{
Engine = engineClient;
Monitor = monitorClient;
Stack = stack;
Project = project;
Parallel = parallel;
DryRun = dryRun;
}
}
}
}

View file

@ -0,0 +1,471 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: analyzer.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Pulumirpc {
/// <summary>Holder for reflection information generated from analyzer.proto</summary>
public static partial class AnalyzerReflection {
#region Descriptor
/// <summary>File descriptor for analyzer.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static AnalyzerReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cg5hbmFseXplci5wcm90bxIJcHVsdW1pcnBjGgxwbHVnaW4ucHJvdG8aG2dv",
"b2dsZS9wcm90b2J1Zi9lbXB0eS5wcm90bxocZ29vZ2xlL3Byb3RvYnVmL3N0",
"cnVjdC5wcm90byJLCg5BbmFseXplUmVxdWVzdBIMCgR0eXBlGAEgASgJEisK",
"CnByb3BlcnRpZXMYAiABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0Ij4K",
"D0FuYWx5emVSZXNwb25zZRIrCghmYWlsdXJlcxgBIAMoCzIZLnB1bHVtaXJw",
"Yy5BbmFseXplRmFpbHVyZSIyCg5BbmFseXplRmFpbHVyZRIQCghwcm9wZXJ0",
"eRgBIAEoCRIOCgZyZWFzb24YAiABKAkykAEKCEFuYWx5emVyEkIKB0FuYWx5",
"emUSGS5wdWx1bWlycGMuQW5hbHl6ZVJlcXVlc3QaGi5wdWx1bWlycGMuQW5h",
"bHl6ZVJlc3BvbnNlIgASQAoNR2V0UGx1Z2luSW5mbxIWLmdvb2dsZS5wcm90",
"b2J1Zi5FbXB0eRoVLnB1bHVtaXJwYy5QbHVnaW5JbmZvIgBiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Pulumirpc.PluginReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.AnalyzeRequest), global::Pulumirpc.AnalyzeRequest.Parser, new[]{ "Type", "Properties" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.AnalyzeResponse), global::Pulumirpc.AnalyzeResponse.Parser, new[]{ "Failures" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.AnalyzeFailure), global::Pulumirpc.AnalyzeFailure.Parser, new[]{ "Property", "Reason" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class AnalyzeRequest : pb::IMessage<AnalyzeRequest> {
private static readonly pb::MessageParser<AnalyzeRequest> _parser = new pb::MessageParser<AnalyzeRequest>(() => new AnalyzeRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AnalyzeRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.AnalyzerReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AnalyzeRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AnalyzeRequest(AnalyzeRequest other) : this() {
type_ = other.type_;
Properties = other.properties_ != null ? other.Properties.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AnalyzeRequest Clone() {
return new AnalyzeRequest(this);
}
/// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 1;
private string type_ = "";
/// <summary>
/// the type token of the resource.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Type {
get { return type_; }
set {
type_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "properties" field.</summary>
public const int PropertiesFieldNumber = 2;
private global::Google.Protobuf.WellKnownTypes.Struct properties_;
/// <summary>
/// the full properties to use for validation.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Struct Properties {
get { return properties_; }
set {
properties_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as AnalyzeRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(AnalyzeRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Type != other.Type) return false;
if (!object.Equals(Properties, other.Properties)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Type.Length != 0) hash ^= Type.GetHashCode();
if (properties_ != null) hash ^= Properties.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Type.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Type);
}
if (properties_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Properties);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Type.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Type);
}
if (properties_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Properties);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(AnalyzeRequest other) {
if (other == null) {
return;
}
if (other.Type.Length != 0) {
Type = other.Type;
}
if (other.properties_ != null) {
if (properties_ == null) {
properties_ = new global::Google.Protobuf.WellKnownTypes.Struct();
}
Properties.MergeFrom(other.Properties);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Type = input.ReadString();
break;
}
case 18: {
if (properties_ == null) {
properties_ = new global::Google.Protobuf.WellKnownTypes.Struct();
}
input.ReadMessage(properties_);
break;
}
}
}
}
}
public sealed partial class AnalyzeResponse : pb::IMessage<AnalyzeResponse> {
private static readonly pb::MessageParser<AnalyzeResponse> _parser = new pb::MessageParser<AnalyzeResponse>(() => new AnalyzeResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AnalyzeResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.AnalyzerReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AnalyzeResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AnalyzeResponse(AnalyzeResponse other) : this() {
failures_ = other.failures_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AnalyzeResponse Clone() {
return new AnalyzeResponse(this);
}
/// <summary>Field number for the "failures" field.</summary>
public const int FailuresFieldNumber = 1;
private static readonly pb::FieldCodec<global::Pulumirpc.AnalyzeFailure> _repeated_failures_codec
= pb::FieldCodec.ForMessage(10, global::Pulumirpc.AnalyzeFailure.Parser);
private readonly pbc::RepeatedField<global::Pulumirpc.AnalyzeFailure> failures_ = new pbc::RepeatedField<global::Pulumirpc.AnalyzeFailure>();
/// <summary>
/// the failures (or empty if none).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Pulumirpc.AnalyzeFailure> Failures {
get { return failures_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as AnalyzeResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(AnalyzeResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!failures_.Equals(other.failures_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= failures_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
failures_.WriteTo(output, _repeated_failures_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += failures_.CalculateSize(_repeated_failures_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(AnalyzeResponse other) {
if (other == null) {
return;
}
failures_.Add(other.failures_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
failures_.AddEntriesFrom(input, _repeated_failures_codec);
break;
}
}
}
}
}
public sealed partial class AnalyzeFailure : pb::IMessage<AnalyzeFailure> {
private static readonly pb::MessageParser<AnalyzeFailure> _parser = new pb::MessageParser<AnalyzeFailure>(() => new AnalyzeFailure());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<AnalyzeFailure> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.AnalyzerReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AnalyzeFailure() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AnalyzeFailure(AnalyzeFailure other) : this() {
property_ = other.property_;
reason_ = other.reason_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public AnalyzeFailure Clone() {
return new AnalyzeFailure(this);
}
/// <summary>Field number for the "property" field.</summary>
public const int PropertyFieldNumber = 1;
private string property_ = "";
/// <summary>
/// the property that the analyzer rejected (or "" if general).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Property {
get { return property_; }
set {
property_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "reason" field.</summary>
public const int ReasonFieldNumber = 2;
private string reason_ = "";
/// <summary>
/// the reason that the analyzer rejected the request.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Reason {
get { return reason_; }
set {
reason_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as AnalyzeFailure);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(AnalyzeFailure other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Property != other.Property) return false;
if (Reason != other.Reason) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Property.Length != 0) hash ^= Property.GetHashCode();
if (Reason.Length != 0) hash ^= Reason.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Property.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Property);
}
if (Reason.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Reason);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Property.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Property);
}
if (Reason.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Reason);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(AnalyzeFailure other) {
if (other == null) {
return;
}
if (other.Property.Length != 0) {
Property = other.Property;
}
if (other.Reason.Length != 0) {
Reason = other.Reason;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Property = input.ReadString();
break;
}
case 18: {
Reason = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

View file

@ -0,0 +1,206 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: analyzer.proto
// </auto-generated>
// Original file comments:
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
//
#pragma warning disable 1591
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;
namespace Pulumirpc {
/// <summary>
/// Analyzer is a pluggable service that checks entire projects/stacks/snapshots, and/or individual resources,
/// for arbitrary issues. These might be style, policy, correctness, security, or performance related.
/// </summary>
public static partial class Analyzer
{
static readonly string __ServiceName = "pulumirpc.Analyzer";
static readonly grpc::Marshaller<global::Pulumirpc.AnalyzeRequest> __Marshaller_AnalyzeRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.AnalyzeRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.AnalyzeResponse> __Marshaller_AnalyzeResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.AnalyzeResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Google.Protobuf.WellKnownTypes.Empty> __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.Empty.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.PluginInfo> __Marshaller_PluginInfo = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.PluginInfo.Parser.ParseFrom);
static readonly grpc::Method<global::Pulumirpc.AnalyzeRequest, global::Pulumirpc.AnalyzeResponse> __Method_Analyze = new grpc::Method<global::Pulumirpc.AnalyzeRequest, global::Pulumirpc.AnalyzeResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Analyze",
__Marshaller_AnalyzeRequest,
__Marshaller_AnalyzeResponse);
static readonly grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Pulumirpc.PluginInfo> __Method_GetPluginInfo = new grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Pulumirpc.PluginInfo>(
grpc::MethodType.Unary,
__ServiceName,
"GetPluginInfo",
__Marshaller_Empty,
__Marshaller_PluginInfo);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Pulumirpc.AnalyzerReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of Analyzer</summary>
public abstract partial class AnalyzerBase
{
/// <summary>
/// Analyze analyzes a single resource object, and returns any errors that it finds.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.AnalyzeResponse> Analyze(global::Pulumirpc.AnalyzeRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.PluginInfo> GetPluginInfo(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for Analyzer</summary>
public partial class AnalyzerClient : grpc::ClientBase<AnalyzerClient>
{
/// <summary>Creates a new client for Analyzer</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public AnalyzerClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for Analyzer that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public AnalyzerClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected AnalyzerClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected AnalyzerClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
/// <summary>
/// Analyze analyzes a single resource object, and returns any errors that it finds.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.AnalyzeResponse Analyze(global::Pulumirpc.AnalyzeRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Analyze(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Analyze analyzes a single resource object, and returns any errors that it finds.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.AnalyzeResponse Analyze(global::Pulumirpc.AnalyzeRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Analyze, null, options, request);
}
/// <summary>
/// Analyze analyzes a single resource object, and returns any errors that it finds.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.AnalyzeResponse> AnalyzeAsync(global::Pulumirpc.AnalyzeRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return AnalyzeAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Analyze analyzes a single resource object, and returns any errors that it finds.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.AnalyzeResponse> AnalyzeAsync(global::Pulumirpc.AnalyzeRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Analyze, null, options, request);
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.PluginInfo GetPluginInfo(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return GetPluginInfo(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.PluginInfo GetPluginInfo(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_GetPluginInfo, null, options, request);
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.PluginInfo> GetPluginInfoAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return GetPluginInfoAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.PluginInfo> GetPluginInfoAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_GetPluginInfo, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override AnalyzerClient NewInstance(ClientBaseConfiguration configuration)
{
return new AnalyzerClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(AnalyzerBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_Analyze, serviceImpl.Analyze)
.AddMethod(__Method_GetPluginInfo, serviceImpl.GetPluginInfo).Build();
}
}
}
#endregion

View file

@ -0,0 +1,221 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: engine.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Pulumirpc {
/// <summary>Holder for reflection information generated from engine.proto</summary>
public static partial class EngineReflection {
#region Descriptor
/// <summary>File descriptor for engine.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static EngineReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CgxlbmdpbmUucHJvdG8SCXB1bHVtaXJwYxobZ29vZ2xlL3Byb3RvYnVmL2Vt",
"cHR5LnByb3RvIkcKCkxvZ1JlcXVlc3QSKAoIc2V2ZXJpdHkYASABKA4yFi5w",
"dWx1bWlycGMuTG9nU2V2ZXJpdHkSDwoHbWVzc2FnZRgCIAEoCSo6CgtMb2dT",
"ZXZlcml0eRIJCgVERUJVRxAAEggKBElORk8QARILCgdXQVJOSU5HEAISCQoF",
"RVJST1IQAzJACgZFbmdpbmUSNgoDTG9nEhUucHVsdW1pcnBjLkxvZ1JlcXVl",
"c3QaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiAGIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Pulumirpc.LogSeverity), }, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.LogRequest), global::Pulumirpc.LogRequest.Parser, new[]{ "Severity", "Message" }, null, null, null)
}));
}
#endregion
}
#region Enums
/// <summary>
/// LogSeverity is the severity level of a log message. Errors are fatal; all others are informational.
/// </summary>
public enum LogSeverity {
/// <summary>
/// a debug-level message not displayed to end-users (the default).
/// </summary>
[pbr::OriginalName("DEBUG")] Debug = 0,
/// <summary>
/// an informational message printed to output during resource operations.
/// </summary>
[pbr::OriginalName("INFO")] Info = 1,
/// <summary>
/// a warning to indicate that something went wrong.
/// </summary>
[pbr::OriginalName("WARNING")] Warning = 2,
/// <summary>
/// a fatal error indicating that the tool should stop processing subsequent resource operations.
/// </summary>
[pbr::OriginalName("ERROR")] Error = 3,
}
#endregion
#region Messages
public sealed partial class LogRequest : pb::IMessage<LogRequest> {
private static readonly pb::MessageParser<LogRequest> _parser = new pb::MessageParser<LogRequest>(() => new LogRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<LogRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.EngineReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public LogRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public LogRequest(LogRequest other) : this() {
severity_ = other.severity_;
message_ = other.message_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public LogRequest Clone() {
return new LogRequest(this);
}
/// <summary>Field number for the "severity" field.</summary>
public const int SeverityFieldNumber = 1;
private global::Pulumirpc.LogSeverity severity_ = 0;
/// <summary>
/// the logging level of this message.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Pulumirpc.LogSeverity Severity {
get { return severity_; }
set {
severity_ = value;
}
}
/// <summary>Field number for the "message" field.</summary>
public const int MessageFieldNumber = 2;
private string message_ = "";
/// <summary>
/// the contents of the logged message.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Message {
get { return message_; }
set {
message_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as LogRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(LogRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Severity != other.Severity) return false;
if (Message != other.Message) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Severity != 0) hash ^= Severity.GetHashCode();
if (Message.Length != 0) hash ^= Message.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Severity != 0) {
output.WriteRawTag(8);
output.WriteEnum((int) Severity);
}
if (Message.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Message);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Severity != 0) {
size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Severity);
}
if (Message.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Message);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(LogRequest other) {
if (other == null) {
return;
}
if (other.Severity != 0) {
Severity = other.Severity;
}
if (other.Message.Length != 0) {
Message = other.Message;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 8: {
severity_ = (global::Pulumirpc.LogSeverity) input.ReadEnum();
break;
}
case 18: {
Message = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

View file

@ -0,0 +1,140 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: engine.proto
// </auto-generated>
// Original file comments:
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
//
#pragma warning disable 1591
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;
namespace Pulumirpc {
/// <summary>
/// Engine is an interface into the core engine responsible for orchestrating resource operations.
/// </summary>
public static partial class Engine
{
static readonly string __ServiceName = "pulumirpc.Engine";
static readonly grpc::Marshaller<global::Pulumirpc.LogRequest> __Marshaller_LogRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.LogRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Google.Protobuf.WellKnownTypes.Empty> __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.Empty.Parser.ParseFrom);
static readonly grpc::Method<global::Pulumirpc.LogRequest, global::Google.Protobuf.WellKnownTypes.Empty> __Method_Log = new grpc::Method<global::Pulumirpc.LogRequest, global::Google.Protobuf.WellKnownTypes.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"Log",
__Marshaller_LogRequest,
__Marshaller_Empty);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Pulumirpc.EngineReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of Engine</summary>
public abstract partial class EngineBase
{
/// <summary>
/// Log logs a global message in the engine, including errors and warnings.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> Log(global::Pulumirpc.LogRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for Engine</summary>
public partial class EngineClient : grpc::ClientBase<EngineClient>
{
/// <summary>Creates a new client for Engine</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public EngineClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for Engine that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public EngineClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected EngineClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected EngineClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
/// <summary>
/// Log logs a global message in the engine, including errors and warnings.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Google.Protobuf.WellKnownTypes.Empty Log(global::Pulumirpc.LogRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Log(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Log logs a global message in the engine, including errors and warnings.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Google.Protobuf.WellKnownTypes.Empty Log(global::Pulumirpc.LogRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Log, null, options, request);
}
/// <summary>
/// Log logs a global message in the engine, including errors and warnings.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> LogAsync(global::Pulumirpc.LogRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return LogAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Log logs a global message in the engine, including errors and warnings.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> LogAsync(global::Pulumirpc.LogRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Log, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override EngineClient NewInstance(ClientBaseConfiguration configuration)
{
return new EngineClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(EngineBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_Log, serviceImpl.Log).Build();
}
}
}
#endregion

View file

@ -0,0 +1,831 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: language.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Pulumirpc {
/// <summary>Holder for reflection information generated from language.proto</summary>
public static partial class LanguageReflection {
#region Descriptor
/// <summary>File descriptor for language.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static LanguageReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cg5sYW5ndWFnZS5wcm90bxIJcHVsdW1pcnBjGgxwbHVnaW4ucHJvdG8aG2dv",
"b2dsZS9wcm90b2J1Zi9lbXB0eS5wcm90byJKChlHZXRSZXF1aXJlZFBsdWdp",
"bnNSZXF1ZXN0Eg8KB3Byb2plY3QYASABKAkSCwoDcHdkGAIgASgJEg8KB3By",
"b2dyYW0YAyABKAkiSgoaR2V0UmVxdWlyZWRQbHVnaW5zUmVzcG9uc2USLAoH",
"cGx1Z2lucxgBIAMoCzIbLnB1bHVtaXJwYy5QbHVnaW5EZXBlbmRlbmN5IvUB",
"CgpSdW5SZXF1ZXN0Eg8KB3Byb2plY3QYASABKAkSDQoFc3RhY2sYAiABKAkS",
"CwoDcHdkGAMgASgJEg8KB3Byb2dyYW0YBCABKAkSDAoEYXJncxgFIAMoCRIx",
"CgZjb25maWcYBiADKAsyIS5wdWx1bWlycGMuUnVuUmVxdWVzdC5Db25maWdF",
"bnRyeRIOCgZkcnlSdW4YByABKAgSEAoIcGFyYWxsZWwYCCABKAUSFwoPbW9u",
"aXRvcl9hZGRyZXNzGAkgASgJGi0KC0NvbmZpZ0VudHJ5EgsKA2tleRgBIAEo",
"CRINCgV2YWx1ZRgCIAEoCToCOAEiHAoLUnVuUmVzcG9uc2USDQoFZXJyb3IY",
"ASABKAky8AEKD0xhbmd1YWdlUnVudGltZRJjChJHZXRSZXF1aXJlZFBsdWdp",
"bnMSJC5wdWx1bWlycGMuR2V0UmVxdWlyZWRQbHVnaW5zUmVxdWVzdBolLnB1",
"bHVtaXJwYy5HZXRSZXF1aXJlZFBsdWdpbnNSZXNwb25zZSIAEjYKA1J1bhIV",
"LnB1bHVtaXJwYy5SdW5SZXF1ZXN0GhYucHVsdW1pcnBjLlJ1blJlc3BvbnNl",
"IgASQAoNR2V0UGx1Z2luSW5mbxIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoV",
"LnB1bHVtaXJwYy5QbHVnaW5JbmZvIgBiBnByb3RvMw=="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Pulumirpc.PluginReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.GetRequiredPluginsRequest), global::Pulumirpc.GetRequiredPluginsRequest.Parser, new[]{ "Project", "Pwd", "Program" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.GetRequiredPluginsResponse), global::Pulumirpc.GetRequiredPluginsResponse.Parser, new[]{ "Plugins" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.RunRequest), global::Pulumirpc.RunRequest.Parser, new[]{ "Project", "Stack", "Pwd", "Program", "Args", "Config", "DryRun", "Parallel", "MonitorAddress" }, null, null, new pbr::GeneratedClrTypeInfo[] { null, }),
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.RunResponse), global::Pulumirpc.RunResponse.Parser, new[]{ "Error" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class GetRequiredPluginsRequest : pb::IMessage<GetRequiredPluginsRequest> {
private static readonly pb::MessageParser<GetRequiredPluginsRequest> _parser = new pb::MessageParser<GetRequiredPluginsRequest>(() => new GetRequiredPluginsRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GetRequiredPluginsRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.LanguageReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetRequiredPluginsRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetRequiredPluginsRequest(GetRequiredPluginsRequest other) : this() {
project_ = other.project_;
pwd_ = other.pwd_;
program_ = other.program_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetRequiredPluginsRequest Clone() {
return new GetRequiredPluginsRequest(this);
}
/// <summary>Field number for the "project" field.</summary>
public const int ProjectFieldNumber = 1;
private string project_ = "";
/// <summary>
/// the project name.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Project {
get { return project_; }
set {
project_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "pwd" field.</summary>
public const int PwdFieldNumber = 2;
private string pwd_ = "";
/// <summary>
/// the program's working directory.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Pwd {
get { return pwd_; }
set {
pwd_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "program" field.</summary>
public const int ProgramFieldNumber = 3;
private string program_ = "";
/// <summary>
/// the path to the program.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Program {
get { return program_; }
set {
program_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GetRequiredPluginsRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GetRequiredPluginsRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Project != other.Project) return false;
if (Pwd != other.Pwd) return false;
if (Program != other.Program) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Project.Length != 0) hash ^= Project.GetHashCode();
if (Pwd.Length != 0) hash ^= Pwd.GetHashCode();
if (Program.Length != 0) hash ^= Program.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Project.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Project);
}
if (Pwd.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Pwd);
}
if (Program.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Program);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Project.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Project);
}
if (Pwd.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Pwd);
}
if (Program.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Program);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GetRequiredPluginsRequest other) {
if (other == null) {
return;
}
if (other.Project.Length != 0) {
Project = other.Project;
}
if (other.Pwd.Length != 0) {
Pwd = other.Pwd;
}
if (other.Program.Length != 0) {
Program = other.Program;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Project = input.ReadString();
break;
}
case 18: {
Pwd = input.ReadString();
break;
}
case 26: {
Program = input.ReadString();
break;
}
}
}
}
}
public sealed partial class GetRequiredPluginsResponse : pb::IMessage<GetRequiredPluginsResponse> {
private static readonly pb::MessageParser<GetRequiredPluginsResponse> _parser = new pb::MessageParser<GetRequiredPluginsResponse>(() => new GetRequiredPluginsResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<GetRequiredPluginsResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.LanguageReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetRequiredPluginsResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetRequiredPluginsResponse(GetRequiredPluginsResponse other) : this() {
plugins_ = other.plugins_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public GetRequiredPluginsResponse Clone() {
return new GetRequiredPluginsResponse(this);
}
/// <summary>Field number for the "plugins" field.</summary>
public const int PluginsFieldNumber = 1;
private static readonly pb::FieldCodec<global::Pulumirpc.PluginDependency> _repeated_plugins_codec
= pb::FieldCodec.ForMessage(10, global::Pulumirpc.PluginDependency.Parser);
private readonly pbc::RepeatedField<global::Pulumirpc.PluginDependency> plugins_ = new pbc::RepeatedField<global::Pulumirpc.PluginDependency>();
/// <summary>
/// a list of plugins required by this program.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<global::Pulumirpc.PluginDependency> Plugins {
get { return plugins_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as GetRequiredPluginsResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(GetRequiredPluginsResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if(!plugins_.Equals(other.plugins_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
hash ^= plugins_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
plugins_.WriteTo(output, _repeated_plugins_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
size += plugins_.CalculateSize(_repeated_plugins_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(GetRequiredPluginsResponse other) {
if (other == null) {
return;
}
plugins_.Add(other.plugins_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
plugins_.AddEntriesFrom(input, _repeated_plugins_codec);
break;
}
}
}
}
}
/// <summary>
/// RunRequest asks the interpreter to execute a program.
/// </summary>
public sealed partial class RunRequest : pb::IMessage<RunRequest> {
private static readonly pb::MessageParser<RunRequest> _parser = new pb::MessageParser<RunRequest>(() => new RunRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<RunRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.LanguageReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RunRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RunRequest(RunRequest other) : this() {
project_ = other.project_;
stack_ = other.stack_;
pwd_ = other.pwd_;
program_ = other.program_;
args_ = other.args_.Clone();
config_ = other.config_.Clone();
dryRun_ = other.dryRun_;
parallel_ = other.parallel_;
monitorAddress_ = other.monitorAddress_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RunRequest Clone() {
return new RunRequest(this);
}
/// <summary>Field number for the "project" field.</summary>
public const int ProjectFieldNumber = 1;
private string project_ = "";
/// <summary>
/// the project name.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Project {
get { return project_; }
set {
project_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "stack" field.</summary>
public const int StackFieldNumber = 2;
private string stack_ = "";
/// <summary>
/// the name of the stack being deployed into.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Stack {
get { return stack_; }
set {
stack_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "pwd" field.</summary>
public const int PwdFieldNumber = 3;
private string pwd_ = "";
/// <summary>
/// the program's working directory.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Pwd {
get { return pwd_; }
set {
pwd_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "program" field.</summary>
public const int ProgramFieldNumber = 4;
private string program_ = "";
/// <summary>
/// the path to the program to execute.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Program {
get { return program_; }
set {
program_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "args" field.</summary>
public const int ArgsFieldNumber = 5;
private static readonly pb::FieldCodec<string> _repeated_args_codec
= pb::FieldCodec.ForString(42);
private readonly pbc::RepeatedField<string> args_ = new pbc::RepeatedField<string>();
/// <summary>
/// any arguments to pass to the program.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> Args {
get { return args_; }
}
/// <summary>Field number for the "config" field.</summary>
public const int ConfigFieldNumber = 6;
private static readonly pbc::MapField<string, string>.Codec _map_config_codec
= new pbc::MapField<string, string>.Codec(pb::FieldCodec.ForString(10), pb::FieldCodec.ForString(18), 50);
private readonly pbc::MapField<string, string> config_ = new pbc::MapField<string, string>();
/// <summary>
/// the configuration variables to apply before running.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::MapField<string, string> Config {
get { return config_; }
}
/// <summary>Field number for the "dryRun" field.</summary>
public const int DryRunFieldNumber = 7;
private bool dryRun_;
/// <summary>
/// true if we're only doing a dryrun (preview).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool DryRun {
get { return dryRun_; }
set {
dryRun_ = value;
}
}
/// <summary>Field number for the "parallel" field.</summary>
public const int ParallelFieldNumber = 8;
private int parallel_;
/// <summary>
/// the degree of parallelism for resource operations (&lt;=1 for serial).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int Parallel {
get { return parallel_; }
set {
parallel_ = value;
}
}
/// <summary>Field number for the "monitor_address" field.</summary>
public const int MonitorAddressFieldNumber = 9;
private string monitorAddress_ = "";
/// <summary>
/// the address for communicating back to the resource monitor.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string MonitorAddress {
get { return monitorAddress_; }
set {
monitorAddress_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as RunRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(RunRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Project != other.Project) return false;
if (Stack != other.Stack) return false;
if (Pwd != other.Pwd) return false;
if (Program != other.Program) return false;
if(!args_.Equals(other.args_)) return false;
if (!Config.Equals(other.Config)) return false;
if (DryRun != other.DryRun) return false;
if (Parallel != other.Parallel) return false;
if (MonitorAddress != other.MonitorAddress) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Project.Length != 0) hash ^= Project.GetHashCode();
if (Stack.Length != 0) hash ^= Stack.GetHashCode();
if (Pwd.Length != 0) hash ^= Pwd.GetHashCode();
if (Program.Length != 0) hash ^= Program.GetHashCode();
hash ^= args_.GetHashCode();
hash ^= Config.GetHashCode();
if (DryRun != false) hash ^= DryRun.GetHashCode();
if (Parallel != 0) hash ^= Parallel.GetHashCode();
if (MonitorAddress.Length != 0) hash ^= MonitorAddress.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Project.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Project);
}
if (Stack.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Stack);
}
if (Pwd.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Pwd);
}
if (Program.Length != 0) {
output.WriteRawTag(34);
output.WriteString(Program);
}
args_.WriteTo(output, _repeated_args_codec);
config_.WriteTo(output, _map_config_codec);
if (DryRun != false) {
output.WriteRawTag(56);
output.WriteBool(DryRun);
}
if (Parallel != 0) {
output.WriteRawTag(64);
output.WriteInt32(Parallel);
}
if (MonitorAddress.Length != 0) {
output.WriteRawTag(74);
output.WriteString(MonitorAddress);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Project.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Project);
}
if (Stack.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Stack);
}
if (Pwd.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Pwd);
}
if (Program.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Program);
}
size += args_.CalculateSize(_repeated_args_codec);
size += config_.CalculateSize(_map_config_codec);
if (DryRun != false) {
size += 1 + 1;
}
if (Parallel != 0) {
size += 1 + pb::CodedOutputStream.ComputeInt32Size(Parallel);
}
if (MonitorAddress.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(MonitorAddress);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(RunRequest other) {
if (other == null) {
return;
}
if (other.Project.Length != 0) {
Project = other.Project;
}
if (other.Stack.Length != 0) {
Stack = other.Stack;
}
if (other.Pwd.Length != 0) {
Pwd = other.Pwd;
}
if (other.Program.Length != 0) {
Program = other.Program;
}
args_.Add(other.args_);
config_.Add(other.config_);
if (other.DryRun != false) {
DryRun = other.DryRun;
}
if (other.Parallel != 0) {
Parallel = other.Parallel;
}
if (other.MonitorAddress.Length != 0) {
MonitorAddress = other.MonitorAddress;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Project = input.ReadString();
break;
}
case 18: {
Stack = input.ReadString();
break;
}
case 26: {
Pwd = input.ReadString();
break;
}
case 34: {
Program = input.ReadString();
break;
}
case 42: {
args_.AddEntriesFrom(input, _repeated_args_codec);
break;
}
case 50: {
config_.AddEntriesFrom(input, _map_config_codec);
break;
}
case 56: {
DryRun = input.ReadBool();
break;
}
case 64: {
Parallel = input.ReadInt32();
break;
}
case 74: {
MonitorAddress = input.ReadString();
break;
}
}
}
}
}
/// <summary>
/// RunResponse is the response back from the interpreter/source back to the monitor.
/// </summary>
public sealed partial class RunResponse : pb::IMessage<RunResponse> {
private static readonly pb::MessageParser<RunResponse> _parser = new pb::MessageParser<RunResponse>(() => new RunResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<RunResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.LanguageReflection.Descriptor.MessageTypes[3]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RunResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RunResponse(RunResponse other) : this() {
error_ = other.error_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RunResponse Clone() {
return new RunResponse(this);
}
/// <summary>Field number for the "error" field.</summary>
public const int ErrorFieldNumber = 1;
private string error_ = "";
/// <summary>
/// an unhandled error if any occurred.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Error {
get { return error_; }
set {
error_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as RunResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(RunResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Error != other.Error) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Error.Length != 0) hash ^= Error.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Error.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Error);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Error.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Error);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(RunResponse other) {
if (other == null) {
return;
}
if (other.Error.Length != 0) {
Error = other.Error;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Error = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

View file

@ -0,0 +1,271 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: language.proto
// </auto-generated>
// Original file comments:
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
//
#pragma warning disable 1591
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;
namespace Pulumirpc {
/// <summary>
/// LanguageRuntime is the interface that the planning monitor uses to drive execution of an interpreter responsible
/// for confguring and creating resource objects.
/// </summary>
public static partial class LanguageRuntime
{
static readonly string __ServiceName = "pulumirpc.LanguageRuntime";
static readonly grpc::Marshaller<global::Pulumirpc.GetRequiredPluginsRequest> __Marshaller_GetRequiredPluginsRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.GetRequiredPluginsRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.GetRequiredPluginsResponse> __Marshaller_GetRequiredPluginsResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.GetRequiredPluginsResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.RunRequest> __Marshaller_RunRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.RunRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.RunResponse> __Marshaller_RunResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.RunResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Google.Protobuf.WellKnownTypes.Empty> __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.Empty.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.PluginInfo> __Marshaller_PluginInfo = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.PluginInfo.Parser.ParseFrom);
static readonly grpc::Method<global::Pulumirpc.GetRequiredPluginsRequest, global::Pulumirpc.GetRequiredPluginsResponse> __Method_GetRequiredPlugins = new grpc::Method<global::Pulumirpc.GetRequiredPluginsRequest, global::Pulumirpc.GetRequiredPluginsResponse>(
grpc::MethodType.Unary,
__ServiceName,
"GetRequiredPlugins",
__Marshaller_GetRequiredPluginsRequest,
__Marshaller_GetRequiredPluginsResponse);
static readonly grpc::Method<global::Pulumirpc.RunRequest, global::Pulumirpc.RunResponse> __Method_Run = new grpc::Method<global::Pulumirpc.RunRequest, global::Pulumirpc.RunResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Run",
__Marshaller_RunRequest,
__Marshaller_RunResponse);
static readonly grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Pulumirpc.PluginInfo> __Method_GetPluginInfo = new grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Pulumirpc.PluginInfo>(
grpc::MethodType.Unary,
__ServiceName,
"GetPluginInfo",
__Marshaller_Empty,
__Marshaller_PluginInfo);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Pulumirpc.LanguageReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of LanguageRuntime</summary>
public abstract partial class LanguageRuntimeBase
{
/// <summary>
/// GetRequiredPlugins computes the complete set of anticipated plugins required by a program.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.GetRequiredPluginsResponse> GetRequiredPlugins(global::Pulumirpc.GetRequiredPluginsRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Run executes a program and returns its result.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.RunResponse> Run(global::Pulumirpc.RunRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.PluginInfo> GetPluginInfo(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for LanguageRuntime</summary>
public partial class LanguageRuntimeClient : grpc::ClientBase<LanguageRuntimeClient>
{
/// <summary>Creates a new client for LanguageRuntime</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public LanguageRuntimeClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for LanguageRuntime that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public LanguageRuntimeClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected LanguageRuntimeClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected LanguageRuntimeClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
/// <summary>
/// GetRequiredPlugins computes the complete set of anticipated plugins required by a program.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.GetRequiredPluginsResponse GetRequiredPlugins(global::Pulumirpc.GetRequiredPluginsRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return GetRequiredPlugins(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// GetRequiredPlugins computes the complete set of anticipated plugins required by a program.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.GetRequiredPluginsResponse GetRequiredPlugins(global::Pulumirpc.GetRequiredPluginsRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_GetRequiredPlugins, null, options, request);
}
/// <summary>
/// GetRequiredPlugins computes the complete set of anticipated plugins required by a program.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.GetRequiredPluginsResponse> GetRequiredPluginsAsync(global::Pulumirpc.GetRequiredPluginsRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return GetRequiredPluginsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// GetRequiredPlugins computes the complete set of anticipated plugins required by a program.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.GetRequiredPluginsResponse> GetRequiredPluginsAsync(global::Pulumirpc.GetRequiredPluginsRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_GetRequiredPlugins, null, options, request);
}
/// <summary>
/// Run executes a program and returns its result.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.RunResponse Run(global::Pulumirpc.RunRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Run(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Run executes a program and returns its result.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.RunResponse Run(global::Pulumirpc.RunRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Run, null, options, request);
}
/// <summary>
/// Run executes a program and returns its result.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.RunResponse> RunAsync(global::Pulumirpc.RunRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return RunAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Run executes a program and returns its result.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.RunResponse> RunAsync(global::Pulumirpc.RunRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Run, null, options, request);
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.PluginInfo GetPluginInfo(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return GetPluginInfo(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.PluginInfo GetPluginInfo(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_GetPluginInfo, null, options, request);
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.PluginInfo> GetPluginInfoAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return GetPluginInfoAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.PluginInfo> GetPluginInfoAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_GetPluginInfo, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override LanguageRuntimeClient NewInstance(ClientBaseConfiguration configuration)
{
return new LanguageRuntimeClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(LanguageRuntimeBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_GetRequiredPlugins, serviceImpl.GetRequiredPlugins)
.AddMethod(__Method_Run, serviceImpl.Run)
.AddMethod(__Method_GetPluginInfo, serviceImpl.GetPluginInfo).Build();
}
}
}
#endregion

View file

@ -0,0 +1,351 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: plugin.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Pulumirpc {
/// <summary>Holder for reflection information generated from plugin.proto</summary>
public static partial class PluginReflection {
#region Descriptor
/// <summary>File descriptor for plugin.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static PluginReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CgxwbHVnaW4ucHJvdG8SCXB1bHVtaXJwYyIdCgpQbHVnaW5JbmZvEg8KB3Zl",
"cnNpb24YASABKAkiPwoQUGx1Z2luRGVwZW5kZW5jeRIMCgRuYW1lGAEgASgJ",
"EgwKBGtpbmQYAiABKAkSDwoHdmVyc2lvbhgDIAEoCWIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.PluginInfo), global::Pulumirpc.PluginInfo.Parser, new[]{ "Version" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.PluginDependency), global::Pulumirpc.PluginDependency.Parser, new[]{ "Name", "Kind", "Version" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// PluginInfo is meta-information about a plugin that is used by the system.
/// </summary>
public sealed partial class PluginInfo : pb::IMessage<PluginInfo> {
private static readonly pb::MessageParser<PluginInfo> _parser = new pb::MessageParser<PluginInfo>(() => new PluginInfo());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<PluginInfo> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.PluginReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PluginInfo() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PluginInfo(PluginInfo other) : this() {
version_ = other.version_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PluginInfo Clone() {
return new PluginInfo(this);
}
/// <summary>Field number for the "version" field.</summary>
public const int VersionFieldNumber = 1;
private string version_ = "";
/// <summary>
/// the semver for this plugin.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Version {
get { return version_; }
set {
version_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as PluginInfo);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(PluginInfo other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Version != other.Version) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Version.Length != 0) hash ^= Version.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Version.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Version);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Version.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Version);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(PluginInfo other) {
if (other == null) {
return;
}
if (other.Version.Length != 0) {
Version = other.Version;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Version = input.ReadString();
break;
}
}
}
}
}
/// <summary>
/// PluginDependency is information about a plugin that a program may depend upon.
/// </summary>
public sealed partial class PluginDependency : pb::IMessage<PluginDependency> {
private static readonly pb::MessageParser<PluginDependency> _parser = new pb::MessageParser<PluginDependency>(() => new PluginDependency());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<PluginDependency> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.PluginReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PluginDependency() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PluginDependency(PluginDependency other) : this() {
name_ = other.name_;
kind_ = other.kind_;
version_ = other.version_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public PluginDependency Clone() {
return new PluginDependency(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
/// <summary>
/// the name of the plugin.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "kind" field.</summary>
public const int KindFieldNumber = 2;
private string kind_ = "";
/// <summary>
/// the kind of plugin (e.g., language, etc).
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Kind {
get { return kind_; }
set {
kind_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "version" field.</summary>
public const int VersionFieldNumber = 3;
private string version_ = "";
/// <summary>
/// the semver for this plugin.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Version {
get { return version_; }
set {
version_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as PluginDependency);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(PluginDependency other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (Kind != other.Kind) return false;
if (Version != other.Version) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Kind.Length != 0) hash ^= Kind.GetHashCode();
if (Version.Length != 0) hash ^= Version.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (Kind.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Kind);
}
if (Version.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Version);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (Kind.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Kind);
}
if (Version.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Version);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(PluginDependency other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.Kind.Length != 0) {
Kind = other.Kind;
}
if (other.Version.Length != 0) {
Version = other.Version;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
Kind = input.ReadString();
break;
}
case 26: {
Version = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,619 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: provider.proto
// </auto-generated>
// Original file comments:
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
//
#pragma warning disable 1591
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;
namespace Pulumirpc {
/// <summary>
/// ResourceProvider is a service that understands how to create, read, update, or delete resources for types defined
/// within a single package. It is driven by the overall planning engine in response to resource diffs.
/// </summary>
public static partial class ResourceProvider
{
static readonly string __ServiceName = "pulumirpc.ResourceProvider";
static readonly grpc::Marshaller<global::Pulumirpc.ConfigureRequest> __Marshaller_ConfigureRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.ConfigureRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Google.Protobuf.WellKnownTypes.Empty> __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.Empty.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.InvokeRequest> __Marshaller_InvokeRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.InvokeRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.InvokeResponse> __Marshaller_InvokeResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.InvokeResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.CheckRequest> __Marshaller_CheckRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.CheckRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.CheckResponse> __Marshaller_CheckResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.CheckResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.DiffRequest> __Marshaller_DiffRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.DiffRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.DiffResponse> __Marshaller_DiffResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.DiffResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.CreateRequest> __Marshaller_CreateRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.CreateRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.CreateResponse> __Marshaller_CreateResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.CreateResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.UpdateRequest> __Marshaller_UpdateRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.UpdateRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.UpdateResponse> __Marshaller_UpdateResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.UpdateResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.DeleteRequest> __Marshaller_DeleteRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.DeleteRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.PluginInfo> __Marshaller_PluginInfo = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.PluginInfo.Parser.ParseFrom);
static readonly grpc::Method<global::Pulumirpc.ConfigureRequest, global::Google.Protobuf.WellKnownTypes.Empty> __Method_Configure = new grpc::Method<global::Pulumirpc.ConfigureRequest, global::Google.Protobuf.WellKnownTypes.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"Configure",
__Marshaller_ConfigureRequest,
__Marshaller_Empty);
static readonly grpc::Method<global::Pulumirpc.InvokeRequest, global::Pulumirpc.InvokeResponse> __Method_Invoke = new grpc::Method<global::Pulumirpc.InvokeRequest, global::Pulumirpc.InvokeResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Invoke",
__Marshaller_InvokeRequest,
__Marshaller_InvokeResponse);
static readonly grpc::Method<global::Pulumirpc.CheckRequest, global::Pulumirpc.CheckResponse> __Method_Check = new grpc::Method<global::Pulumirpc.CheckRequest, global::Pulumirpc.CheckResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Check",
__Marshaller_CheckRequest,
__Marshaller_CheckResponse);
static readonly grpc::Method<global::Pulumirpc.DiffRequest, global::Pulumirpc.DiffResponse> __Method_Diff = new grpc::Method<global::Pulumirpc.DiffRequest, global::Pulumirpc.DiffResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Diff",
__Marshaller_DiffRequest,
__Marshaller_DiffResponse);
static readonly grpc::Method<global::Pulumirpc.CreateRequest, global::Pulumirpc.CreateResponse> __Method_Create = new grpc::Method<global::Pulumirpc.CreateRequest, global::Pulumirpc.CreateResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Create",
__Marshaller_CreateRequest,
__Marshaller_CreateResponse);
static readonly grpc::Method<global::Pulumirpc.UpdateRequest, global::Pulumirpc.UpdateResponse> __Method_Update = new grpc::Method<global::Pulumirpc.UpdateRequest, global::Pulumirpc.UpdateResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Update",
__Marshaller_UpdateRequest,
__Marshaller_UpdateResponse);
static readonly grpc::Method<global::Pulumirpc.DeleteRequest, global::Google.Protobuf.WellKnownTypes.Empty> __Method_Delete = new grpc::Method<global::Pulumirpc.DeleteRequest, global::Google.Protobuf.WellKnownTypes.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"Delete",
__Marshaller_DeleteRequest,
__Marshaller_Empty);
static readonly grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Pulumirpc.PluginInfo> __Method_GetPluginInfo = new grpc::Method<global::Google.Protobuf.WellKnownTypes.Empty, global::Pulumirpc.PluginInfo>(
grpc::MethodType.Unary,
__ServiceName,
"GetPluginInfo",
__Marshaller_Empty,
__Marshaller_PluginInfo);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Pulumirpc.ProviderReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of ResourceProvider</summary>
public abstract partial class ResourceProviderBase
{
/// <summary>
/// Configure configures the resource provider with "globals" that control its behavior.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> Configure(global::Pulumirpc.ConfigureRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Invoke dynamically executes a built-in function in the provider.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.InvokeResponse> Invoke(global::Pulumirpc.InvokeRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Check validates that the given property bag is valid for a resource of the given type and returns the inputs
/// that should be passed to successive calls to Diff, Create, or Update for this resource. As a rule, the provider
/// inputs returned by a call to Check should preserve the original representation of the properties as present in
/// the program inputs. Though this rule is not required for correctness, violations thereof can negatively impact
/// the end-user experience, as the provider inputs are using for detecting and rendering diffs.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.CheckResponse> Check(global::Pulumirpc.CheckRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Diff checks what impacts a hypothetical update will have on the resource's properties.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.DiffResponse> Diff(global::Pulumirpc.DiffRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// 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").
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.CreateResponse> Create(global::Pulumirpc.CreateRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Update updates an existing resource with new values.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.UpdateResponse> Update(global::Pulumirpc.UpdateRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> Delete(global::Pulumirpc.DeleteRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request received from the client.</param>
/// <param name="context">The context of the server-side call handler being invoked.</param>
/// <returns>The response to send back to the client (wrapped by a task).</returns>
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.PluginInfo> GetPluginInfo(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for ResourceProvider</summary>
public partial class ResourceProviderClient : grpc::ClientBase<ResourceProviderClient>
{
/// <summary>Creates a new client for ResourceProvider</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public ResourceProviderClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for ResourceProvider that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public ResourceProviderClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected ResourceProviderClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected ResourceProviderClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
/// <summary>
/// Configure configures the resource provider with "globals" that control its behavior.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Google.Protobuf.WellKnownTypes.Empty Configure(global::Pulumirpc.ConfigureRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Configure(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Configure configures the resource provider with "globals" that control its behavior.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Google.Protobuf.WellKnownTypes.Empty Configure(global::Pulumirpc.ConfigureRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Configure, null, options, request);
}
/// <summary>
/// Configure configures the resource provider with "globals" that control its behavior.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> ConfigureAsync(global::Pulumirpc.ConfigureRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return ConfigureAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Configure configures the resource provider with "globals" that control its behavior.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> ConfigureAsync(global::Pulumirpc.ConfigureRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Configure, null, options, request);
}
/// <summary>
/// Invoke dynamically executes a built-in function in the provider.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.InvokeResponse Invoke(global::Pulumirpc.InvokeRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Invoke(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Invoke dynamically executes a built-in function in the provider.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.InvokeResponse Invoke(global::Pulumirpc.InvokeRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Invoke, null, options, request);
}
/// <summary>
/// Invoke dynamically executes a built-in function in the provider.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.InvokeResponse> InvokeAsync(global::Pulumirpc.InvokeRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return InvokeAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Invoke dynamically executes a built-in function in the provider.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.InvokeResponse> InvokeAsync(global::Pulumirpc.InvokeRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Invoke, null, options, request);
}
/// <summary>
/// Check validates that the given property bag is valid for a resource of the given type and returns the inputs
/// that should be passed to successive calls to Diff, Create, or Update for this resource. As a rule, the provider
/// inputs returned by a call to Check should preserve the original representation of the properties as present in
/// the program inputs. Though this rule is not required for correctness, violations thereof can negatively impact
/// the end-user experience, as the provider inputs are using for detecting and rendering diffs.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.CheckResponse Check(global::Pulumirpc.CheckRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Check(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Check validates that the given property bag is valid for a resource of the given type and returns the inputs
/// that should be passed to successive calls to Diff, Create, or Update for this resource. As a rule, the provider
/// inputs returned by a call to Check should preserve the original representation of the properties as present in
/// the program inputs. Though this rule is not required for correctness, violations thereof can negatively impact
/// the end-user experience, as the provider inputs are using for detecting and rendering diffs.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.CheckResponse Check(global::Pulumirpc.CheckRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Check, null, options, request);
}
/// <summary>
/// Check validates that the given property bag is valid for a resource of the given type and returns the inputs
/// that should be passed to successive calls to Diff, Create, or Update for this resource. As a rule, the provider
/// inputs returned by a call to Check should preserve the original representation of the properties as present in
/// the program inputs. Though this rule is not required for correctness, violations thereof can negatively impact
/// the end-user experience, as the provider inputs are using for detecting and rendering diffs.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.CheckResponse> CheckAsync(global::Pulumirpc.CheckRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return CheckAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Check validates that the given property bag is valid for a resource of the given type and returns the inputs
/// that should be passed to successive calls to Diff, Create, or Update for this resource. As a rule, the provider
/// inputs returned by a call to Check should preserve the original representation of the properties as present in
/// the program inputs. Though this rule is not required for correctness, violations thereof can negatively impact
/// the end-user experience, as the provider inputs are using for detecting and rendering diffs.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.CheckResponse> CheckAsync(global::Pulumirpc.CheckRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Check, null, options, request);
}
/// <summary>
/// Diff checks what impacts a hypothetical update will have on the resource's properties.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.DiffResponse Diff(global::Pulumirpc.DiffRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Diff(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Diff checks what impacts a hypothetical update will have on the resource's properties.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.DiffResponse Diff(global::Pulumirpc.DiffRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Diff, null, options, request);
}
/// <summary>
/// Diff checks what impacts a hypothetical update will have on the resource's properties.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.DiffResponse> DiffAsync(global::Pulumirpc.DiffRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return DiffAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Diff checks what impacts a hypothetical update will have on the resource's properties.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.DiffResponse> DiffAsync(global::Pulumirpc.DiffRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Diff, null, options, request);
}
/// <summary>
/// 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").
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.CreateResponse Create(global::Pulumirpc.CreateRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Create(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// 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").
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.CreateResponse Create(global::Pulumirpc.CreateRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Create, null, options, request);
}
/// <summary>
/// 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").
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.CreateResponse> CreateAsync(global::Pulumirpc.CreateRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return CreateAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// 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").
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.CreateResponse> CreateAsync(global::Pulumirpc.CreateRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Create, null, options, request);
}
/// <summary>
/// Update updates an existing resource with new values.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.UpdateResponse Update(global::Pulumirpc.UpdateRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Update(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Update updates an existing resource with new values.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.UpdateResponse Update(global::Pulumirpc.UpdateRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Update, null, options, request);
}
/// <summary>
/// Update updates an existing resource with new values.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.UpdateResponse> UpdateAsync(global::Pulumirpc.UpdateRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return UpdateAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Update updates an existing resource with new values.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.UpdateResponse> UpdateAsync(global::Pulumirpc.UpdateRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Update, null, options, request);
}
/// <summary>
/// Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Google.Protobuf.WellKnownTypes.Empty Delete(global::Pulumirpc.DeleteRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Delete(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Google.Protobuf.WellKnownTypes.Empty Delete(global::Pulumirpc.DeleteRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Delete, null, options, request);
}
/// <summary>
/// Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteAsync(global::Pulumirpc.DeleteRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return DeleteAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// Delete tears down an existing resource with the given ID. If it fails, the resource is assumed to still exist.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> DeleteAsync(global::Pulumirpc.DeleteRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Delete, null, options, request);
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.PluginInfo GetPluginInfo(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return GetPluginInfo(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The response received from the server.</returns>
public virtual global::Pulumirpc.PluginInfo GetPluginInfo(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_GetPluginInfo, null, options, request);
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="headers">The initial metadata to send with the call. This parameter is optional.</param>
/// <param name="deadline">An optional deadline for the call. The call will be cancelled if deadline is hit.</param>
/// <param name="cancellationToken">An optional token for canceling the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.PluginInfo> GetPluginInfoAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return GetPluginInfoAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
/// <summary>
/// GetPluginInfo returns generic information about this plugin, like its version.
/// </summary>
/// <param name="request">The request to send to the server.</param>
/// <param name="options">The options for the call.</param>
/// <returns>The call object.</returns>
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.PluginInfo> GetPluginInfoAsync(global::Google.Protobuf.WellKnownTypes.Empty request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_GetPluginInfo, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override ResourceProviderClient NewInstance(ClientBaseConfiguration configuration)
{
return new ResourceProviderClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(ResourceProviderBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_Configure, serviceImpl.Configure)
.AddMethod(__Method_Invoke, serviceImpl.Invoke)
.AddMethod(__Method_Check, serviceImpl.Check)
.AddMethod(__Method_Diff, serviceImpl.Diff)
.AddMethod(__Method_Create, serviceImpl.Create)
.AddMethod(__Method_Update, serviceImpl.Update)
.AddMethod(__Method_Delete, serviceImpl.Delete)
.AddMethod(__Method_GetPluginInfo, serviceImpl.GetPluginInfo).Build();
}
}
}
#endregion

View file

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Google.Protobuf" Version="3.5.1" />
<PackageReference Include="Grpc.Core" Version="1.10.0" />
<PackageReference Include="Grpc.Tools" Version="1.10.0" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,772 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: resource.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Pulumirpc {
/// <summary>Holder for reflection information generated from resource.proto</summary>
public static partial class ResourceReflection {
#region Descriptor
/// <summary>File descriptor for resource.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static ResourceReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"Cg5yZXNvdXJjZS5wcm90bxIJcHVsdW1pcnBjGhtnb29nbGUvcHJvdG9idWYv",
"ZW1wdHkucHJvdG8aHGdvb2dsZS9wcm90b2J1Zi9zdHJ1Y3QucHJvdG8aDnBy",
"b3ZpZGVyLnByb3RvIqUBChdSZWdpc3RlclJlc291cmNlUmVxdWVzdBIMCgR0",
"eXBlGAEgASgJEgwKBG5hbWUYAiABKAkSDgoGcGFyZW50GAMgASgJEg4KBmN1",
"c3RvbRgEIAEoCBInCgZvYmplY3QYBSABKAsyFy5nb29nbGUucHJvdG9idWYu",
"U3RydWN0Eg8KB3Byb3RlY3QYBiABKAgSFAoMZGVwZW5kZW5jaWVzGAcgAygJ",
"In0KGFJlZ2lzdGVyUmVzb3VyY2VSZXNwb25zZRILCgN1cm4YASABKAkSCgoC",
"aWQYAiABKAkSJwoGb2JqZWN0GAMgASgLMhcuZ29vZ2xlLnByb3RvYnVmLlN0",
"cnVjdBIOCgZzdGFibGUYBCABKAgSDwoHc3RhYmxlcxgFIAMoCSJXCh5SZWdp",
"c3RlclJlc291cmNlT3V0cHV0c1JlcXVlc3QSCwoDdXJuGAEgASgJEigKB291",
"dHB1dHMYAiABKAsyFy5nb29nbGUucHJvdG9idWYuU3RydWN0MpECCg9SZXNv",
"dXJjZU1vbml0b3ISPwoGSW52b2tlEhgucHVsdW1pcnBjLkludm9rZVJlcXVl",
"c3QaGS5wdWx1bWlycGMuSW52b2tlUmVzcG9uc2UiABJdChBSZWdpc3RlclJl",
"c291cmNlEiIucHVsdW1pcnBjLlJlZ2lzdGVyUmVzb3VyY2VSZXF1ZXN0GiMu",
"cHVsdW1pcnBjLlJlZ2lzdGVyUmVzb3VyY2VSZXNwb25zZSIAEl4KF1JlZ2lz",
"dGVyUmVzb3VyY2VPdXRwdXRzEikucHVsdW1pcnBjLlJlZ2lzdGVyUmVzb3Vy",
"Y2VPdXRwdXRzUmVxdWVzdBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAYgZw",
"cm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.EmptyReflection.Descriptor, global::Google.Protobuf.WellKnownTypes.StructReflection.Descriptor, global::Pulumirpc.ProviderReflection.Descriptor, },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.RegisterResourceRequest), global::Pulumirpc.RegisterResourceRequest.Parser, new[]{ "Type", "Name", "Parent", "Custom", "Object", "Protect", "Dependencies" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.RegisterResourceResponse), global::Pulumirpc.RegisterResourceResponse.Parser, new[]{ "Urn", "Id", "Object", "Stable", "Stables" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::Pulumirpc.RegisterResourceOutputsRequest), global::Pulumirpc.RegisterResourceOutputsRequest.Parser, new[]{ "Urn", "Outputs" }, null, null, null)
}));
}
#endregion
}
#region Messages
/// <summary>
/// RegisterResourceRequest contains information about a resource object that was newly allocated.
/// </summary>
public sealed partial class RegisterResourceRequest : pb::IMessage<RegisterResourceRequest> {
private static readonly pb::MessageParser<RegisterResourceRequest> _parser = new pb::MessageParser<RegisterResourceRequest>(() => new RegisterResourceRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<RegisterResourceRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.ResourceReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegisterResourceRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegisterResourceRequest(RegisterResourceRequest other) : this() {
type_ = other.type_;
name_ = other.name_;
parent_ = other.parent_;
custom_ = other.custom_;
Object = other.object_ != null ? other.Object.Clone() : null;
protect_ = other.protect_;
dependencies_ = other.dependencies_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegisterResourceRequest Clone() {
return new RegisterResourceRequest(this);
}
/// <summary>Field number for the "type" field.</summary>
public const int TypeFieldNumber = 1;
private string type_ = "";
/// <summary>
/// the type of the object allocated.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Type {
get { return type_; }
set {
type_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 2;
private string name_ = "";
/// <summary>
/// the name, for URN purposes, of the object.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "parent" field.</summary>
public const int ParentFieldNumber = 3;
private string parent_ = "";
/// <summary>
/// an optional parent URN that this child resource belongs to.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Parent {
get { return parent_; }
set {
parent_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "custom" field.</summary>
public const int CustomFieldNumber = 4;
private bool custom_;
/// <summary>
/// true if the resource is a custom, managed by a plugin's CRUD operations.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Custom {
get { return custom_; }
set {
custom_ = value;
}
}
/// <summary>Field number for the "object" field.</summary>
public const int ObjectFieldNumber = 5;
private global::Google.Protobuf.WellKnownTypes.Struct object_;
/// <summary>
/// an object produced by the interpreter/source.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Struct Object {
get { return object_; }
set {
object_ = value;
}
}
/// <summary>Field number for the "protect" field.</summary>
public const int ProtectFieldNumber = 6;
private bool protect_;
/// <summary>
/// true if the resource should be marked protected.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Protect {
get { return protect_; }
set {
protect_ = value;
}
}
/// <summary>Field number for the "dependencies" field.</summary>
public const int DependenciesFieldNumber = 7;
private static readonly pb::FieldCodec<string> _repeated_dependencies_codec
= pb::FieldCodec.ForString(58);
private readonly pbc::RepeatedField<string> dependencies_ = new pbc::RepeatedField<string>();
/// <summary>
/// a list of URNs that this resource depends on, as observed by the language host.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> Dependencies {
get { return dependencies_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as RegisterResourceRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(RegisterResourceRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Type != other.Type) return false;
if (Name != other.Name) return false;
if (Parent != other.Parent) return false;
if (Custom != other.Custom) return false;
if (!object.Equals(Object, other.Object)) return false;
if (Protect != other.Protect) return false;
if(!dependencies_.Equals(other.dependencies_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Type.Length != 0) hash ^= Type.GetHashCode();
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (Parent.Length != 0) hash ^= Parent.GetHashCode();
if (Custom != false) hash ^= Custom.GetHashCode();
if (object_ != null) hash ^= Object.GetHashCode();
if (Protect != false) hash ^= Protect.GetHashCode();
hash ^= dependencies_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Type.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Type);
}
if (Name.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Name);
}
if (Parent.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Parent);
}
if (Custom != false) {
output.WriteRawTag(32);
output.WriteBool(Custom);
}
if (object_ != null) {
output.WriteRawTag(42);
output.WriteMessage(Object);
}
if (Protect != false) {
output.WriteRawTag(48);
output.WriteBool(Protect);
}
dependencies_.WriteTo(output, _repeated_dependencies_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Type.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Type);
}
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (Parent.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Parent);
}
if (Custom != false) {
size += 1 + 1;
}
if (object_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Object);
}
if (Protect != false) {
size += 1 + 1;
}
size += dependencies_.CalculateSize(_repeated_dependencies_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(RegisterResourceRequest other) {
if (other == null) {
return;
}
if (other.Type.Length != 0) {
Type = other.Type;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.Parent.Length != 0) {
Parent = other.Parent;
}
if (other.Custom != false) {
Custom = other.Custom;
}
if (other.object_ != null) {
if (object_ == null) {
object_ = new global::Google.Protobuf.WellKnownTypes.Struct();
}
Object.MergeFrom(other.Object);
}
if (other.Protect != false) {
Protect = other.Protect;
}
dependencies_.Add(other.dependencies_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Type = input.ReadString();
break;
}
case 18: {
Name = input.ReadString();
break;
}
case 26: {
Parent = input.ReadString();
break;
}
case 32: {
Custom = input.ReadBool();
break;
}
case 42: {
if (object_ == null) {
object_ = new global::Google.Protobuf.WellKnownTypes.Struct();
}
input.ReadMessage(object_);
break;
}
case 48: {
Protect = input.ReadBool();
break;
}
case 58: {
dependencies_.AddEntriesFrom(input, _repeated_dependencies_codec);
break;
}
}
}
}
}
/// <summary>
/// RegisterResourceResponse is returned by the engine after a resource has finished being initialized. It includes the
/// auto-assigned URN, the provider-assigned ID, and any other properties initialized by the engine.
/// </summary>
public sealed partial class RegisterResourceResponse : pb::IMessage<RegisterResourceResponse> {
private static readonly pb::MessageParser<RegisterResourceResponse> _parser = new pb::MessageParser<RegisterResourceResponse>(() => new RegisterResourceResponse());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<RegisterResourceResponse> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.ResourceReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegisterResourceResponse() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegisterResourceResponse(RegisterResourceResponse other) : this() {
urn_ = other.urn_;
id_ = other.id_;
Object = other.object_ != null ? other.Object.Clone() : null;
stable_ = other.stable_;
stables_ = other.stables_.Clone();
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegisterResourceResponse Clone() {
return new RegisterResourceResponse(this);
}
/// <summary>Field number for the "urn" field.</summary>
public const int UrnFieldNumber = 1;
private string urn_ = "";
/// <summary>
/// the URN assigned by the fabric.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Urn {
get { return urn_; }
set {
urn_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "id" field.</summary>
public const int IdFieldNumber = 2;
private string id_ = "";
/// <summary>
/// the unique ID assigned by the provider.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Id {
get { return id_; }
set {
id_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "object" field.</summary>
public const int ObjectFieldNumber = 3;
private global::Google.Protobuf.WellKnownTypes.Struct object_;
/// <summary>
/// the resulting object properties, including provider defaults.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Struct Object {
get { return object_; }
set {
object_ = value;
}
}
/// <summary>Field number for the "stable" field.</summary>
public const int StableFieldNumber = 4;
private bool stable_;
/// <summary>
/// if true, the object's state is stable and may be trusted not to change.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Stable {
get { return stable_; }
set {
stable_ = value;
}
}
/// <summary>Field number for the "stables" field.</summary>
public const int StablesFieldNumber = 5;
private static readonly pb::FieldCodec<string> _repeated_stables_codec
= pb::FieldCodec.ForString(42);
private readonly pbc::RepeatedField<string> stables_ = new pbc::RepeatedField<string>();
/// <summary>
/// an optional list of guaranteed-stable properties.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pbc::RepeatedField<string> Stables {
get { return stables_; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as RegisterResourceResponse);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(RegisterResourceResponse other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Urn != other.Urn) return false;
if (Id != other.Id) return false;
if (!object.Equals(Object, other.Object)) return false;
if (Stable != other.Stable) return false;
if(!stables_.Equals(other.stables_)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Urn.Length != 0) hash ^= Urn.GetHashCode();
if (Id.Length != 0) hash ^= Id.GetHashCode();
if (object_ != null) hash ^= Object.GetHashCode();
if (Stable != false) hash ^= Stable.GetHashCode();
hash ^= stables_.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Urn.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Urn);
}
if (Id.Length != 0) {
output.WriteRawTag(18);
output.WriteString(Id);
}
if (object_ != null) {
output.WriteRawTag(26);
output.WriteMessage(Object);
}
if (Stable != false) {
output.WriteRawTag(32);
output.WriteBool(Stable);
}
stables_.WriteTo(output, _repeated_stables_codec);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Urn.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Urn);
}
if (Id.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Id);
}
if (object_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Object);
}
if (Stable != false) {
size += 1 + 1;
}
size += stables_.CalculateSize(_repeated_stables_codec);
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(RegisterResourceResponse other) {
if (other == null) {
return;
}
if (other.Urn.Length != 0) {
Urn = other.Urn;
}
if (other.Id.Length != 0) {
Id = other.Id;
}
if (other.object_ != null) {
if (object_ == null) {
object_ = new global::Google.Protobuf.WellKnownTypes.Struct();
}
Object.MergeFrom(other.Object);
}
if (other.Stable != false) {
Stable = other.Stable;
}
stables_.Add(other.stables_);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Urn = input.ReadString();
break;
}
case 18: {
Id = input.ReadString();
break;
}
case 26: {
if (object_ == null) {
object_ = new global::Google.Protobuf.WellKnownTypes.Struct();
}
input.ReadMessage(object_);
break;
}
case 32: {
Stable = input.ReadBool();
break;
}
case 42: {
stables_.AddEntriesFrom(input, _repeated_stables_codec);
break;
}
}
}
}
}
/// <summary>
/// RegisterResourceOutputsRequest adds extra resource outputs created by the program after registration has occurred.
/// </summary>
public sealed partial class RegisterResourceOutputsRequest : pb::IMessage<RegisterResourceOutputsRequest> {
private static readonly pb::MessageParser<RegisterResourceOutputsRequest> _parser = new pb::MessageParser<RegisterResourceOutputsRequest>(() => new RegisterResourceOutputsRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<RegisterResourceOutputsRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::Pulumirpc.ResourceReflection.Descriptor.MessageTypes[2]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegisterResourceOutputsRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegisterResourceOutputsRequest(RegisterResourceOutputsRequest other) : this() {
urn_ = other.urn_;
Outputs = other.outputs_ != null ? other.Outputs.Clone() : null;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public RegisterResourceOutputsRequest Clone() {
return new RegisterResourceOutputsRequest(this);
}
/// <summary>Field number for the "urn" field.</summary>
public const int UrnFieldNumber = 1;
private string urn_ = "";
/// <summary>
/// the URN for the resource to attach output properties to.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Urn {
get { return urn_; }
set {
urn_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "outputs" field.</summary>
public const int OutputsFieldNumber = 2;
private global::Google.Protobuf.WellKnownTypes.Struct outputs_;
/// <summary>
/// additional output properties to add to the existing resource.
/// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public global::Google.Protobuf.WellKnownTypes.Struct Outputs {
get { return outputs_; }
set {
outputs_ = value;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as RegisterResourceOutputsRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(RegisterResourceOutputsRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Urn != other.Urn) return false;
if (!object.Equals(Outputs, other.Outputs)) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Urn.Length != 0) hash ^= Urn.GetHashCode();
if (outputs_ != null) hash ^= Outputs.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Urn.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Urn);
}
if (outputs_ != null) {
output.WriteRawTag(18);
output.WriteMessage(Outputs);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Urn.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Urn);
}
if (outputs_ != null) {
size += 1 + pb::CodedOutputStream.ComputeMessageSize(Outputs);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(RegisterResourceOutputsRequest other) {
if (other == null) {
return;
}
if (other.Urn.Length != 0) {
Urn = other.Urn;
}
if (other.outputs_ != null) {
if (outputs_ == null) {
outputs_ = new global::Google.Protobuf.WellKnownTypes.Struct();
}
Outputs.MergeFrom(other.Outputs);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Urn = input.ReadString();
break;
}
case 18: {
if (outputs_ == null) {
outputs_ = new global::Google.Protobuf.WellKnownTypes.Struct();
}
input.ReadMessage(outputs_);
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

View file

@ -0,0 +1,168 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: resource.proto
// </auto-generated>
// Original file comments:
// Copyright 2016-2017, Pulumi Corporation. All rights reserved.
//
#pragma warning disable 1591
#region Designer generated code
using System;
using System.Threading;
using System.Threading.Tasks;
using grpc = global::Grpc.Core;
namespace Pulumirpc {
/// <summary>
/// ResourceMonitor is the interface a source uses to talk back to the planning monitor orchestrating the execution.
/// </summary>
public static partial class ResourceMonitor
{
static readonly string __ServiceName = "pulumirpc.ResourceMonitor";
static readonly grpc::Marshaller<global::Pulumirpc.InvokeRequest> __Marshaller_InvokeRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.InvokeRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.InvokeResponse> __Marshaller_InvokeResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.InvokeResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.RegisterResourceRequest> __Marshaller_RegisterResourceRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.RegisterResourceRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.RegisterResourceResponse> __Marshaller_RegisterResourceResponse = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.RegisterResourceResponse.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Pulumirpc.RegisterResourceOutputsRequest> __Marshaller_RegisterResourceOutputsRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Pulumirpc.RegisterResourceOutputsRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::Google.Protobuf.WellKnownTypes.Empty> __Marshaller_Empty = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::Google.Protobuf.WellKnownTypes.Empty.Parser.ParseFrom);
static readonly grpc::Method<global::Pulumirpc.InvokeRequest, global::Pulumirpc.InvokeResponse> __Method_Invoke = new grpc::Method<global::Pulumirpc.InvokeRequest, global::Pulumirpc.InvokeResponse>(
grpc::MethodType.Unary,
__ServiceName,
"Invoke",
__Marshaller_InvokeRequest,
__Marshaller_InvokeResponse);
static readonly grpc::Method<global::Pulumirpc.RegisterResourceRequest, global::Pulumirpc.RegisterResourceResponse> __Method_RegisterResource = new grpc::Method<global::Pulumirpc.RegisterResourceRequest, global::Pulumirpc.RegisterResourceResponse>(
grpc::MethodType.Unary,
__ServiceName,
"RegisterResource",
__Marshaller_RegisterResourceRequest,
__Marshaller_RegisterResourceResponse);
static readonly grpc::Method<global::Pulumirpc.RegisterResourceOutputsRequest, global::Google.Protobuf.WellKnownTypes.Empty> __Method_RegisterResourceOutputs = new grpc::Method<global::Pulumirpc.RegisterResourceOutputsRequest, global::Google.Protobuf.WellKnownTypes.Empty>(
grpc::MethodType.Unary,
__ServiceName,
"RegisterResourceOutputs",
__Marshaller_RegisterResourceOutputsRequest,
__Marshaller_Empty);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::Pulumirpc.ResourceReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of ResourceMonitor</summary>
public abstract partial class ResourceMonitorBase
{
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.InvokeResponse> Invoke(global::Pulumirpc.InvokeRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
public virtual global::System.Threading.Tasks.Task<global::Pulumirpc.RegisterResourceResponse> RegisterResource(global::Pulumirpc.RegisterResourceRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
public virtual global::System.Threading.Tasks.Task<global::Google.Protobuf.WellKnownTypes.Empty> RegisterResourceOutputs(global::Pulumirpc.RegisterResourceOutputsRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for ResourceMonitor</summary>
public partial class ResourceMonitorClient : grpc::ClientBase<ResourceMonitorClient>
{
/// <summary>Creates a new client for ResourceMonitor</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public ResourceMonitorClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for ResourceMonitor that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public ResourceMonitorClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected ResourceMonitorClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected ResourceMonitorClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
public virtual global::Pulumirpc.InvokeResponse Invoke(global::Pulumirpc.InvokeRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return Invoke(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::Pulumirpc.InvokeResponse Invoke(global::Pulumirpc.InvokeRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_Invoke, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.InvokeResponse> InvokeAsync(global::Pulumirpc.InvokeRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return InvokeAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.InvokeResponse> InvokeAsync(global::Pulumirpc.InvokeRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_Invoke, null, options, request);
}
public virtual global::Pulumirpc.RegisterResourceResponse RegisterResource(global::Pulumirpc.RegisterResourceRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return RegisterResource(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::Pulumirpc.RegisterResourceResponse RegisterResource(global::Pulumirpc.RegisterResourceRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_RegisterResource, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.RegisterResourceResponse> RegisterResourceAsync(global::Pulumirpc.RegisterResourceRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return RegisterResourceAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::Pulumirpc.RegisterResourceResponse> RegisterResourceAsync(global::Pulumirpc.RegisterResourceRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_RegisterResource, null, options, request);
}
public virtual global::Google.Protobuf.WellKnownTypes.Empty RegisterResourceOutputs(global::Pulumirpc.RegisterResourceOutputsRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return RegisterResourceOutputs(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::Google.Protobuf.WellKnownTypes.Empty RegisterResourceOutputs(global::Pulumirpc.RegisterResourceOutputsRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_RegisterResourceOutputs, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> RegisterResourceOutputsAsync(global::Pulumirpc.RegisterResourceOutputsRequest request, grpc::Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default(CancellationToken))
{
return RegisterResourceOutputsAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::Google.Protobuf.WellKnownTypes.Empty> RegisterResourceOutputsAsync(global::Pulumirpc.RegisterResourceOutputsRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_RegisterResourceOutputs, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override ResourceMonitorClient NewInstance(ClientBaseConfiguration configuration)
{
return new ResourceMonitorClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(ResourceMonitorBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_Invoke, serviceImpl.Invoke)
.AddMethod(__Method_RegisterResource, serviceImpl.RegisterResource)
.AddMethod(__Method_RegisterResourceOutputs, serviceImpl.RegisterResourceOutputs).Build();
}
}
}
#endregion

View file

@ -0,0 +1,2 @@
#!/bin/bash
protoc -I=. --csharp_out ../dotnet/ --grpc_out ../dotnet/ --plugin=protoc-gen-grpc=/home/matell/.nuget/packages/grpc.tools/1.10.0/tools/linux_x64/grpc_csharp_plugin *.proto

4
sdk/dotnet/README.md Normal file
View file

@ -0,0 +1,4 @@
# Experimental .NET Language Provider
An early prototype of a .NET language provider for Pulumi.

View file

@ -0,0 +1,225 @@
// Copyright 2016-2018, Pulumi Corporation. All rights reserved.
// pulumi-language-python serves as the "language host" for Pulumi programs written in Python. It is ultimately
// responsible for spawning the language runtime that executes the program.
//
// The program being executed is executed by a shim script called `pulumi-language-python-exec`. This script is
// written in the hosted language (in this case, Python) and is responsible for initiating RPC links to the resource
// monitor and engine.
//
// It's therefore the responsibility of this program to implement the LanguageHostServer endpoint by spawning
// instances of `pulumi-language-python-exec` and forwarding the RPC request arguments to the command-line.
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"syscall"
"github.com/golang/glog"
pbempty "github.com/golang/protobuf/ptypes/empty"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/pkg/util/cmdutil"
"github.com/pulumi/pulumi/pkg/util/rpcutil"
"github.com/pulumi/pulumi/pkg/version"
pulumirpc "github.com/pulumi/pulumi/sdk/proto/go"
"google.golang.org/grpc"
)
const (
// By convention, the executor is the name of the current program (pulumi-language-python) plus this suffix.
pythonExecSuffix = "-exec" // the exec shim for Pulumi to run Python programs.
// The runtime expects the config object to be saved to this environment variable.
pulumiConfigVar = "PULUMI_CONFIG"
)
// Launches the language host RPC endpoint, which in turn fires up an RPC server implementing the
// LanguageRuntimeServer RPC endpoint.
func main() {
var tracing string
flag.StringVar(&tracing, "tracing", "", "Emit tracing to a Zipkin-compatible tracing endpoint")
// You can use the below flag to request that the language host load a specific executor instead of probing the
// PATH. This can be used during testing to override the default location.
var givenExecutor string
flag.StringVar(&givenExecutor, "use-executor", "",
"Use the given program as the executor instead of looking for one on PATH")
flag.Parse()
args := flag.Args()
cmdutil.InitLogging(false, 0, false)
cmdutil.InitTracing(os.Args[0], tracing)
var pythonExec string
if givenExecutor == "" {
// The -exec binary is the same name as the current language host, except that we must trim off
// the file extension (if any) and then append -exec to it.
bin := os.Args[0]
if ext := filepath.Ext(bin); ext != "" {
bin = bin[:len(bin)-len(ext)]
}
bin += pythonExecSuffix
pathExec, err := exec.LookPath(bin)
if err != nil {
err = errors.Wrapf(err, "could not find `%s` on the $PATH", bin)
cmdutil.Exit(err)
}
glog.V(3).Infof("language host identified executor from path: `%s`", pathExec)
pythonExec = pathExec
} else {
glog.V(3).Infof("language host asked to use specific executor: `%s`", givenExecutor)
pythonExec = givenExecutor
}
// Optionally pluck out the engine so we can do logging, etc.
var engineAddress string
if len(args) > 0 {
engineAddress = args[0]
}
// Fire up a gRPC server, letting the kernel choose a free port.
port, done, err := rpcutil.Serve(0, nil, []func(*grpc.Server) error{
func(srv *grpc.Server) error {
host := newLanguageHost(pythonExec, engineAddress, tracing)
pulumirpc.RegisterLanguageRuntimeServer(srv, host)
return nil
},
})
if err != nil {
cmdutil.Exit(errors.Wrapf(err, "could not start language host RPC server"))
}
// Otherwise, print out the port so that the spawner knows how to reach us.
fmt.Printf("%d\n", port)
// And finally wait for the server to stop serving.
if err := <-done; err != nil {
cmdutil.Exit(errors.Wrapf(err, "language host RPC stopped serving"))
}
}
// pythonLanguageHost implements the LanguageRuntimeServer interface
// for use as an API endpoint.
type dotnetLanguageHost struct {
exec string
engineAddress string
tracing string
}
func newLanguageHost(exec, engineAddress, tracing string) pulumirpc.LanguageRuntimeServer {
return &dotnetLanguageHost{
exec: exec,
engineAddress: engineAddress,
tracing: tracing,
}
}
// GetRequiredPlugins computes the complete set of anticipated plugins required by a program.
func (host *dotnetLanguageHost) GetRequiredPlugins(ctx context.Context,
req *pulumirpc.GetRequiredPluginsRequest) (*pulumirpc.GetRequiredPluginsResponse, error) {
// TODO: implement this.
return &pulumirpc.GetRequiredPluginsResponse{}, nil
}
// RPC endpoint for LanguageRuntimeServer::Run
func (host *dotnetLanguageHost) Run(ctx context.Context, req *pulumirpc.RunRequest) (*pulumirpc.RunResponse, error) {
args := host.constructArguments(req)
config, err := host.constructConfig(req)
if err != nil {
err = errors.Wrap(err, "failed to serialize configuration")
return nil, err
}
if glog.V(5) {
commandStr := strings.Join(args, " ")
glog.V(5).Infoln("Language host launching process: ", host.exec, commandStr)
}
// Now simply spawn a process to execute the requested program, wiring up stdout/stderr directly.
var errResult string
cmd := exec.Command(host.exec, args...) // nolint: gas, intentionally running dynamic program name.
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
if config != "" {
cmd.Env = append(os.Environ(), pulumiConfigVar+"="+config)
}
if err := cmd.Run(); err != nil {
if exiterr, ok := err.(*exec.ExitError); ok {
// If the program ran, but exited with a non-zero error code. This will happen often, since user
// errors will trigger this. So, the error message should look as nice as possible.
if status, stok := exiterr.Sys().(syscall.WaitStatus); stok {
err = errors.Errorf("Program exited with non-zero exit code: %d", status.ExitStatus())
} else {
err = errors.Wrapf(exiterr, "Program exited unexpectedly")
}
} else {
// Otherwise, we didn't even get to run the program. This ought to never happen unless there's
// a bug or system condition that prevented us from running the language exec. Issue a scarier error.
err = errors.Wrapf(err, "Problem executing program (could not run language executor)")
}
errResult = err.Error()
}
return &pulumirpc.RunResponse{Error: errResult}, nil
}
// constructArguments constructs a command-line for `pulumi-language-python`
// by enumerating all of the optional and non-optional arguments present
// in a RunRequest.
func (host *dotnetLanguageHost) constructArguments(req *pulumirpc.RunRequest) []string {
var args []string
maybeAppendArg := func(k, v string) {
if v != "" {
args = append(args, "--"+k, v)
}
}
maybeAppendArg("monitor", req.GetMonitorAddress())
maybeAppendArg("engine", host.engineAddress)
maybeAppendArg("project", req.GetProject())
maybeAppendArg("stack", req.GetStack())
maybeAppendArg("pwd", req.GetPwd())
maybeAppendArg("dry_run", fmt.Sprintf("%v", req.GetDryRun()))
maybeAppendArg("parallel", fmt.Sprint(req.GetParallel()))
maybeAppendArg("tracing", host.tracing)
// If no program is specified, just default to the current directory (which will invoke "__main__.py").
if req.GetProgram() == "" {
args = append(args, ".")
} else {
args = append(args, req.GetProgram())
}
args = append(args, req.GetArgs()...)
return args
}
// constructConfig json-serializes the configuration data given as part of a RunRequest.
func (host *dotnetLanguageHost) constructConfig(req *pulumirpc.RunRequest) (string, error) {
configMap := req.GetConfig()
if configMap == nil {
return "", nil
}
configJSON, err := json.Marshal(configMap)
if err != nil {
return "", err
}
return string(configJSON), nil
}
func (host *dotnetLanguageHost) GetPluginInfo(ctx context.Context, req *pbempty.Empty) (*pulumirpc.PluginInfo, error) {
return &pulumirpc.PluginInfo{
Version: version.Version,
}, nil
}