Skip to content

Commit

Permalink
Merge pull request #14 from pulumi/iwahbe/add-documentation
Browse files Browse the repository at this point in the history
Add documentation
  • Loading branch information
iwahbe authored Dec 15, 2021
2 parents 9dba160 + bee4ff8 commit 03b703b
Show file tree
Hide file tree
Showing 16 changed files with 379 additions and 47 deletions.
38 changes: 31 additions & 7 deletions provider/cmd/pulumi-resource-command/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"types": {
"command:remote:Connection": {
"type": "object",
"description": "Instructions for how to connect to a remote endpoint.",
"properties": {
"user": {
"type": "string",
Expand Down Expand Up @@ -33,35 +34,44 @@
},
"resources": {
"command:local:Command": {
"description": "A local command to be executed.\nThis command can be inserted into the life cycles of other resources using the\n`dependsOn` or `parent` resource options. A command is considered to have\nfailed when it finished with a non-zero exit code. This will fail the CRUD step\nof the `Command` resource.",
"properties": {
"interpreter": {
"description": "The program and arguments to run the command.\nFor example: `[\"/bin/sh\", \"-c\"]`",
"type": "array",
"items": {
"type": "string"
}
},
"dir": {
"description": "The directory from which to run the command from. If `dir` does not exist, then\n`Command` will fail.",
"type": "string"
},
"environment": {
"description": "Additional environment variables available to the command's process.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"create": {
"type": "string"
"type": "string",
"description": "The command to run on create."
},
"update": {
"type": "string"
"type": "string",
"description": "The command to run on update."
},
"delete": {
"type": "string"
"type": "string",
"description": "The command to run on delete."
},
"stdout": {
"description": "The standard output of the command's process",
"type": "string"
},
"stderr": {
"description": "The standard error of the command's process",
"type": "string"
}
},
Expand All @@ -71,21 +81,22 @@
],
"inputProperties": {
"interpreter": {
"description": "The program and arguments to run the command.\nOn Linux and macOS, defaults to: `[\"/bin/sh\", \"-c\"]`. On Windows, defaults to: `[\"cmd\", \"/C\"]`",
"type": "array",
"items": {
"type": "string"
}
},
"dir": {
"type": "string",
"description": "The contents of an SSH key to use for the connection. This takes preference over the password if provided."
"description": "The working directory in which to run the command from.",
"type": "string"
},
"environment": {
"description": "Additional environment variables available to the command's process.",
"type": "object",
"additionalProperties": {
"type": "string"
},
"description": "Environment variables to set on commands."
}
},
"create": {
"type": "string",
Expand All @@ -103,29 +114,37 @@
"requiredInputs": []
},
"command:remote:Command": {
"description": "A command to run on a remote host.\nThe connection is established via ssh.",
"properties": {
"connection": {
"description": "The parameters with which to connect to the remote host",
"$ref": "#/types/command:remote:Connection"
},
"environment": {
"description": "Additional environment variables available to the command's process.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"create": {
"description": "The command to run on create.",
"type": "string"
},
"update": {
"description": "The command to run on update.",
"type": "string"
},
"delete": {
"description": "The command to run on delete.",
"type": "string"
},
"stdout": {
"description": "The standard output of the command's process",
"type": "string"
},
"stderr": {
"description": "The standard error of the command's process",
"type": "string"
}
},
Expand All @@ -135,21 +154,26 @@
],
"inputProperties": {
"connection": {
"description": "The parameters with which to connect to the remote host",
"$ref": "#/types/command:remote:Connection"
},
"environment": {
"description": "Additional environment variables available to the command's process.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"create": {
"description": "The command to run on create.",
"type": "string"
},
"update": {
"description": "The command to run on update.",
"type": "string"
},
"delete": {
"description": "The command to run on delete.",
"type": "string"
}
},
Expand Down
42 changes: 40 additions & 2 deletions sdk/dotnet/Local/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,63 @@

namespace Pulumi.Command.Local
{
/// <summary>
/// A local command to be executed.
/// This command can be inserted into the life cycles of other resources using the
/// `dependsOn` or `parent` resource options. A command is considered to have
/// failed when it finished with a non-zero exit code. This will fail the CRUD step
/// of the `Command` resource.
/// </summary>
[CommandResourceType("command:local:Command")]
public partial class Command : Pulumi.CustomResource
{
/// <summary>
/// The command to run on create.
/// </summary>
[Output("create")]
public Output<string?> Create { get; private set; } = null!;

/// <summary>
/// The command to run on delete.
/// </summary>
[Output("delete")]
public Output<string?> Delete { get; private set; } = null!;

/// <summary>
/// The directory from which to run the command from. If `dir` does not exist, then
/// `Command` will fail.
/// </summary>
[Output("dir")]
public Output<string?> Dir { get; private set; } = null!;

/// <summary>
/// Additional environment variables available to the command's process.
/// </summary>
[Output("environment")]
public Output<ImmutableDictionary<string, string>?> Environment { get; private set; } = null!;

/// <summary>
/// The program and arguments to run the command.
/// For example: `["/bin/sh", "-c"]`
/// </summary>
[Output("interpreter")]
public Output<ImmutableArray<string>> Interpreter { get; private set; } = null!;

/// <summary>
/// The standard error of the command's process
/// </summary>
[Output("stderr")]
public Output<string> Stderr { get; private set; } = null!;

/// <summary>
/// The standard output of the command's process
/// </summary>
[Output("stdout")]
public Output<string> Stdout { get; private set; } = null!;

/// <summary>
/// The command to run on update.
/// </summary>
[Output("update")]
public Output<string?> Update { get; private set; } = null!;

Expand Down Expand Up @@ -94,7 +127,7 @@ public sealed class CommandArgs : Pulumi.ResourceArgs
public Input<string>? Delete { get; set; }

/// <summary>
/// The contents of an SSH key to use for the connection. This takes preference over the password if provided.
/// The working directory in which to run the command from.
/// </summary>
[Input("dir")]
public Input<string>? Dir { get; set; }
Expand All @@ -103,7 +136,7 @@ public sealed class CommandArgs : Pulumi.ResourceArgs
private InputMap<string>? _environment;

/// <summary>
/// Environment variables to set on commands.
/// Additional environment variables available to the command's process.
/// </summary>
public InputMap<string> Environment
{
Expand All @@ -113,6 +146,11 @@ public InputMap<string> Environment

[Input("interpreter")]
private InputList<string>? _interpreter;

/// <summary>
/// The program and arguments to run the command.
/// For example: `["/bin/sh", "-c"]`
/// </summary>
public InputList<string> Interpreter
{
get => _interpreter ?? (_interpreter = new InputList<string>());
Expand Down
41 changes: 41 additions & 0 deletions sdk/dotnet/Remote/Command.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,52 @@

namespace Pulumi.Command.Remote
{
/// <summary>
/// A command to run on a remote host.
/// The connection is established via ssh.
/// </summary>
[CommandResourceType("command:remote:Command")]
public partial class Command : Pulumi.CustomResource
{
/// <summary>
/// The parameters with which to connect to the remote host
/// </summary>
[Output("connection")]
public Output<Outputs.Connection?> Connection { get; private set; } = null!;

/// <summary>
/// The command to run on create.
/// </summary>
[Output("create")]
public Output<string?> Create { get; private set; } = null!;

/// <summary>
/// The command to run on delete.
/// </summary>
[Output("delete")]
public Output<string?> Delete { get; private set; } = null!;

/// <summary>
/// Additional environment variables available to the command's process.
/// </summary>
[Output("environment")]
public Output<ImmutableDictionary<string, string>?> Environment { get; private set; } = null!;

/// <summary>
/// The standard error of the command's process
/// </summary>
[Output("stderr")]
public Output<string> Stderr { get; private set; } = null!;

/// <summary>
/// The standard output of the command's process
/// </summary>
[Output("stdout")]
public Output<string> Stdout { get; private set; } = null!;

/// <summary>
/// The command to run on update.
/// </summary>
[Output("update")]
public Output<string?> Update { get; private set; } = null!;

Expand Down Expand Up @@ -78,23 +103,39 @@ public static Command Get(string name, Input<string> id, CustomResourceOptions?

public sealed class CommandArgs : Pulumi.ResourceArgs
{
/// <summary>
/// The parameters with which to connect to the remote host
/// </summary>
[Input("connection", required: true)]
public Input<Inputs.ConnectionArgs> Connection { get; set; } = null!;

/// <summary>
/// The command to run on create.
/// </summary>
[Input("create")]
public Input<string>? Create { get; set; }

/// <summary>
/// The command to run on delete.
/// </summary>
[Input("delete")]
public Input<string>? Delete { get; set; }

[Input("environment")]
private InputMap<string>? _environment;

/// <summary>
/// Additional environment variables available to the command's process.
/// </summary>
public InputMap<string> Environment
{
get => _environment ?? (_environment = new InputMap<string>());
set => _environment = value;
}

/// <summary>
/// The command to run on update.
/// </summary>
[Input("update")]
public Input<string>? Update { get; set; }

Expand Down
3 changes: 3 additions & 0 deletions sdk/dotnet/Remote/Inputs/ConnectionArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
namespace Pulumi.Command.Remote.Inputs
{

/// <summary>
/// Instructions for how to connect to a remote endpoint.
/// </summary>
public sealed class ConnectionArgs : Pulumi.ResourceArgs
{
/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions sdk/dotnet/Remote/Outputs/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
namespace Pulumi.Command.Remote.Outputs
{

/// <summary>
/// Instructions for how to connect to a remote endpoint.
/// </summary>
[OutputType]
public sealed class Connection
{
Expand Down
Loading

0 comments on commit 03b703b

Please sign in to comment.