From 88cf07e5b67206b1825b24d4706ff0d45ecd67b5 Mon Sep 17 00:00:00 2001 From: Fraser Waters Date: Tue, 25 Oct 2022 16:07:13 +0100 Subject: [PATCH] Add Json option to dotnet automation api --- ...21025--auto-dotnet--add-json-option-to-updateoptions.yaml | 4 ++++ sdk/dotnet/Pulumi.Automation/UpdateOptions.cs | 5 +++++ sdk/dotnet/Pulumi.Automation/WorkspaceStack.cs | 5 +++++ 3 files changed, 14 insertions(+) create mode 100644 changelog/pending/20221025--auto-dotnet--add-json-option-to-updateoptions.yaml diff --git a/changelog/pending/20221025--auto-dotnet--add-json-option-to-updateoptions.yaml b/changelog/pending/20221025--auto-dotnet--add-json-option-to-updateoptions.yaml new file mode 100644 index 000000000000..46d460b3ac73 --- /dev/null +++ b/changelog/pending/20221025--auto-dotnet--add-json-option-to-updateoptions.yaml @@ -0,0 +1,4 @@ +changes: +- type: feat + scope: auto/dotnet + description: Add Json option to UpdateOptions. diff --git a/sdk/dotnet/Pulumi.Automation/UpdateOptions.cs b/sdk/dotnet/Pulumi.Automation/UpdateOptions.cs index db22894720d0..4a85c7079ef1 100644 --- a/sdk/dotnet/Pulumi.Automation/UpdateOptions.cs +++ b/sdk/dotnet/Pulumi.Automation/UpdateOptions.cs @@ -66,5 +66,10 @@ public class UpdateOptions /// Print detailed debugging output during resource operations /// public bool? Debug { get; set; } + + /// + /// Format standard output as JSON not text. + /// + public bool? Json { get; set; } } } diff --git a/sdk/dotnet/Pulumi.Automation/WorkspaceStack.cs b/sdk/dotnet/Pulumi.Automation/WorkspaceStack.cs index 13ed9d1ff8bd..d6a29b0fae9b 100644 --- a/sdk/dotnet/Pulumi.Automation/WorkspaceStack.cs +++ b/sdk/dotnet/Pulumi.Automation/WorkspaceStack.cs @@ -800,6 +800,11 @@ static void ApplyUpdateOptions(UpdateOptions options, List args) { args.Add("--debug"); } + + if (options.Json is true) + { + args.Add("--json"); + } } } }