diff --git a/gen/go/unmango/baremetal/v1alpha1/command.pb.go b/gen/go/unmango/baremetal/v1alpha1/command.pb.go index c3e0813f..f2c7f31e 100644 --- a/gen/go/unmango/baremetal/v1alpha1/command.pb.go +++ b/gen/go/unmango/baremetal/v1alpha1/command.pb.go @@ -28,6 +28,7 @@ const ( Bin_BIN_RM Bin = 2 Bin_BIN_WGET Bin = 3 Bin_BIN_MV Bin = 4 + Bin_BIN_TAR Bin = 5 ) // Enum value maps for Bin. @@ -38,6 +39,7 @@ var ( 2: "BIN_RM", 3: "BIN_WGET", 4: "BIN_MV", + 5: "BIN_TAR", } Bin_value = map[string]int32{ "BIN_UNSPECIFIED": 0, @@ -45,6 +47,7 @@ var ( "BIN_RM": 2, "BIN_WGET": 3, "BIN_MV": 4, + "BIN_TAR": 5, } ) @@ -773,49 +776,50 @@ var file_unmango_baremetal_v1alpha1_command_proto_rawDesc = []byte{ 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x65, 0x78, 0x69, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x2a, 0x4d, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x2a, 0x5a, 0x0a, 0x03, 0x42, 0x69, 0x6e, 0x12, 0x13, 0x0a, 0x0f, 0x42, 0x49, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0b, 0x0a, 0x07, 0x42, 0x49, 0x4e, 0x5f, 0x54, 0x45, 0x45, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x49, 0x4e, 0x5f, 0x52, 0x4d, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x49, 0x4e, 0x5f, 0x57, 0x47, 0x45, 0x54, 0x10, - 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x49, 0x4e, 0x5f, 0x4d, 0x56, 0x10, 0x04, 0x32, 0xb3, 0x02, - 0x0a, 0x0e, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, - 0x12, 0x5f, 0x0a, 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x75, 0x6e, 0x6d, - 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, - 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x5f, 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x75, 0x6e, - 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, - 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x75, - 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, + 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x42, 0x49, 0x4e, 0x5f, 0x4d, 0x56, 0x10, 0x04, 0x12, 0x0b, 0x0a, + 0x07, 0x42, 0x49, 0x4e, 0x5f, 0x54, 0x41, 0x52, 0x10, 0x05, 0x32, 0xb3, 0x02, 0x0a, 0x0e, 0x43, + 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, 0x0a, + 0x06, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x42, 0x91, 0x02, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x6e, 0x6d, 0x61, + 0x70, 0x68, 0x61, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, + 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, + 0x0a, 0x06, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, + 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, + 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, + 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, + 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5f, 0x0a, 0x06, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x29, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x42, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x57, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, - 0x6f, 0x6d, 0x2f, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, 0x70, 0x75, 0x6c, 0x75, 0x6d, - 0x69, 0x2d, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, - 0x67, 0x6f, 0x2f, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, 0x62, 0x61, 0x72, 0x65, 0x6d, - 0x65, 0x74, 0x61, 0x6c, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x62, 0x61, - 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, - 0x02, 0x03, 0x55, 0x42, 0x58, 0xaa, 0x02, 0x1a, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, - 0x42, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x31, 0xca, 0x02, 0x1a, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x5c, 0x42, 0x61, 0x72, - 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, - 0x02, 0x26, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x5c, 0x42, 0x61, 0x72, 0x65, 0x6d, 0x65, - 0x74, 0x61, 0x6c, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, - 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x55, 0x6e, 0x6d, 0x61, 0x6e, - 0x67, 0x6f, 0x3a, 0x3a, 0x42, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3a, 0x3a, 0x56, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x62, + 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x42, 0x91, 0x02, 0x0a, 0x1e, 0x63, 0x6f, 0x6d, 0x2e, 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, + 0x2e, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, + 0x68, 0x61, 0x31, 0x42, 0x0c, 0x43, 0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x57, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, 0x70, 0x75, 0x6c, 0x75, 0x6d, 0x69, 0x2d, 0x62, + 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, + 0x75, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2f, 0x62, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, + 0x6c, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x3b, 0x62, 0x61, 0x72, 0x65, 0x6d, + 0x65, 0x74, 0x61, 0x6c, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x55, + 0x42, 0x58, 0xaa, 0x02, 0x1a, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x2e, 0x42, 0x61, 0x72, + 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xca, + 0x02, 0x1a, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x5c, 0x42, 0x61, 0x72, 0x65, 0x6d, 0x65, + 0x74, 0x61, 0x6c, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0xe2, 0x02, 0x26, 0x55, + 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x5c, 0x42, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, + 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x1c, 0x55, 0x6e, 0x6d, 0x61, 0x6e, 0x67, 0x6f, 0x3a, + 0x3a, 0x42, 0x61, 0x72, 0x65, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, + 0x70, 0x68, 0x61, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/proto/unmango/baremetal/v1alpha1/command.proto b/proto/unmango/baremetal/v1alpha1/command.proto index 5078c45c..bde5c7fc 100644 --- a/proto/unmango/baremetal/v1alpha1/command.proto +++ b/proto/unmango/baremetal/v1alpha1/command.proto @@ -68,4 +68,5 @@ enum Bin { BIN_RM = 2; BIN_WGET = 3; BIN_MV = 4; + BIN_TAR = 5; } diff --git a/provider/pkg/provider/cmd/tar.go b/provider/pkg/provider/cmd/tar.go new file mode 100644 index 00000000..028b1c5e --- /dev/null +++ b/provider/pkg/provider/cmd/tar.go @@ -0,0 +1,185 @@ +package cmd + +import ( + "context" + "fmt" + "path" + + "github.com/pulumi/pulumi-go-provider/infer" + pb "github.com/unmango/pulumi-baremetal/gen/go/unmango/baremetal/v1alpha1" +) + +type TarArgs struct { + DefaultFileManipulator + + Args []string `pulumi:"args,optional"` + + // Operation modes + Append bool `pulumi:"append,optional"` + Create bool `pulumi:"create,optional"` + Delete bool `pulumi:"delete,optional"` + Diff bool `pulumi:"diff,optional"` + Extract bool `pulumi:"extract,optional"` + List bool `pulumi:"list,optional"` + Update bool `pulumi:"update,optional"` + Version bool `pulummi:"version,optional"` + + // Operation modifiers + NoSeek bool `pulumi:"noSeek,optional"` + Sparse bool `pulumi:"sparse,optional"` + + // Overwrite control + KeepOldFiles bool `pulumi:"keepOldfiles,optional"` + KeepNewerFiles bool `pulumi:"keepNewerFiles,optional"` + KeepDirectorySymlink bool `pulumi:"keepDirectorySymlink,optional"` + NoOverwriteDir bool `pulumi:"noOverwriteDir,optional"` + Overwrite bool `pulumi:"overwrite,optional"` + OverwriteDir bool `pulumi:"overwriteDir,optional"` + RemoveFiles bool `pulumi:"removeFiles,optional"` + SkipOldFiles bool `pulumi:"skipOldFiles,optional"` + UnlinkFirst bool `pulumi:"unlinkFirst,optional"` + Verify bool `pulumi:"verify,optional"` + + // Output stream selection + IgnoreCommandError bool `pulumi:"ignoreCommandError,optional"` + ToStdout bool `pulumi:"toStdout,optional"` + + // Device selection and switching + File string `pulumi:"file,optional"` + + // Compression options + Bzip2 bool `pulumi:"bzip2,optional"` + Gzip bool `pulumi:"gzip,optional"` + Xz bool `pulumi:"xz,optional"` + Lzip bool `pulumi:"lzip,optional"` + Lzma bool `pulumi:"lzma,optional"` + Lzop bool `pulumi:"lzop,optional"` + Zstd bool `pulumi:"zstd,optional"` + + // Local file selection + Directory string `pulumi:"directory,optional"` + Exclude string `pulumi:"exclude,optional"` + ExcludeVcs bool `pulumi:"excludeVcs,optional"` + ExcludeVcsIgnores bool `pulumi:"excludeVcsIgnores,optional"` + Suffix string `pulumi:"suffix,optional"` + ExcludeFrom string `pulumi:"excludeFrom,optional"` + + // File name transformations + StripComponents int `pulumi:"stripComponents,optional"` + Transform string `pulumi:"transform,optional"` + + // Informative output + Verbose bool `pulumi:"verbose,optional"` +} + +// Cmd implements CommandArgs. +func (t TarArgs) Cmd() *pb.Command { + b := builder{t.Args} + b.op(t.Append, "--append") + b.op(t.Create, "--create") + b.op(t.Delete, "--delete") + b.op(t.Diff, "--diff") + b.op(t.Extract, "--extract") + b.op(t.List, "--list") + + b.opv(t.File, "--file") + + b.op(t.Bzip2, "--bzip2") + b.op(t.Gzip, "--gzip") + b.op(t.Lzip, "--lzip") + b.op(t.Lzma, "--lzma") + b.op(t.Lzop, "--lzop") + b.op(t.Xz, "--xz") + b.op(t.Zstd, "--zstd") + + b.op(t.ExcludeVcs, "--exclude-vcs") + b.op(t.ExcludeVcsIgnores, "--exclude-vcs-ignores") + b.op(t.IgnoreCommandError, "--ignore-command-error") + b.op(t.KeepDirectorySymlink, "--keep-directory-symlink") + b.op(t.KeepNewerFiles, "--keep-newer-files") + b.op(t.KeepOldFiles, "--keep-old-files") + b.op(t.NoOverwriteDir, "--no-overwrite-dir") + b.op(t.NoSeek, "--no-seek") + b.op(t.Overwrite, "--overwrite") + b.op(t.OverwriteDir, "--overwrite-dir") + b.op(t.RemoveFiles, "--remove-files") + b.op(t.SkipOldFiles, "--skip-old-files") + b.op(t.Sparse, "--sparse") + b.op(t.ToStdout, "--to-stdout") + b.op(t.UnlinkFirst, "--unlink-first") + b.op(t.Update, "--update") + b.op(t.Verbose, "--verbose") + b.op(t.Verify, "--verify") + b.op(t.Version, "--version") + + b.opv(t.Directory, "--directory") + b.opv(t.Exclude, "--exclude") + b.opv(t.ExcludeFrom, "--exclude-from") + b.opv(t.Suffix, "--suffix") + b.opv(t.Transform, "--transform") + + return &pb.Command{ + Bin: pb.Bin_BIN_TAR, + Args: b.args, + } +} + +// ExpectCreated implements CommandArgs. +// Subtle: this method shadows the method (DefaultFileManipulator).ExpectCreated of TarArgs.DefaultFileManipulator. +func (t TarArgs) ExpectCreated() []string { + if t.Create && t.File != "" { + return []string{t.File} + } + + if t.Extract && len(t.Args) > 0 { + files := make([]string, len(t.Args)) + for i, m := range t.Args { + // `path.Join` will ignore empty elements, so if `t.Directory` wasn't provided + // this should just return `m`. In that case, `m` should have the same value + // as the relative path we want to remove when deleting, and we can return it here. + files[i] = path.Join(t.Directory, m) + } + return files + } + + return []string{} +} + +var _ CommandArgs = TarArgs{} + +type Tar struct{} + +type TarState = CommandState[TarArgs] + +// Create implements infer.CustomCreate. +func (Tar) Create(ctx context.Context, name string, inputs TarArgs, preview bool) (id string, output TarState, err error) { + state := TarState{} + if err := state.Create(ctx, inputs, preview); err != nil { + return name, state, fmt.Errorf("tar: %w", err) + } + + return name, state, nil +} + +// Update implements infer.CustomUpdate. +func (Tar) Update(ctx context.Context, id string, olds TarState, news TarArgs, preview bool) (TarState, error) { + state, err := olds.Update(ctx, news, preview) + if err != nil { + return olds, fmt.Errorf("tar: %w", err) + } + + return state, nil +} + +// Delete implements infer.CustomDelete. +func (Tar) Delete(ctx context.Context, id string, props TarState) error { + if err := props.Delete(ctx); err != nil { + return fmt.Errorf("tar: %w", err) + } + + return nil +} + +var _ = (infer.CustomCreate[TarArgs, TarState])((*Tar)(nil)) +var _ = (infer.CustomUpdate[TarArgs, TarState])((*Tar)(nil)) +var _ = (infer.CustomDelete[TarState])((*Tar)(nil)) diff --git a/provider/pkg/provisioner/cmd/service.go b/provider/pkg/provisioner/cmd/service.go index ccb29da8..aeb5bf56 100644 --- a/provider/pkg/provisioner/cmd/service.go +++ b/provider/pkg/provisioner/cmd/service.go @@ -215,6 +215,8 @@ func binPath(b pb.Bin) (string, error) { return "mv", nil case pb.Bin_BIN_RM: return "rm", nil + case pb.Bin_BIN_TAR: + return "tar", nil case pb.Bin_BIN_TEE: return "tee", nil case pb.Bin_BIN_WGET: diff --git a/provider/provider.go b/provider/provider.go index 15a8db1c..3b3d50ff 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -48,6 +48,7 @@ func Provider() p.Provider { Resources: []infer.InferredResource{ infer.Resource[cmd.Mv](), infer.Resource[cmd.Rm](), + infer.Resource[cmd.Tar](), infer.Resource[cmd.Tee](), infer.Resource[cmd.Wget](), }, diff --git a/sdk/dotnet/Cmd/Outputs/TarArgs.cs b/sdk/dotnet/Cmd/Outputs/TarArgs.cs new file mode 100644 index 00000000..e2c385a6 --- /dev/null +++ b/sdk/dotnet/Cmd/Outputs/TarArgs.cs @@ -0,0 +1,178 @@ +// *** WARNING: this file was generated by pulumi. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace UnMango.Baremetal.Cmd.Outputs +{ + + [OutputType] + public sealed class TarArgs + { + public readonly bool? Append; + public readonly ImmutableArray Args; + public readonly bool? Bzip2; + public readonly bool? Create; + public readonly bool? Delete; + public readonly bool? Diff; + public readonly string? Directory; + public readonly string? Exclude; + public readonly string? ExcludeFrom; + public readonly bool? ExcludeVcs; + public readonly bool? ExcludeVcsIgnores; + public readonly bool? Extract; + public readonly string? File; + public readonly bool? Gzip; + public readonly bool? IgnoreCommandError; + public readonly bool? KeepDirectorySymlink; + public readonly bool? KeepNewerFiles; + public readonly bool? KeepOldfiles; + public readonly bool? List; + public readonly bool? Lzip; + public readonly bool? Lzma; + public readonly bool? Lzop; + public readonly bool? NoOverwriteDir; + public readonly bool? NoSeek; + public readonly bool? Overwrite; + public readonly bool? OverwriteDir; + public readonly bool? RemoveFiles; + public readonly bool? SkipOldFiles; + public readonly bool? Sparse; + public readonly int? StripComponents; + public readonly string? Suffix; + public readonly bool? ToStdout; + public readonly string? Transform; + public readonly bool? UnlinkFirst; + public readonly bool? Update; + public readonly bool? Verbose; + public readonly bool? Verify; + public readonly bool? Xz; + public readonly bool? Zstd; + + [OutputConstructor] + private TarArgs( + bool? append, + + ImmutableArray args, + + bool? bzip2, + + bool? create, + + bool? delete, + + bool? diff, + + string? directory, + + string? exclude, + + string? excludeFrom, + + bool? excludeVcs, + + bool? excludeVcsIgnores, + + bool? extract, + + string? file, + + bool? gzip, + + bool? ignoreCommandError, + + bool? keepDirectorySymlink, + + bool? keepNewerFiles, + + bool? keepOldfiles, + + bool? list, + + bool? lzip, + + bool? lzma, + + bool? lzop, + + bool? noOverwriteDir, + + bool? noSeek, + + bool? overwrite, + + bool? overwriteDir, + + bool? removeFiles, + + bool? skipOldFiles, + + bool? sparse, + + int? stripComponents, + + string? suffix, + + bool? toStdout, + + string? transform, + + bool? unlinkFirst, + + bool? update, + + bool? verbose, + + bool? verify, + + bool? xz, + + bool? zstd) + { + Append = append; + Args = args; + Bzip2 = bzip2; + Create = create; + Delete = delete; + Diff = diff; + Directory = directory; + Exclude = exclude; + ExcludeFrom = excludeFrom; + ExcludeVcs = excludeVcs; + ExcludeVcsIgnores = excludeVcsIgnores; + Extract = extract; + File = file; + Gzip = gzip; + IgnoreCommandError = ignoreCommandError; + KeepDirectorySymlink = keepDirectorySymlink; + KeepNewerFiles = keepNewerFiles; + KeepOldfiles = keepOldfiles; + List = list; + Lzip = lzip; + Lzma = lzma; + Lzop = lzop; + NoOverwriteDir = noOverwriteDir; + NoSeek = noSeek; + Overwrite = overwrite; + OverwriteDir = overwriteDir; + RemoveFiles = removeFiles; + SkipOldFiles = skipOldFiles; + Sparse = sparse; + StripComponents = stripComponents; + Suffix = suffix; + ToStdout = toStdout; + Transform = transform; + UnlinkFirst = unlinkFirst; + Update = update; + Verbose = verbose; + Verify = verify; + Xz = xz; + Zstd = zstd; + } + } +} diff --git a/sdk/dotnet/Cmd/Tar.cs b/sdk/dotnet/Cmd/Tar.cs new file mode 100644 index 00000000..3e71828f --- /dev/null +++ b/sdk/dotnet/Cmd/Tar.cs @@ -0,0 +1,207 @@ +// *** WARNING: this file was generated by pulumi. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Threading.Tasks; +using Pulumi.Serialization; +using Pulumi; + +namespace UnMango.Baremetal.Cmd +{ + [BaremetalResourceType("baremetal:cmd:Tar")] + public partial class Tar : global::Pulumi.CustomResource + { + [Output("args")] + public Output Args { get; private set; } = null!; + + [Output("createdFiles")] + public Output> CreatedFiles { get; private set; } = null!; + + [Output("exitCode")] + public Output ExitCode { get; private set; } = null!; + + [Output("movedFiles")] + public Output> MovedFiles { get; private set; } = null!; + + [Output("stderr")] + public Output Stderr { get; private set; } = null!; + + [Output("stdout")] + public Output Stdout { get; private set; } = null!; + + + /// + /// Create a Tar resource with the given unique name, arguments, and options. + /// + /// + /// The unique name of the resource + /// The arguments used to populate this resource's properties + /// A bag of options that control this resource's behavior + public Tar(string name, TarArgs? args = null, CustomResourceOptions? options = null) + : base("baremetal:cmd:Tar", name, args ?? new TarArgs(), MakeResourceOptions(options, "")) + { + } + + private Tar(string name, Input id, CustomResourceOptions? options = null) + : base("baremetal:cmd:Tar", name, null, MakeResourceOptions(options, id)) + { + } + + private static CustomResourceOptions MakeResourceOptions(CustomResourceOptions? options, Input? id) + { + var defaultOptions = new CustomResourceOptions + { + Version = Utilities.Version, + PluginDownloadURL = "github://api.github.com/unmango", + }; + var merged = CustomResourceOptions.Merge(defaultOptions, options); + // Override the ID if one was specified for consistency with other language SDKs. + merged.Id = id ?? merged.Id; + return merged; + } + /// + /// Get an existing Tar resource's state with the given name, ID, and optional extra + /// properties used to qualify the lookup. + /// + /// + /// The unique name of the resulting resource. + /// The unique provider ID of the resource to lookup. + /// A bag of options that control this resource's behavior + public static Tar Get(string name, Input id, CustomResourceOptions? options = null) + { + return new Tar(name, id, options); + } + } + + public sealed class TarArgs : global::Pulumi.ResourceArgs + { + [Input("append")] + public Input? Append { get; set; } + + [Input("args")] + private InputList? _args; + public InputList Args + { + get => _args ?? (_args = new InputList()); + set => _args = value; + } + + [Input("bzip2")] + public Input? Bzip2 { get; set; } + + [Input("create")] + public Input? Create { get; set; } + + [Input("delete")] + public Input? Delete { get; set; } + + [Input("diff")] + public Input? Diff { get; set; } + + [Input("directory")] + public Input? Directory { get; set; } + + [Input("exclude")] + public Input? Exclude { get; set; } + + [Input("excludeFrom")] + public Input? ExcludeFrom { get; set; } + + [Input("excludeVcs")] + public Input? ExcludeVcs { get; set; } + + [Input("excludeVcsIgnores")] + public Input? ExcludeVcsIgnores { get; set; } + + [Input("extract")] + public Input? Extract { get; set; } + + [Input("file")] + public Input? File { get; set; } + + [Input("gzip")] + public Input? Gzip { get; set; } + + [Input("ignoreCommandError")] + public Input? IgnoreCommandError { get; set; } + + [Input("keepDirectorySymlink")] + public Input? KeepDirectorySymlink { get; set; } + + [Input("keepNewerFiles")] + public Input? KeepNewerFiles { get; set; } + + [Input("keepOldfiles")] + public Input? KeepOldfiles { get; set; } + + [Input("list")] + public Input? List { get; set; } + + [Input("lzip")] + public Input? Lzip { get; set; } + + [Input("lzma")] + public Input? Lzma { get; set; } + + [Input("lzop")] + public Input? Lzop { get; set; } + + [Input("noOverwriteDir")] + public Input? NoOverwriteDir { get; set; } + + [Input("noSeek")] + public Input? NoSeek { get; set; } + + [Input("overwrite")] + public Input? Overwrite { get; set; } + + [Input("overwriteDir")] + public Input? OverwriteDir { get; set; } + + [Input("removeFiles")] + public Input? RemoveFiles { get; set; } + + [Input("skipOldFiles")] + public Input? SkipOldFiles { get; set; } + + [Input("sparse")] + public Input? Sparse { get; set; } + + [Input("stripComponents")] + public Input? StripComponents { get; set; } + + [Input("suffix")] + public Input? Suffix { get; set; } + + [Input("toStdout")] + public Input? ToStdout { get; set; } + + [Input("transform")] + public Input? Transform { get; set; } + + [Input("unlinkFirst")] + public Input? UnlinkFirst { get; set; } + + [Input("update")] + public Input? Update { get; set; } + + [Input("verbose")] + public Input? Verbose { get; set; } + + [Input("verify")] + public Input? Verify { get; set; } + + [Input("xz")] + public Input? Xz { get; set; } + + [Input("zstd")] + public Input? Zstd { get; set; } + + public TarArgs() + { + } + public static new TarArgs Empty => new TarArgs(); + } +} diff --git a/sdk/go/baremetal/cmd/init.go b/sdk/go/baremetal/cmd/init.go index a321727c..5cff1c70 100644 --- a/sdk/go/baremetal/cmd/init.go +++ b/sdk/go/baremetal/cmd/init.go @@ -25,6 +25,8 @@ func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi r = &Mv{} case "baremetal:cmd:Rm": r = &Rm{} + case "baremetal:cmd:Tar": + r = &Tar{} case "baremetal:cmd:Tee": r = &Tee{} case "baremetal:cmd:Wget": diff --git a/sdk/go/baremetal/cmd/pulumiTypes.go b/sdk/go/baremetal/cmd/pulumiTypes.go index bd0ed53a..88402f14 100644 --- a/sdk/go/baremetal/cmd/pulumiTypes.go +++ b/sdk/go/baremetal/cmd/pulumiTypes.go @@ -165,6 +165,224 @@ func (o RmArgsTypeOutput) Verbose() pulumi.BoolPtrOutput { return o.ApplyT(func(v RmArgsType) *bool { return v.Verbose }).(pulumi.BoolPtrOutput) } +type TarArgsType struct { + Append *bool `pulumi:"append"` + Args []string `pulumi:"args"` + Bzip2 *bool `pulumi:"bzip2"` + Create *bool `pulumi:"create"` + Delete *bool `pulumi:"delete"` + Diff *bool `pulumi:"diff"` + Directory *string `pulumi:"directory"` + Exclude *string `pulumi:"exclude"` + ExcludeFrom *string `pulumi:"excludeFrom"` + ExcludeVcs *bool `pulumi:"excludeVcs"` + ExcludeVcsIgnores *bool `pulumi:"excludeVcsIgnores"` + Extract *bool `pulumi:"extract"` + File *string `pulumi:"file"` + Gzip *bool `pulumi:"gzip"` + IgnoreCommandError *bool `pulumi:"ignoreCommandError"` + KeepDirectorySymlink *bool `pulumi:"keepDirectorySymlink"` + KeepNewerFiles *bool `pulumi:"keepNewerFiles"` + KeepOldfiles *bool `pulumi:"keepOldfiles"` + List *bool `pulumi:"list"` + Lzip *bool `pulumi:"lzip"` + Lzma *bool `pulumi:"lzma"` + Lzop *bool `pulumi:"lzop"` + NoOverwriteDir *bool `pulumi:"noOverwriteDir"` + NoSeek *bool `pulumi:"noSeek"` + Overwrite *bool `pulumi:"overwrite"` + OverwriteDir *bool `pulumi:"overwriteDir"` + RemoveFiles *bool `pulumi:"removeFiles"` + SkipOldFiles *bool `pulumi:"skipOldFiles"` + Sparse *bool `pulumi:"sparse"` + StripComponents *int `pulumi:"stripComponents"` + Suffix *string `pulumi:"suffix"` + ToStdout *bool `pulumi:"toStdout"` + Transform *string `pulumi:"transform"` + UnlinkFirst *bool `pulumi:"unlinkFirst"` + Update *bool `pulumi:"update"` + Verbose *bool `pulumi:"verbose"` + Verify *bool `pulumi:"verify"` + Xz *bool `pulumi:"xz"` + Zstd *bool `pulumi:"zstd"` +} + +type TarArgsTypeOutput struct{ *pulumi.OutputState } + +func (TarArgsTypeOutput) ElementType() reflect.Type { + return reflect.TypeOf((*TarArgsType)(nil)).Elem() +} + +func (o TarArgsTypeOutput) ToTarArgsTypeOutput() TarArgsTypeOutput { + return o +} + +func (o TarArgsTypeOutput) ToTarArgsTypeOutputWithContext(ctx context.Context) TarArgsTypeOutput { + return o +} + +func (o TarArgsTypeOutput) ToOutput(ctx context.Context) pulumix.Output[TarArgsType] { + return pulumix.Output[TarArgsType]{ + OutputState: o.OutputState, + } +} + +func (o TarArgsTypeOutput) Append() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Append }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Args() pulumi.StringArrayOutput { + return o.ApplyT(func(v TarArgsType) []string { return v.Args }).(pulumi.StringArrayOutput) +} + +func (o TarArgsTypeOutput) Bzip2() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Bzip2 }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Create() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Create }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Delete() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Delete }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Diff() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Diff }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Directory() pulumi.StringPtrOutput { + return o.ApplyT(func(v TarArgsType) *string { return v.Directory }).(pulumi.StringPtrOutput) +} + +func (o TarArgsTypeOutput) Exclude() pulumi.StringPtrOutput { + return o.ApplyT(func(v TarArgsType) *string { return v.Exclude }).(pulumi.StringPtrOutput) +} + +func (o TarArgsTypeOutput) ExcludeFrom() pulumi.StringPtrOutput { + return o.ApplyT(func(v TarArgsType) *string { return v.ExcludeFrom }).(pulumi.StringPtrOutput) +} + +func (o TarArgsTypeOutput) ExcludeVcs() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.ExcludeVcs }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) ExcludeVcsIgnores() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.ExcludeVcsIgnores }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Extract() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Extract }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) File() pulumi.StringPtrOutput { + return o.ApplyT(func(v TarArgsType) *string { return v.File }).(pulumi.StringPtrOutput) +} + +func (o TarArgsTypeOutput) Gzip() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Gzip }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) IgnoreCommandError() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.IgnoreCommandError }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) KeepDirectorySymlink() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.KeepDirectorySymlink }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) KeepNewerFiles() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.KeepNewerFiles }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) KeepOldfiles() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.KeepOldfiles }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) List() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.List }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Lzip() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Lzip }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Lzma() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Lzma }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Lzop() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Lzop }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) NoOverwriteDir() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.NoOverwriteDir }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) NoSeek() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.NoSeek }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Overwrite() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Overwrite }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) OverwriteDir() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.OverwriteDir }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) RemoveFiles() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.RemoveFiles }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) SkipOldFiles() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.SkipOldFiles }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Sparse() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Sparse }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) StripComponents() pulumi.IntPtrOutput { + return o.ApplyT(func(v TarArgsType) *int { return v.StripComponents }).(pulumi.IntPtrOutput) +} + +func (o TarArgsTypeOutput) Suffix() pulumi.StringPtrOutput { + return o.ApplyT(func(v TarArgsType) *string { return v.Suffix }).(pulumi.StringPtrOutput) +} + +func (o TarArgsTypeOutput) ToStdout() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.ToStdout }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Transform() pulumi.StringPtrOutput { + return o.ApplyT(func(v TarArgsType) *string { return v.Transform }).(pulumi.StringPtrOutput) +} + +func (o TarArgsTypeOutput) UnlinkFirst() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.UnlinkFirst }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Update() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Update }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Verbose() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Verbose }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Verify() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Verify }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Xz() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Xz }).(pulumi.BoolPtrOutput) +} + +func (o TarArgsTypeOutput) Zstd() pulumi.BoolPtrOutput { + return o.ApplyT(func(v TarArgsType) *bool { return v.Zstd }).(pulumi.BoolPtrOutput) +} + type TeeArgsType struct { Append *bool `pulumi:"append"` Content string `pulumi:"content"` @@ -459,6 +677,7 @@ func (o WgetArgsTypeOutput) Wait() pulumi.StringPtrOutput { func init() { pulumi.RegisterOutputType(MvArgsTypeOutput{}) pulumi.RegisterOutputType(RmArgsTypeOutput{}) + pulumi.RegisterOutputType(TarArgsTypeOutput{}) pulumi.RegisterOutputType(TeeArgsTypeOutput{}) pulumi.RegisterOutputType(WgetArgsTypeOutput{}) } diff --git a/sdk/go/baremetal/cmd/tar.go b/sdk/go/baremetal/cmd/tar.go new file mode 100644 index 00000000..e2630d90 --- /dev/null +++ b/sdk/go/baremetal/cmd/tar.go @@ -0,0 +1,226 @@ +// Code generated by pulumi-language-go DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package cmd + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" + "github.com/unmango/pulumi-baremetal/sdk/go/baremetal/internal" +) + +type Tar struct { + pulumi.CustomResourceState + + Args TarArgsTypeOutput `pulumi:"args"` + CreatedFiles pulumi.StringArrayOutput `pulumi:"createdFiles"` + ExitCode pulumi.IntOutput `pulumi:"exitCode"` + MovedFiles pulumi.StringMapOutput `pulumi:"movedFiles"` + Stderr pulumi.StringOutput `pulumi:"stderr"` + Stdout pulumi.StringOutput `pulumi:"stdout"` +} + +// NewTar registers a new resource with the given unique name, arguments, and options. +func NewTar(ctx *pulumi.Context, + name string, args *TarArgs, opts ...pulumi.ResourceOption) (*Tar, error) { + if args == nil { + args = &TarArgs{} + } + + opts = internal.PkgResourceDefaultOpts(opts) + var resource Tar + err := ctx.RegisterResource("baremetal:cmd:Tar", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetTar gets an existing Tar resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetTar(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *TarState, opts ...pulumi.ResourceOption) (*Tar, error) { + var resource Tar + err := ctx.ReadResource("baremetal:cmd:Tar", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Tar resources. +type tarState struct { +} + +type TarState struct { +} + +func (TarState) ElementType() reflect.Type { + return reflect.TypeOf((*tarState)(nil)).Elem() +} + +type tarArgs struct { + Append *bool `pulumi:"append"` + Args []string `pulumi:"args"` + Bzip2 *bool `pulumi:"bzip2"` + Create *bool `pulumi:"create"` + Delete *bool `pulumi:"delete"` + Diff *bool `pulumi:"diff"` + Directory *string `pulumi:"directory"` + Exclude *string `pulumi:"exclude"` + ExcludeFrom *string `pulumi:"excludeFrom"` + ExcludeVcs *bool `pulumi:"excludeVcs"` + ExcludeVcsIgnores *bool `pulumi:"excludeVcsIgnores"` + Extract *bool `pulumi:"extract"` + File *string `pulumi:"file"` + Gzip *bool `pulumi:"gzip"` + IgnoreCommandError *bool `pulumi:"ignoreCommandError"` + KeepDirectorySymlink *bool `pulumi:"keepDirectorySymlink"` + KeepNewerFiles *bool `pulumi:"keepNewerFiles"` + KeepOldfiles *bool `pulumi:"keepOldfiles"` + List *bool `pulumi:"list"` + Lzip *bool `pulumi:"lzip"` + Lzma *bool `pulumi:"lzma"` + Lzop *bool `pulumi:"lzop"` + NoOverwriteDir *bool `pulumi:"noOverwriteDir"` + NoSeek *bool `pulumi:"noSeek"` + Overwrite *bool `pulumi:"overwrite"` + OverwriteDir *bool `pulumi:"overwriteDir"` + RemoveFiles *bool `pulumi:"removeFiles"` + SkipOldFiles *bool `pulumi:"skipOldFiles"` + Sparse *bool `pulumi:"sparse"` + StripComponents *int `pulumi:"stripComponents"` + Suffix *string `pulumi:"suffix"` + ToStdout *bool `pulumi:"toStdout"` + Transform *string `pulumi:"transform"` + UnlinkFirst *bool `pulumi:"unlinkFirst"` + Update *bool `pulumi:"update"` + Verbose *bool `pulumi:"verbose"` + Verify *bool `pulumi:"verify"` + Xz *bool `pulumi:"xz"` + Zstd *bool `pulumi:"zstd"` +} + +// The set of arguments for constructing a Tar resource. +type TarArgs struct { + Append pulumi.BoolPtrInput + Args pulumi.StringArrayInput + Bzip2 pulumi.BoolPtrInput + Create pulumi.BoolPtrInput + Delete pulumi.BoolPtrInput + Diff pulumi.BoolPtrInput + Directory pulumi.StringPtrInput + Exclude pulumi.StringPtrInput + ExcludeFrom pulumi.StringPtrInput + ExcludeVcs pulumi.BoolPtrInput + ExcludeVcsIgnores pulumi.BoolPtrInput + Extract pulumi.BoolPtrInput + File pulumi.StringPtrInput + Gzip pulumi.BoolPtrInput + IgnoreCommandError pulumi.BoolPtrInput + KeepDirectorySymlink pulumi.BoolPtrInput + KeepNewerFiles pulumi.BoolPtrInput + KeepOldfiles pulumi.BoolPtrInput + List pulumi.BoolPtrInput + Lzip pulumi.BoolPtrInput + Lzma pulumi.BoolPtrInput + Lzop pulumi.BoolPtrInput + NoOverwriteDir pulumi.BoolPtrInput + NoSeek pulumi.BoolPtrInput + Overwrite pulumi.BoolPtrInput + OverwriteDir pulumi.BoolPtrInput + RemoveFiles pulumi.BoolPtrInput + SkipOldFiles pulumi.BoolPtrInput + Sparse pulumi.BoolPtrInput + StripComponents pulumi.IntPtrInput + Suffix pulumi.StringPtrInput + ToStdout pulumi.BoolPtrInput + Transform pulumi.StringPtrInput + UnlinkFirst pulumi.BoolPtrInput + Update pulumi.BoolPtrInput + Verbose pulumi.BoolPtrInput + Verify pulumi.BoolPtrInput + Xz pulumi.BoolPtrInput + Zstd pulumi.BoolPtrInput +} + +func (TarArgs) ElementType() reflect.Type { + return reflect.TypeOf((*tarArgs)(nil)).Elem() +} + +type TarInput interface { + pulumi.Input + + ToTarOutput() TarOutput + ToTarOutputWithContext(ctx context.Context) TarOutput +} + +func (*Tar) ElementType() reflect.Type { + return reflect.TypeOf((**Tar)(nil)).Elem() +} + +func (i *Tar) ToTarOutput() TarOutput { + return i.ToTarOutputWithContext(context.Background()) +} + +func (i *Tar) ToTarOutputWithContext(ctx context.Context) TarOutput { + return pulumi.ToOutputWithContext(ctx, i).(TarOutput) +} + +func (i *Tar) ToOutput(ctx context.Context) pulumix.Output[*Tar] { + return pulumix.Output[*Tar]{ + OutputState: i.ToTarOutputWithContext(ctx).OutputState, + } +} + +type TarOutput struct{ *pulumi.OutputState } + +func (TarOutput) ElementType() reflect.Type { + return reflect.TypeOf((**Tar)(nil)).Elem() +} + +func (o TarOutput) ToTarOutput() TarOutput { + return o +} + +func (o TarOutput) ToTarOutputWithContext(ctx context.Context) TarOutput { + return o +} + +func (o TarOutput) ToOutput(ctx context.Context) pulumix.Output[*Tar] { + return pulumix.Output[*Tar]{ + OutputState: o.OutputState, + } +} + +func (o TarOutput) Args() TarArgsTypeOutput { + return o.ApplyT(func(v *Tar) TarArgsTypeOutput { return v.Args }).(TarArgsTypeOutput) +} + +func (o TarOutput) CreatedFiles() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Tar) pulumi.StringArrayOutput { return v.CreatedFiles }).(pulumi.StringArrayOutput) +} + +func (o TarOutput) ExitCode() pulumi.IntOutput { + return o.ApplyT(func(v *Tar) pulumi.IntOutput { return v.ExitCode }).(pulumi.IntOutput) +} + +func (o TarOutput) MovedFiles() pulumi.StringMapOutput { + return o.ApplyT(func(v *Tar) pulumi.StringMapOutput { return v.MovedFiles }).(pulumi.StringMapOutput) +} + +func (o TarOutput) Stderr() pulumi.StringOutput { + return o.ApplyT(func(v *Tar) pulumi.StringOutput { return v.Stderr }).(pulumi.StringOutput) +} + +func (o TarOutput) Stdout() pulumi.StringOutput { + return o.ApplyT(func(v *Tar) pulumi.StringOutput { return v.Stdout }).(pulumi.StringOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*TarInput)(nil)).Elem(), &Tar{}) + pulumi.RegisterOutputType(TarOutput{}) +} diff --git a/sdk/go/baremetal/x/cmd/init.go b/sdk/go/baremetal/x/cmd/init.go index a321727c..5cff1c70 100644 --- a/sdk/go/baremetal/x/cmd/init.go +++ b/sdk/go/baremetal/x/cmd/init.go @@ -25,6 +25,8 @@ func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi r = &Mv{} case "baremetal:cmd:Rm": r = &Rm{} + case "baremetal:cmd:Tar": + r = &Tar{} case "baremetal:cmd:Tee": r = &Tee{} case "baremetal:cmd:Wget": diff --git a/sdk/go/baremetal/x/cmd/pulumiTypes.go b/sdk/go/baremetal/x/cmd/pulumiTypes.go index e4e957ac..3a4df42d 100644 --- a/sdk/go/baremetal/x/cmd/pulumiTypes.go +++ b/sdk/go/baremetal/x/cmd/pulumiTypes.go @@ -167,6 +167,225 @@ func (o RmArgsTypeOutput) Verbose() pulumix.Output[*bool] { return pulumix.Apply[RmArgsType](o, func(v RmArgsType) *bool { return v.Verbose }) } +type TarArgsType struct { + Append *bool `pulumi:"append"` + Args []string `pulumi:"args"` + Bzip2 *bool `pulumi:"bzip2"` + Create *bool `pulumi:"create"` + Delete *bool `pulumi:"delete"` + Diff *bool `pulumi:"diff"` + Directory *string `pulumi:"directory"` + Exclude *string `pulumi:"exclude"` + ExcludeFrom *string `pulumi:"excludeFrom"` + ExcludeVcs *bool `pulumi:"excludeVcs"` + ExcludeVcsIgnores *bool `pulumi:"excludeVcsIgnores"` + Extract *bool `pulumi:"extract"` + File *string `pulumi:"file"` + Gzip *bool `pulumi:"gzip"` + IgnoreCommandError *bool `pulumi:"ignoreCommandError"` + KeepDirectorySymlink *bool `pulumi:"keepDirectorySymlink"` + KeepNewerFiles *bool `pulumi:"keepNewerFiles"` + KeepOldfiles *bool `pulumi:"keepOldfiles"` + List *bool `pulumi:"list"` + Lzip *bool `pulumi:"lzip"` + Lzma *bool `pulumi:"lzma"` + Lzop *bool `pulumi:"lzop"` + NoOverwriteDir *bool `pulumi:"noOverwriteDir"` + NoSeek *bool `pulumi:"noSeek"` + Overwrite *bool `pulumi:"overwrite"` + OverwriteDir *bool `pulumi:"overwriteDir"` + RemoveFiles *bool `pulumi:"removeFiles"` + SkipOldFiles *bool `pulumi:"skipOldFiles"` + Sparse *bool `pulumi:"sparse"` + StripComponents *int `pulumi:"stripComponents"` + Suffix *string `pulumi:"suffix"` + ToStdout *bool `pulumi:"toStdout"` + Transform *string `pulumi:"transform"` + UnlinkFirst *bool `pulumi:"unlinkFirst"` + Update *bool `pulumi:"update"` + Verbose *bool `pulumi:"verbose"` + Verify *bool `pulumi:"verify"` + Xz *bool `pulumi:"xz"` + Zstd *bool `pulumi:"zstd"` +} + +type TarArgsTypeOutput struct{ *pulumi.OutputState } + +func (TarArgsTypeOutput) ElementType() reflect.Type { + return reflect.TypeOf((*TarArgsType)(nil)).Elem() +} + +func (o TarArgsTypeOutput) ToTarArgsTypeOutput() TarArgsTypeOutput { + return o +} + +func (o TarArgsTypeOutput) ToTarArgsTypeOutputWithContext(ctx context.Context) TarArgsTypeOutput { + return o +} + +func (o TarArgsTypeOutput) ToOutput(ctx context.Context) pulumix.Output[TarArgsType] { + return pulumix.Output[TarArgsType]{ + OutputState: o.OutputState, + } +} + +func (o TarArgsTypeOutput) Append() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Append }) +} + +func (o TarArgsTypeOutput) Args() pulumix.ArrayOutput[string] { + value := pulumix.Apply[TarArgsType](o, func(v TarArgsType) []string { return v.Args }) + return pulumix.ArrayOutput[string]{OutputState: value.OutputState} +} + +func (o TarArgsTypeOutput) Bzip2() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Bzip2 }) +} + +func (o TarArgsTypeOutput) Create() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Create }) +} + +func (o TarArgsTypeOutput) Delete() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Delete }) +} + +func (o TarArgsTypeOutput) Diff() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Diff }) +} + +func (o TarArgsTypeOutput) Directory() pulumix.Output[*string] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *string { return v.Directory }) +} + +func (o TarArgsTypeOutput) Exclude() pulumix.Output[*string] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *string { return v.Exclude }) +} + +func (o TarArgsTypeOutput) ExcludeFrom() pulumix.Output[*string] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *string { return v.ExcludeFrom }) +} + +func (o TarArgsTypeOutput) ExcludeVcs() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.ExcludeVcs }) +} + +func (o TarArgsTypeOutput) ExcludeVcsIgnores() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.ExcludeVcsIgnores }) +} + +func (o TarArgsTypeOutput) Extract() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Extract }) +} + +func (o TarArgsTypeOutput) File() pulumix.Output[*string] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *string { return v.File }) +} + +func (o TarArgsTypeOutput) Gzip() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Gzip }) +} + +func (o TarArgsTypeOutput) IgnoreCommandError() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.IgnoreCommandError }) +} + +func (o TarArgsTypeOutput) KeepDirectorySymlink() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.KeepDirectorySymlink }) +} + +func (o TarArgsTypeOutput) KeepNewerFiles() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.KeepNewerFiles }) +} + +func (o TarArgsTypeOutput) KeepOldfiles() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.KeepOldfiles }) +} + +func (o TarArgsTypeOutput) List() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.List }) +} + +func (o TarArgsTypeOutput) Lzip() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Lzip }) +} + +func (o TarArgsTypeOutput) Lzma() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Lzma }) +} + +func (o TarArgsTypeOutput) Lzop() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Lzop }) +} + +func (o TarArgsTypeOutput) NoOverwriteDir() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.NoOverwriteDir }) +} + +func (o TarArgsTypeOutput) NoSeek() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.NoSeek }) +} + +func (o TarArgsTypeOutput) Overwrite() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Overwrite }) +} + +func (o TarArgsTypeOutput) OverwriteDir() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.OverwriteDir }) +} + +func (o TarArgsTypeOutput) RemoveFiles() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.RemoveFiles }) +} + +func (o TarArgsTypeOutput) SkipOldFiles() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.SkipOldFiles }) +} + +func (o TarArgsTypeOutput) Sparse() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Sparse }) +} + +func (o TarArgsTypeOutput) StripComponents() pulumix.Output[*int] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *int { return v.StripComponents }) +} + +func (o TarArgsTypeOutput) Suffix() pulumix.Output[*string] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *string { return v.Suffix }) +} + +func (o TarArgsTypeOutput) ToStdout() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.ToStdout }) +} + +func (o TarArgsTypeOutput) Transform() pulumix.Output[*string] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *string { return v.Transform }) +} + +func (o TarArgsTypeOutput) UnlinkFirst() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.UnlinkFirst }) +} + +func (o TarArgsTypeOutput) Update() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Update }) +} + +func (o TarArgsTypeOutput) Verbose() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Verbose }) +} + +func (o TarArgsTypeOutput) Verify() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Verify }) +} + +func (o TarArgsTypeOutput) Xz() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Xz }) +} + +func (o TarArgsTypeOutput) Zstd() pulumix.Output[*bool] { + return pulumix.Apply[TarArgsType](o, func(v TarArgsType) *bool { return v.Zstd }) +} + type TeeArgsType struct { Append *bool `pulumi:"append"` Content string `pulumi:"content"` @@ -464,6 +683,7 @@ func (o WgetArgsTypeOutput) Wait() pulumix.Output[*string] { func init() { pulumi.RegisterOutputType(MvArgsTypeOutput{}) pulumi.RegisterOutputType(RmArgsTypeOutput{}) + pulumi.RegisterOutputType(TarArgsTypeOutput{}) pulumi.RegisterOutputType(TeeArgsTypeOutput{}) pulumi.RegisterOutputType(WgetArgsTypeOutput{}) } diff --git a/sdk/go/baremetal/x/cmd/tar.go b/sdk/go/baremetal/x/cmd/tar.go new file mode 100644 index 00000000..f795c6a8 --- /dev/null +++ b/sdk/go/baremetal/x/cmd/tar.go @@ -0,0 +1,209 @@ +// Code generated by pulumi-language-go DO NOT EDIT. +// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** + +package cmd + +import ( + "context" + "reflect" + + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/pulumi/pulumi/sdk/v3/go/pulumix" + "github.com/unmango/pulumi-baremetal/sdk/go/baremetal/internal" +) + +type Tar struct { + pulumi.CustomResourceState + + Args pulumix.GPtrOutput[TarArgsType, TarArgsTypeOutput] `pulumi:"args"` + CreatedFiles pulumix.ArrayOutput[string] `pulumi:"createdFiles"` + ExitCode pulumix.Output[int] `pulumi:"exitCode"` + MovedFiles pulumix.MapOutput[string] `pulumi:"movedFiles"` + Stderr pulumix.Output[string] `pulumi:"stderr"` + Stdout pulumix.Output[string] `pulumi:"stdout"` +} + +// NewTar registers a new resource with the given unique name, arguments, and options. +func NewTar(ctx *pulumi.Context, + name string, args *TarArgs, opts ...pulumi.ResourceOption) (*Tar, error) { + if args == nil { + args = &TarArgs{} + } + + opts = internal.PkgResourceDefaultOpts(opts) + var resource Tar + err := ctx.RegisterResource("baremetal:cmd:Tar", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetTar gets an existing Tar resource's state with the given name, ID, and optional +// state properties that are used to uniquely qualify the lookup (nil if not required). +func GetTar(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *TarState, opts ...pulumi.ResourceOption) (*Tar, error) { + var resource Tar + err := ctx.ReadResource("baremetal:cmd:Tar", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Tar resources. +type tarState struct { +} + +type TarState struct { +} + +func (TarState) ElementType() reflect.Type { + return reflect.TypeOf((*tarState)(nil)).Elem() +} + +type tarArgs struct { + Append *bool `pulumi:"append"` + Args []string `pulumi:"args"` + Bzip2 *bool `pulumi:"bzip2"` + Create *bool `pulumi:"create"` + Delete *bool `pulumi:"delete"` + Diff *bool `pulumi:"diff"` + Directory *string `pulumi:"directory"` + Exclude *string `pulumi:"exclude"` + ExcludeFrom *string `pulumi:"excludeFrom"` + ExcludeVcs *bool `pulumi:"excludeVcs"` + ExcludeVcsIgnores *bool `pulumi:"excludeVcsIgnores"` + Extract *bool `pulumi:"extract"` + File *string `pulumi:"file"` + Gzip *bool `pulumi:"gzip"` + IgnoreCommandError *bool `pulumi:"ignoreCommandError"` + KeepDirectorySymlink *bool `pulumi:"keepDirectorySymlink"` + KeepNewerFiles *bool `pulumi:"keepNewerFiles"` + KeepOldfiles *bool `pulumi:"keepOldfiles"` + List *bool `pulumi:"list"` + Lzip *bool `pulumi:"lzip"` + Lzma *bool `pulumi:"lzma"` + Lzop *bool `pulumi:"lzop"` + NoOverwriteDir *bool `pulumi:"noOverwriteDir"` + NoSeek *bool `pulumi:"noSeek"` + Overwrite *bool `pulumi:"overwrite"` + OverwriteDir *bool `pulumi:"overwriteDir"` + RemoveFiles *bool `pulumi:"removeFiles"` + SkipOldFiles *bool `pulumi:"skipOldFiles"` + Sparse *bool `pulumi:"sparse"` + StripComponents *int `pulumi:"stripComponents"` + Suffix *string `pulumi:"suffix"` + ToStdout *bool `pulumi:"toStdout"` + Transform *string `pulumi:"transform"` + UnlinkFirst *bool `pulumi:"unlinkFirst"` + Update *bool `pulumi:"update"` + Verbose *bool `pulumi:"verbose"` + Verify *bool `pulumi:"verify"` + Xz *bool `pulumi:"xz"` + Zstd *bool `pulumi:"zstd"` +} + +// The set of arguments for constructing a Tar resource. +type TarArgs struct { + Append pulumix.Input[*bool] + Args pulumix.Input[[]string] + Bzip2 pulumix.Input[*bool] + Create pulumix.Input[*bool] + Delete pulumix.Input[*bool] + Diff pulumix.Input[*bool] + Directory pulumix.Input[*string] + Exclude pulumix.Input[*string] + ExcludeFrom pulumix.Input[*string] + ExcludeVcs pulumix.Input[*bool] + ExcludeVcsIgnores pulumix.Input[*bool] + Extract pulumix.Input[*bool] + File pulumix.Input[*string] + Gzip pulumix.Input[*bool] + IgnoreCommandError pulumix.Input[*bool] + KeepDirectorySymlink pulumix.Input[*bool] + KeepNewerFiles pulumix.Input[*bool] + KeepOldfiles pulumix.Input[*bool] + List pulumix.Input[*bool] + Lzip pulumix.Input[*bool] + Lzma pulumix.Input[*bool] + Lzop pulumix.Input[*bool] + NoOverwriteDir pulumix.Input[*bool] + NoSeek pulumix.Input[*bool] + Overwrite pulumix.Input[*bool] + OverwriteDir pulumix.Input[*bool] + RemoveFiles pulumix.Input[*bool] + SkipOldFiles pulumix.Input[*bool] + Sparse pulumix.Input[*bool] + StripComponents pulumix.Input[*int] + Suffix pulumix.Input[*string] + ToStdout pulumix.Input[*bool] + Transform pulumix.Input[*string] + UnlinkFirst pulumix.Input[*bool] + Update pulumix.Input[*bool] + Verbose pulumix.Input[*bool] + Verify pulumix.Input[*bool] + Xz pulumix.Input[*bool] + Zstd pulumix.Input[*bool] +} + +func (TarArgs) ElementType() reflect.Type { + return reflect.TypeOf((*tarArgs)(nil)).Elem() +} + +type TarOutput struct{ *pulumi.OutputState } + +func (TarOutput) ElementType() reflect.Type { + return reflect.TypeOf((*Tar)(nil)).Elem() +} + +func (o TarOutput) ToTarOutput() TarOutput { + return o +} + +func (o TarOutput) ToTarOutputWithContext(ctx context.Context) TarOutput { + return o +} + +func (o TarOutput) ToOutput(ctx context.Context) pulumix.Output[Tar] { + return pulumix.Output[Tar]{ + OutputState: o.OutputState, + } +} + +func (o TarOutput) Args() pulumix.GPtrOutput[TarArgsType, TarArgsTypeOutput] { + value := pulumix.Apply[Tar](o, func(v Tar) pulumix.GPtrOutput[TarArgsType, TarArgsTypeOutput] { return v.Args }) + unwrapped := pulumix.Flatten[*TarArgsType, pulumix.GPtrOutput[TarArgsType, TarArgsTypeOutput]](value) + return pulumix.GPtrOutput[TarArgsType, TarArgsTypeOutput]{OutputState: unwrapped.OutputState} +} + +func (o TarOutput) CreatedFiles() pulumix.ArrayOutput[string] { + value := pulumix.Apply[Tar](o, func(v Tar) pulumix.ArrayOutput[string] { return v.CreatedFiles }) + unwrapped := pulumix.Flatten[[]string, pulumix.ArrayOutput[string]](value) + return pulumix.ArrayOutput[string]{OutputState: unwrapped.OutputState} +} + +func (o TarOutput) ExitCode() pulumix.Output[int] { + value := pulumix.Apply[Tar](o, func(v Tar) pulumix.Output[int] { return v.ExitCode }) + return pulumix.Flatten[int, pulumix.Output[int]](value) +} + +func (o TarOutput) MovedFiles() pulumix.MapOutput[string] { + value := pulumix.Apply[Tar](o, func(v Tar) pulumix.MapOutput[string] { return v.MovedFiles }) + unwrapped := pulumix.Flatten[map[string]string, pulumix.MapOutput[string]](value) + return pulumix.MapOutput[string]{OutputState: unwrapped.OutputState} +} + +func (o TarOutput) Stderr() pulumix.Output[string] { + value := pulumix.Apply[Tar](o, func(v Tar) pulumix.Output[string] { return v.Stderr }) + return pulumix.Flatten[string, pulumix.Output[string]](value) +} + +func (o TarOutput) Stdout() pulumix.Output[string] { + value := pulumix.Apply[Tar](o, func(v Tar) pulumix.Output[string] { return v.Stdout }) + return pulumix.Flatten[string, pulumix.Output[string]](value) +} + +func init() { + pulumi.RegisterOutputType(TarOutput{}) +} diff --git a/sdk/nodejs/cmd/index.ts b/sdk/nodejs/cmd/index.ts index 9c0b5c3b..fcecfbd1 100644 --- a/sdk/nodejs/cmd/index.ts +++ b/sdk/nodejs/cmd/index.ts @@ -15,6 +15,11 @@ export type Rm = import("./rm").Rm; export const Rm: typeof import("./rm").Rm = null as any; utilities.lazyLoad(exports, ["Rm"], () => require("./rm")); +export { TarArgs } from "./tar"; +export type Tar = import("./tar").Tar; +export const Tar: typeof import("./tar").Tar = null as any; +utilities.lazyLoad(exports, ["Tar"], () => require("./tar")); + export { TeeArgs } from "./tee"; export type Tee = import("./tee").Tee; export const Tee: typeof import("./tee").Tee = null as any; @@ -34,6 +39,8 @@ const _module = { return new Mv(name, undefined, { urn }) case "baremetal:cmd:Rm": return new Rm(name, undefined, { urn }) + case "baremetal:cmd:Tar": + return new Tar(name, undefined, { urn }) case "baremetal:cmd:Tee": return new Tee(name, undefined, { urn }) case "baremetal:cmd:Wget": diff --git a/sdk/nodejs/cmd/tar.ts b/sdk/nodejs/cmd/tar.ts new file mode 100644 index 00000000..182fcd3d --- /dev/null +++ b/sdk/nodejs/cmd/tar.ts @@ -0,0 +1,154 @@ +// *** WARNING: this file was generated by pulumi-language-nodejs. *** +// *** Do not edit by hand unless you're certain you know what you are doing! *** + +import * as pulumi from "@pulumi/pulumi"; +import * as inputs from "../types/input"; +import * as outputs from "../types/output"; +import * as utilities from "../utilities"; + +export class Tar extends pulumi.CustomResource { + /** + * Get an existing Tar resource's state with the given name, ID, and optional extra + * properties used to qualify the lookup. + * + * @param name The _unique_ name of the resulting resource. + * @param id The _unique_ provider ID of the resource to lookup. + * @param opts Optional settings to control the behavior of the CustomResource. + */ + public static get(name: string, id: pulumi.Input, opts?: pulumi.CustomResourceOptions): Tar { + return new Tar(name, undefined as any, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'baremetal:cmd:Tar'; + + /** + * Returns true if the given object is an instance of Tar. This is designed to work even + * when multiple copies of the Pulumi SDK have been loaded into the same process. + */ + public static isInstance(obj: any): obj is Tar { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === Tar.__pulumiType; + } + + public readonly args!: pulumi.Output; + public /*out*/ readonly createdFiles!: pulumi.Output; + public /*out*/ readonly exitCode!: pulumi.Output; + public /*out*/ readonly movedFiles!: pulumi.Output<{[key: string]: string}>; + public /*out*/ readonly stderr!: pulumi.Output; + public /*out*/ readonly stdout!: pulumi.Output; + + /** + * Create a Tar resource with the given unique name, arguments, and options. + * + * @param name The _unique_ name of the resource. + * @param args The arguments to use to populate this resource's properties. + * @param opts A bag of options that control this resource's behavior. + */ + constructor(name: string, args?: TarArgs, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (!opts.id) { + resourceInputs["append"] = args ? args.append : undefined; + resourceInputs["args"] = args ? args.args : undefined; + resourceInputs["bzip2"] = args ? args.bzip2 : undefined; + resourceInputs["create"] = args ? args.create : undefined; + resourceInputs["delete"] = args ? args.delete : undefined; + resourceInputs["diff"] = args ? args.diff : undefined; + resourceInputs["directory"] = args ? args.directory : undefined; + resourceInputs["exclude"] = args ? args.exclude : undefined; + resourceInputs["excludeFrom"] = args ? args.excludeFrom : undefined; + resourceInputs["excludeVcs"] = args ? args.excludeVcs : undefined; + resourceInputs["excludeVcsIgnores"] = args ? args.excludeVcsIgnores : undefined; + resourceInputs["extract"] = args ? args.extract : undefined; + resourceInputs["file"] = args ? args.file : undefined; + resourceInputs["gzip"] = args ? args.gzip : undefined; + resourceInputs["ignoreCommandError"] = args ? args.ignoreCommandError : undefined; + resourceInputs["keepDirectorySymlink"] = args ? args.keepDirectorySymlink : undefined; + resourceInputs["keepNewerFiles"] = args ? args.keepNewerFiles : undefined; + resourceInputs["keepOldfiles"] = args ? args.keepOldfiles : undefined; + resourceInputs["list"] = args ? args.list : undefined; + resourceInputs["lzip"] = args ? args.lzip : undefined; + resourceInputs["lzma"] = args ? args.lzma : undefined; + resourceInputs["lzop"] = args ? args.lzop : undefined; + resourceInputs["noOverwriteDir"] = args ? args.noOverwriteDir : undefined; + resourceInputs["noSeek"] = args ? args.noSeek : undefined; + resourceInputs["overwrite"] = args ? args.overwrite : undefined; + resourceInputs["overwriteDir"] = args ? args.overwriteDir : undefined; + resourceInputs["removeFiles"] = args ? args.removeFiles : undefined; + resourceInputs["skipOldFiles"] = args ? args.skipOldFiles : undefined; + resourceInputs["sparse"] = args ? args.sparse : undefined; + resourceInputs["stripComponents"] = args ? args.stripComponents : undefined; + resourceInputs["suffix"] = args ? args.suffix : undefined; + resourceInputs["toStdout"] = args ? args.toStdout : undefined; + resourceInputs["transform"] = args ? args.transform : undefined; + resourceInputs["unlinkFirst"] = args ? args.unlinkFirst : undefined; + resourceInputs["update"] = args ? args.update : undefined; + resourceInputs["verbose"] = args ? args.verbose : undefined; + resourceInputs["verify"] = args ? args.verify : undefined; + resourceInputs["xz"] = args ? args.xz : undefined; + resourceInputs["zstd"] = args ? args.zstd : undefined; + resourceInputs["createdFiles"] = undefined /*out*/; + resourceInputs["exitCode"] = undefined /*out*/; + resourceInputs["movedFiles"] = undefined /*out*/; + resourceInputs["stderr"] = undefined /*out*/; + resourceInputs["stdout"] = undefined /*out*/; + } else { + resourceInputs["args"] = undefined /*out*/; + resourceInputs["createdFiles"] = undefined /*out*/; + resourceInputs["exitCode"] = undefined /*out*/; + resourceInputs["movedFiles"] = undefined /*out*/; + resourceInputs["stderr"] = undefined /*out*/; + resourceInputs["stdout"] = undefined /*out*/; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + super(Tar.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * The set of arguments for constructing a Tar resource. + */ +export interface TarArgs { + append?: pulumi.Input; + args?: pulumi.Input[]>; + bzip2?: pulumi.Input; + create?: pulumi.Input; + delete?: pulumi.Input; + diff?: pulumi.Input; + directory?: pulumi.Input; + exclude?: pulumi.Input; + excludeFrom?: pulumi.Input; + excludeVcs?: pulumi.Input; + excludeVcsIgnores?: pulumi.Input; + extract?: pulumi.Input; + file?: pulumi.Input; + gzip?: pulumi.Input; + ignoreCommandError?: pulumi.Input; + keepDirectorySymlink?: pulumi.Input; + keepNewerFiles?: pulumi.Input; + keepOldfiles?: pulumi.Input; + list?: pulumi.Input; + lzip?: pulumi.Input; + lzma?: pulumi.Input; + lzop?: pulumi.Input; + noOverwriteDir?: pulumi.Input; + noSeek?: pulumi.Input; + overwrite?: pulumi.Input; + overwriteDir?: pulumi.Input; + removeFiles?: pulumi.Input; + skipOldFiles?: pulumi.Input; + sparse?: pulumi.Input; + stripComponents?: pulumi.Input; + suffix?: pulumi.Input; + toStdout?: pulumi.Input; + transform?: pulumi.Input; + unlinkFirst?: pulumi.Input; + update?: pulumi.Input; + verbose?: pulumi.Input; + verify?: pulumi.Input; + xz?: pulumi.Input; + zstd?: pulumi.Input; +} diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index e8f97851..969e4748 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -16,6 +16,7 @@ "cmd/index.ts", "cmd/mv.ts", "cmd/rm.ts", + "cmd/tar.ts", "cmd/tee.ts", "cmd/wget.ts", "config/index.ts", diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index 6cb6bac3..ad1616a0 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -33,6 +33,48 @@ export namespace cmd { verbose?: boolean; } + export interface TarArgs { + append?: boolean; + args?: string[]; + bzip2?: boolean; + create?: boolean; + delete?: boolean; + diff?: boolean; + directory?: string; + exclude?: string; + excludeFrom?: string; + excludeVcs?: boolean; + excludeVcsIgnores?: boolean; + extract?: boolean; + file?: string; + gzip?: boolean; + ignoreCommandError?: boolean; + keepDirectorySymlink?: boolean; + keepNewerFiles?: boolean; + keepOldfiles?: boolean; + list?: boolean; + lzip?: boolean; + lzma?: boolean; + lzop?: boolean; + noOverwriteDir?: boolean; + noSeek?: boolean; + overwrite?: boolean; + overwriteDir?: boolean; + removeFiles?: boolean; + skipOldFiles?: boolean; + sparse?: boolean; + stripComponents?: number; + suffix?: string; + toStdout?: boolean; + transform?: string; + unlinkFirst?: boolean; + update?: boolean; + verbose?: boolean; + verify?: boolean; + xz?: boolean; + zstd?: boolean; + } + export interface TeeArgs { append?: boolean; content: string; diff --git a/sdk/python/unmango_baremetal/__init__.py b/sdk/python/unmango_baremetal/__init__.py index ebca9332..e4073ef3 100644 --- a/sdk/python/unmango_baremetal/__init__.py +++ b/sdk/python/unmango_baremetal/__init__.py @@ -27,6 +27,7 @@ "classes": { "baremetal:cmd:Mv": "Mv", "baremetal:cmd:Rm": "Rm", + "baremetal:cmd:Tar": "Tar", "baremetal:cmd:Tee": "Tee", "baremetal:cmd:Wget": "Wget" } diff --git a/sdk/python/unmango_baremetal/cmd/__init__.py b/sdk/python/unmango_baremetal/cmd/__init__.py index e41bc07a..f780e1d2 100644 --- a/sdk/python/unmango_baremetal/cmd/__init__.py +++ b/sdk/python/unmango_baremetal/cmd/__init__.py @@ -7,6 +7,7 @@ # Export this package's modules as members: from .mv import * from .rm import * +from .tar import * from .tee import * from .wget import * from . import outputs diff --git a/sdk/python/unmango_baremetal/cmd/outputs.py b/sdk/python/unmango_baremetal/cmd/outputs.py index 6c05ab85..045465b0 100644 --- a/sdk/python/unmango_baremetal/cmd/outputs.py +++ b/sdk/python/unmango_baremetal/cmd/outputs.py @@ -12,6 +12,7 @@ __all__ = [ 'MvArgs', 'RmArgs', + 'TarArgs', 'TeeArgs', 'WgetArgs', ] @@ -232,6 +233,368 @@ def verbose(self) -> Optional[bool]: return pulumi.get(self, "verbose") +@pulumi.output_type +class TarArgs(dict): + @staticmethod + def __key_warning(key: str): + suggest = None + if key == "excludeFrom": + suggest = "exclude_from" + elif key == "excludeVcs": + suggest = "exclude_vcs" + elif key == "excludeVcsIgnores": + suggest = "exclude_vcs_ignores" + elif key == "ignoreCommandError": + suggest = "ignore_command_error" + elif key == "keepDirectorySymlink": + suggest = "keep_directory_symlink" + elif key == "keepNewerFiles": + suggest = "keep_newer_files" + elif key == "keepOldfiles": + suggest = "keep_oldfiles" + elif key == "noOverwriteDir": + suggest = "no_overwrite_dir" + elif key == "noSeek": + suggest = "no_seek" + elif key == "overwriteDir": + suggest = "overwrite_dir" + elif key == "removeFiles": + suggest = "remove_files" + elif key == "skipOldFiles": + suggest = "skip_old_files" + elif key == "stripComponents": + suggest = "strip_components" + elif key == "toStdout": + suggest = "to_stdout" + elif key == "unlinkFirst": + suggest = "unlink_first" + + if suggest: + pulumi.log.warn(f"Key '{key}' not found in TarArgs. Access the value via the '{suggest}' property getter instead.") + + def __getitem__(self, key: str) -> Any: + TarArgs.__key_warning(key) + return super().__getitem__(key) + + def get(self, key: str, default = None) -> Any: + TarArgs.__key_warning(key) + return super().get(key, default) + + def __init__(__self__, *, + append: Optional[bool] = None, + args: Optional[Sequence[str]] = None, + bzip2: Optional[bool] = None, + create: Optional[bool] = None, + delete: Optional[bool] = None, + diff: Optional[bool] = None, + directory: Optional[str] = None, + exclude: Optional[str] = None, + exclude_from: Optional[str] = None, + exclude_vcs: Optional[bool] = None, + exclude_vcs_ignores: Optional[bool] = None, + extract: Optional[bool] = None, + file: Optional[str] = None, + gzip: Optional[bool] = None, + ignore_command_error: Optional[bool] = None, + keep_directory_symlink: Optional[bool] = None, + keep_newer_files: Optional[bool] = None, + keep_oldfiles: Optional[bool] = None, + list: Optional[bool] = None, + lzip: Optional[bool] = None, + lzma: Optional[bool] = None, + lzop: Optional[bool] = None, + no_overwrite_dir: Optional[bool] = None, + no_seek: Optional[bool] = None, + overwrite: Optional[bool] = None, + overwrite_dir: Optional[bool] = None, + remove_files: Optional[bool] = None, + skip_old_files: Optional[bool] = None, + sparse: Optional[bool] = None, + strip_components: Optional[int] = None, + suffix: Optional[str] = None, + to_stdout: Optional[bool] = None, + transform: Optional[str] = None, + unlink_first: Optional[bool] = None, + update: Optional[bool] = None, + verbose: Optional[bool] = None, + verify: Optional[bool] = None, + xz: Optional[bool] = None, + zstd: Optional[bool] = None): + if append is not None: + pulumi.set(__self__, "append", append) + if args is not None: + pulumi.set(__self__, "args", args) + if bzip2 is not None: + pulumi.set(__self__, "bzip2", bzip2) + if create is not None: + pulumi.set(__self__, "create", create) + if delete is not None: + pulumi.set(__self__, "delete", delete) + if diff is not None: + pulumi.set(__self__, "diff", diff) + if directory is not None: + pulumi.set(__self__, "directory", directory) + if exclude is not None: + pulumi.set(__self__, "exclude", exclude) + if exclude_from is not None: + pulumi.set(__self__, "exclude_from", exclude_from) + if exclude_vcs is not None: + pulumi.set(__self__, "exclude_vcs", exclude_vcs) + if exclude_vcs_ignores is not None: + pulumi.set(__self__, "exclude_vcs_ignores", exclude_vcs_ignores) + if extract is not None: + pulumi.set(__self__, "extract", extract) + if file is not None: + pulumi.set(__self__, "file", file) + if gzip is not None: + pulumi.set(__self__, "gzip", gzip) + if ignore_command_error is not None: + pulumi.set(__self__, "ignore_command_error", ignore_command_error) + if keep_directory_symlink is not None: + pulumi.set(__self__, "keep_directory_symlink", keep_directory_symlink) + if keep_newer_files is not None: + pulumi.set(__self__, "keep_newer_files", keep_newer_files) + if keep_oldfiles is not None: + pulumi.set(__self__, "keep_oldfiles", keep_oldfiles) + if list is not None: + pulumi.set(__self__, "list", list) + if lzip is not None: + pulumi.set(__self__, "lzip", lzip) + if lzma is not None: + pulumi.set(__self__, "lzma", lzma) + if lzop is not None: + pulumi.set(__self__, "lzop", lzop) + if no_overwrite_dir is not None: + pulumi.set(__self__, "no_overwrite_dir", no_overwrite_dir) + if no_seek is not None: + pulumi.set(__self__, "no_seek", no_seek) + if overwrite is not None: + pulumi.set(__self__, "overwrite", overwrite) + if overwrite_dir is not None: + pulumi.set(__self__, "overwrite_dir", overwrite_dir) + if remove_files is not None: + pulumi.set(__self__, "remove_files", remove_files) + if skip_old_files is not None: + pulumi.set(__self__, "skip_old_files", skip_old_files) + if sparse is not None: + pulumi.set(__self__, "sparse", sparse) + if strip_components is not None: + pulumi.set(__self__, "strip_components", strip_components) + if suffix is not None: + pulumi.set(__self__, "suffix", suffix) + if to_stdout is not None: + pulumi.set(__self__, "to_stdout", to_stdout) + if transform is not None: + pulumi.set(__self__, "transform", transform) + if unlink_first is not None: + pulumi.set(__self__, "unlink_first", unlink_first) + if update is not None: + pulumi.set(__self__, "update", update) + if verbose is not None: + pulumi.set(__self__, "verbose", verbose) + if verify is not None: + pulumi.set(__self__, "verify", verify) + if xz is not None: + pulumi.set(__self__, "xz", xz) + if zstd is not None: + pulumi.set(__self__, "zstd", zstd) + + @property + @pulumi.getter + def append(self) -> Optional[bool]: + return pulumi.get(self, "append") + + @property + @pulumi.getter + def args(self) -> Optional[Sequence[str]]: + return pulumi.get(self, "args") + + @property + @pulumi.getter + def bzip2(self) -> Optional[bool]: + return pulumi.get(self, "bzip2") + + @property + @pulumi.getter + def create(self) -> Optional[bool]: + return pulumi.get(self, "create") + + @property + @pulumi.getter + def delete(self) -> Optional[bool]: + return pulumi.get(self, "delete") + + @property + @pulumi.getter + def diff(self) -> Optional[bool]: + return pulumi.get(self, "diff") + + @property + @pulumi.getter + def directory(self) -> Optional[str]: + return pulumi.get(self, "directory") + + @property + @pulumi.getter + def exclude(self) -> Optional[str]: + return pulumi.get(self, "exclude") + + @property + @pulumi.getter(name="excludeFrom") + def exclude_from(self) -> Optional[str]: + return pulumi.get(self, "exclude_from") + + @property + @pulumi.getter(name="excludeVcs") + def exclude_vcs(self) -> Optional[bool]: + return pulumi.get(self, "exclude_vcs") + + @property + @pulumi.getter(name="excludeVcsIgnores") + def exclude_vcs_ignores(self) -> Optional[bool]: + return pulumi.get(self, "exclude_vcs_ignores") + + @property + @pulumi.getter + def extract(self) -> Optional[bool]: + return pulumi.get(self, "extract") + + @property + @pulumi.getter + def file(self) -> Optional[str]: + return pulumi.get(self, "file") + + @property + @pulumi.getter + def gzip(self) -> Optional[bool]: + return pulumi.get(self, "gzip") + + @property + @pulumi.getter(name="ignoreCommandError") + def ignore_command_error(self) -> Optional[bool]: + return pulumi.get(self, "ignore_command_error") + + @property + @pulumi.getter(name="keepDirectorySymlink") + def keep_directory_symlink(self) -> Optional[bool]: + return pulumi.get(self, "keep_directory_symlink") + + @property + @pulumi.getter(name="keepNewerFiles") + def keep_newer_files(self) -> Optional[bool]: + return pulumi.get(self, "keep_newer_files") + + @property + @pulumi.getter(name="keepOldfiles") + def keep_oldfiles(self) -> Optional[bool]: + return pulumi.get(self, "keep_oldfiles") + + @property + @pulumi.getter + def list(self) -> Optional[bool]: + return pulumi.get(self, "list") + + @property + @pulumi.getter + def lzip(self) -> Optional[bool]: + return pulumi.get(self, "lzip") + + @property + @pulumi.getter + def lzma(self) -> Optional[bool]: + return pulumi.get(self, "lzma") + + @property + @pulumi.getter + def lzop(self) -> Optional[bool]: + return pulumi.get(self, "lzop") + + @property + @pulumi.getter(name="noOverwriteDir") + def no_overwrite_dir(self) -> Optional[bool]: + return pulumi.get(self, "no_overwrite_dir") + + @property + @pulumi.getter(name="noSeek") + def no_seek(self) -> Optional[bool]: + return pulumi.get(self, "no_seek") + + @property + @pulumi.getter + def overwrite(self) -> Optional[bool]: + return pulumi.get(self, "overwrite") + + @property + @pulumi.getter(name="overwriteDir") + def overwrite_dir(self) -> Optional[bool]: + return pulumi.get(self, "overwrite_dir") + + @property + @pulumi.getter(name="removeFiles") + def remove_files(self) -> Optional[bool]: + return pulumi.get(self, "remove_files") + + @property + @pulumi.getter(name="skipOldFiles") + def skip_old_files(self) -> Optional[bool]: + return pulumi.get(self, "skip_old_files") + + @property + @pulumi.getter + def sparse(self) -> Optional[bool]: + return pulumi.get(self, "sparse") + + @property + @pulumi.getter(name="stripComponents") + def strip_components(self) -> Optional[int]: + return pulumi.get(self, "strip_components") + + @property + @pulumi.getter + def suffix(self) -> Optional[str]: + return pulumi.get(self, "suffix") + + @property + @pulumi.getter(name="toStdout") + def to_stdout(self) -> Optional[bool]: + return pulumi.get(self, "to_stdout") + + @property + @pulumi.getter + def transform(self) -> Optional[str]: + return pulumi.get(self, "transform") + + @property + @pulumi.getter(name="unlinkFirst") + def unlink_first(self) -> Optional[bool]: + return pulumi.get(self, "unlink_first") + + @property + @pulumi.getter + def update(self) -> Optional[bool]: + return pulumi.get(self, "update") + + @property + @pulumi.getter + def verbose(self) -> Optional[bool]: + return pulumi.get(self, "verbose") + + @property + @pulumi.getter + def verify(self) -> Optional[bool]: + return pulumi.get(self, "verify") + + @property + @pulumi.getter + def xz(self) -> Optional[bool]: + return pulumi.get(self, "xz") + + @property + @pulumi.getter + def zstd(self) -> Optional[bool]: + return pulumi.get(self, "zstd") + + @pulumi.output_type class TeeArgs(dict): def __init__(__self__, *, diff --git a/sdk/python/unmango_baremetal/cmd/tar.py b/sdk/python/unmango_baremetal/cmd/tar.py new file mode 100644 index 00000000..1c6509ea --- /dev/null +++ b/sdk/python/unmango_baremetal/cmd/tar.py @@ -0,0 +1,715 @@ +# coding=utf-8 +# *** WARNING: this file was generated by pulumi-language-python. *** +# *** Do not edit by hand unless you're certain you know what you are doing! *** + +import copy +import warnings +import pulumi +import pulumi.runtime +from typing import Any, Mapping, Optional, Sequence, Union, overload +from .. import _utilities +from . import outputs + +__all__ = ['TarArgs', 'Tar'] + +@pulumi.input_type +class TarArgs: + def __init__(__self__, *, + append: Optional[pulumi.Input[bool]] = None, + args: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + bzip2: Optional[pulumi.Input[bool]] = None, + create: Optional[pulumi.Input[bool]] = None, + delete: Optional[pulumi.Input[bool]] = None, + diff: Optional[pulumi.Input[bool]] = None, + directory: Optional[pulumi.Input[str]] = None, + exclude: Optional[pulumi.Input[str]] = None, + exclude_from: Optional[pulumi.Input[str]] = None, + exclude_vcs: Optional[pulumi.Input[bool]] = None, + exclude_vcs_ignores: Optional[pulumi.Input[bool]] = None, + extract: Optional[pulumi.Input[bool]] = None, + file: Optional[pulumi.Input[str]] = None, + gzip: Optional[pulumi.Input[bool]] = None, + ignore_command_error: Optional[pulumi.Input[bool]] = None, + keep_directory_symlink: Optional[pulumi.Input[bool]] = None, + keep_newer_files: Optional[pulumi.Input[bool]] = None, + keep_oldfiles: Optional[pulumi.Input[bool]] = None, + list: Optional[pulumi.Input[bool]] = None, + lzip: Optional[pulumi.Input[bool]] = None, + lzma: Optional[pulumi.Input[bool]] = None, + lzop: Optional[pulumi.Input[bool]] = None, + no_overwrite_dir: Optional[pulumi.Input[bool]] = None, + no_seek: Optional[pulumi.Input[bool]] = None, + overwrite: Optional[pulumi.Input[bool]] = None, + overwrite_dir: Optional[pulumi.Input[bool]] = None, + remove_files: Optional[pulumi.Input[bool]] = None, + skip_old_files: Optional[pulumi.Input[bool]] = None, + sparse: Optional[pulumi.Input[bool]] = None, + strip_components: Optional[pulumi.Input[int]] = None, + suffix: Optional[pulumi.Input[str]] = None, + to_stdout: Optional[pulumi.Input[bool]] = None, + transform: Optional[pulumi.Input[str]] = None, + unlink_first: Optional[pulumi.Input[bool]] = None, + update: Optional[pulumi.Input[bool]] = None, + verbose: Optional[pulumi.Input[bool]] = None, + verify: Optional[pulumi.Input[bool]] = None, + xz: Optional[pulumi.Input[bool]] = None, + zstd: Optional[pulumi.Input[bool]] = None): + """ + The set of arguments for constructing a Tar resource. + """ + if append is not None: + pulumi.set(__self__, "append", append) + if args is not None: + pulumi.set(__self__, "args", args) + if bzip2 is not None: + pulumi.set(__self__, "bzip2", bzip2) + if create is not None: + pulumi.set(__self__, "create", create) + if delete is not None: + pulumi.set(__self__, "delete", delete) + if diff is not None: + pulumi.set(__self__, "diff", diff) + if directory is not None: + pulumi.set(__self__, "directory", directory) + if exclude is not None: + pulumi.set(__self__, "exclude", exclude) + if exclude_from is not None: + pulumi.set(__self__, "exclude_from", exclude_from) + if exclude_vcs is not None: + pulumi.set(__self__, "exclude_vcs", exclude_vcs) + if exclude_vcs_ignores is not None: + pulumi.set(__self__, "exclude_vcs_ignores", exclude_vcs_ignores) + if extract is not None: + pulumi.set(__self__, "extract", extract) + if file is not None: + pulumi.set(__self__, "file", file) + if gzip is not None: + pulumi.set(__self__, "gzip", gzip) + if ignore_command_error is not None: + pulumi.set(__self__, "ignore_command_error", ignore_command_error) + if keep_directory_symlink is not None: + pulumi.set(__self__, "keep_directory_symlink", keep_directory_symlink) + if keep_newer_files is not None: + pulumi.set(__self__, "keep_newer_files", keep_newer_files) + if keep_oldfiles is not None: + pulumi.set(__self__, "keep_oldfiles", keep_oldfiles) + if list is not None: + pulumi.set(__self__, "list", list) + if lzip is not None: + pulumi.set(__self__, "lzip", lzip) + if lzma is not None: + pulumi.set(__self__, "lzma", lzma) + if lzop is not None: + pulumi.set(__self__, "lzop", lzop) + if no_overwrite_dir is not None: + pulumi.set(__self__, "no_overwrite_dir", no_overwrite_dir) + if no_seek is not None: + pulumi.set(__self__, "no_seek", no_seek) + if overwrite is not None: + pulumi.set(__self__, "overwrite", overwrite) + if overwrite_dir is not None: + pulumi.set(__self__, "overwrite_dir", overwrite_dir) + if remove_files is not None: + pulumi.set(__self__, "remove_files", remove_files) + if skip_old_files is not None: + pulumi.set(__self__, "skip_old_files", skip_old_files) + if sparse is not None: + pulumi.set(__self__, "sparse", sparse) + if strip_components is not None: + pulumi.set(__self__, "strip_components", strip_components) + if suffix is not None: + pulumi.set(__self__, "suffix", suffix) + if to_stdout is not None: + pulumi.set(__self__, "to_stdout", to_stdout) + if transform is not None: + pulumi.set(__self__, "transform", transform) + if unlink_first is not None: + pulumi.set(__self__, "unlink_first", unlink_first) + if update is not None: + pulumi.set(__self__, "update", update) + if verbose is not None: + pulumi.set(__self__, "verbose", verbose) + if verify is not None: + pulumi.set(__self__, "verify", verify) + if xz is not None: + pulumi.set(__self__, "xz", xz) + if zstd is not None: + pulumi.set(__self__, "zstd", zstd) + + @property + @pulumi.getter + def append(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "append") + + @append.setter + def append(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "append", value) + + @property + @pulumi.getter + def args(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: + return pulumi.get(self, "args") + + @args.setter + def args(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): + pulumi.set(self, "args", value) + + @property + @pulumi.getter + def bzip2(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "bzip2") + + @bzip2.setter + def bzip2(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "bzip2", value) + + @property + @pulumi.getter + def create(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "create") + + @create.setter + def create(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "create", value) + + @property + @pulumi.getter + def delete(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "delete") + + @delete.setter + def delete(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "delete", value) + + @property + @pulumi.getter + def diff(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "diff") + + @diff.setter + def diff(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "diff", value) + + @property + @pulumi.getter + def directory(self) -> Optional[pulumi.Input[str]]: + return pulumi.get(self, "directory") + + @directory.setter + def directory(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "directory", value) + + @property + @pulumi.getter + def exclude(self) -> Optional[pulumi.Input[str]]: + return pulumi.get(self, "exclude") + + @exclude.setter + def exclude(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "exclude", value) + + @property + @pulumi.getter(name="excludeFrom") + def exclude_from(self) -> Optional[pulumi.Input[str]]: + return pulumi.get(self, "exclude_from") + + @exclude_from.setter + def exclude_from(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "exclude_from", value) + + @property + @pulumi.getter(name="excludeVcs") + def exclude_vcs(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "exclude_vcs") + + @exclude_vcs.setter + def exclude_vcs(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "exclude_vcs", value) + + @property + @pulumi.getter(name="excludeVcsIgnores") + def exclude_vcs_ignores(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "exclude_vcs_ignores") + + @exclude_vcs_ignores.setter + def exclude_vcs_ignores(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "exclude_vcs_ignores", value) + + @property + @pulumi.getter + def extract(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "extract") + + @extract.setter + def extract(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "extract", value) + + @property + @pulumi.getter + def file(self) -> Optional[pulumi.Input[str]]: + return pulumi.get(self, "file") + + @file.setter + def file(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "file", value) + + @property + @pulumi.getter + def gzip(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "gzip") + + @gzip.setter + def gzip(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "gzip", value) + + @property + @pulumi.getter(name="ignoreCommandError") + def ignore_command_error(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "ignore_command_error") + + @ignore_command_error.setter + def ignore_command_error(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "ignore_command_error", value) + + @property + @pulumi.getter(name="keepDirectorySymlink") + def keep_directory_symlink(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "keep_directory_symlink") + + @keep_directory_symlink.setter + def keep_directory_symlink(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "keep_directory_symlink", value) + + @property + @pulumi.getter(name="keepNewerFiles") + def keep_newer_files(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "keep_newer_files") + + @keep_newer_files.setter + def keep_newer_files(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "keep_newer_files", value) + + @property + @pulumi.getter(name="keepOldfiles") + def keep_oldfiles(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "keep_oldfiles") + + @keep_oldfiles.setter + def keep_oldfiles(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "keep_oldfiles", value) + + @property + @pulumi.getter + def list(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "list") + + @list.setter + def list(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "list", value) + + @property + @pulumi.getter + def lzip(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "lzip") + + @lzip.setter + def lzip(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "lzip", value) + + @property + @pulumi.getter + def lzma(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "lzma") + + @lzma.setter + def lzma(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "lzma", value) + + @property + @pulumi.getter + def lzop(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "lzop") + + @lzop.setter + def lzop(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "lzop", value) + + @property + @pulumi.getter(name="noOverwriteDir") + def no_overwrite_dir(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "no_overwrite_dir") + + @no_overwrite_dir.setter + def no_overwrite_dir(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "no_overwrite_dir", value) + + @property + @pulumi.getter(name="noSeek") + def no_seek(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "no_seek") + + @no_seek.setter + def no_seek(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "no_seek", value) + + @property + @pulumi.getter + def overwrite(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "overwrite") + + @overwrite.setter + def overwrite(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "overwrite", value) + + @property + @pulumi.getter(name="overwriteDir") + def overwrite_dir(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "overwrite_dir") + + @overwrite_dir.setter + def overwrite_dir(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "overwrite_dir", value) + + @property + @pulumi.getter(name="removeFiles") + def remove_files(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "remove_files") + + @remove_files.setter + def remove_files(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "remove_files", value) + + @property + @pulumi.getter(name="skipOldFiles") + def skip_old_files(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "skip_old_files") + + @skip_old_files.setter + def skip_old_files(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "skip_old_files", value) + + @property + @pulumi.getter + def sparse(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "sparse") + + @sparse.setter + def sparse(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "sparse", value) + + @property + @pulumi.getter(name="stripComponents") + def strip_components(self) -> Optional[pulumi.Input[int]]: + return pulumi.get(self, "strip_components") + + @strip_components.setter + def strip_components(self, value: Optional[pulumi.Input[int]]): + pulumi.set(self, "strip_components", value) + + @property + @pulumi.getter + def suffix(self) -> Optional[pulumi.Input[str]]: + return pulumi.get(self, "suffix") + + @suffix.setter + def suffix(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "suffix", value) + + @property + @pulumi.getter(name="toStdout") + def to_stdout(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "to_stdout") + + @to_stdout.setter + def to_stdout(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "to_stdout", value) + + @property + @pulumi.getter + def transform(self) -> Optional[pulumi.Input[str]]: + return pulumi.get(self, "transform") + + @transform.setter + def transform(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "transform", value) + + @property + @pulumi.getter(name="unlinkFirst") + def unlink_first(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "unlink_first") + + @unlink_first.setter + def unlink_first(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "unlink_first", value) + + @property + @pulumi.getter + def update(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "update") + + @update.setter + def update(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "update", value) + + @property + @pulumi.getter + def verbose(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "verbose") + + @verbose.setter + def verbose(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "verbose", value) + + @property + @pulumi.getter + def verify(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "verify") + + @verify.setter + def verify(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "verify", value) + + @property + @pulumi.getter + def xz(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "xz") + + @xz.setter + def xz(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "xz", value) + + @property + @pulumi.getter + def zstd(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "zstd") + + @zstd.setter + def zstd(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "zstd", value) + + +class Tar(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + append: Optional[pulumi.Input[bool]] = None, + args: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + bzip2: Optional[pulumi.Input[bool]] = None, + create: Optional[pulumi.Input[bool]] = None, + delete: Optional[pulumi.Input[bool]] = None, + diff: Optional[pulumi.Input[bool]] = None, + directory: Optional[pulumi.Input[str]] = None, + exclude: Optional[pulumi.Input[str]] = None, + exclude_from: Optional[pulumi.Input[str]] = None, + exclude_vcs: Optional[pulumi.Input[bool]] = None, + exclude_vcs_ignores: Optional[pulumi.Input[bool]] = None, + extract: Optional[pulumi.Input[bool]] = None, + file: Optional[pulumi.Input[str]] = None, + gzip: Optional[pulumi.Input[bool]] = None, + ignore_command_error: Optional[pulumi.Input[bool]] = None, + keep_directory_symlink: Optional[pulumi.Input[bool]] = None, + keep_newer_files: Optional[pulumi.Input[bool]] = None, + keep_oldfiles: Optional[pulumi.Input[bool]] = None, + list: Optional[pulumi.Input[bool]] = None, + lzip: Optional[pulumi.Input[bool]] = None, + lzma: Optional[pulumi.Input[bool]] = None, + lzop: Optional[pulumi.Input[bool]] = None, + no_overwrite_dir: Optional[pulumi.Input[bool]] = None, + no_seek: Optional[pulumi.Input[bool]] = None, + overwrite: Optional[pulumi.Input[bool]] = None, + overwrite_dir: Optional[pulumi.Input[bool]] = None, + remove_files: Optional[pulumi.Input[bool]] = None, + skip_old_files: Optional[pulumi.Input[bool]] = None, + sparse: Optional[pulumi.Input[bool]] = None, + strip_components: Optional[pulumi.Input[int]] = None, + suffix: Optional[pulumi.Input[str]] = None, + to_stdout: Optional[pulumi.Input[bool]] = None, + transform: Optional[pulumi.Input[str]] = None, + unlink_first: Optional[pulumi.Input[bool]] = None, + update: Optional[pulumi.Input[bool]] = None, + verbose: Optional[pulumi.Input[bool]] = None, + verify: Optional[pulumi.Input[bool]] = None, + xz: Optional[pulumi.Input[bool]] = None, + zstd: Optional[pulumi.Input[bool]] = None, + __props__=None): + """ + Create a Tar resource with the given unique name, props, and options. + :param str resource_name: The name of the resource. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + @overload + def __init__(__self__, + resource_name: str, + args: Optional[TarArgs] = None, + opts: Optional[pulumi.ResourceOptions] = None): + """ + Create a Tar resource with the given unique name, props, and options. + :param str resource_name: The name of the resource. + :param TarArgs args: The arguments to use to populate this resource's properties. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + ... + def __init__(__self__, resource_name: str, *args, **kwargs): + resource_args, opts = _utilities.get_resource_args_opts(TarArgs, pulumi.ResourceOptions, *args, **kwargs) + if resource_args is not None: + __self__._internal_init(resource_name, opts, **resource_args.__dict__) + else: + __self__._internal_init(resource_name, *args, **kwargs) + + def _internal_init(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + append: Optional[pulumi.Input[bool]] = None, + args: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + bzip2: Optional[pulumi.Input[bool]] = None, + create: Optional[pulumi.Input[bool]] = None, + delete: Optional[pulumi.Input[bool]] = None, + diff: Optional[pulumi.Input[bool]] = None, + directory: Optional[pulumi.Input[str]] = None, + exclude: Optional[pulumi.Input[str]] = None, + exclude_from: Optional[pulumi.Input[str]] = None, + exclude_vcs: Optional[pulumi.Input[bool]] = None, + exclude_vcs_ignores: Optional[pulumi.Input[bool]] = None, + extract: Optional[pulumi.Input[bool]] = None, + file: Optional[pulumi.Input[str]] = None, + gzip: Optional[pulumi.Input[bool]] = None, + ignore_command_error: Optional[pulumi.Input[bool]] = None, + keep_directory_symlink: Optional[pulumi.Input[bool]] = None, + keep_newer_files: Optional[pulumi.Input[bool]] = None, + keep_oldfiles: Optional[pulumi.Input[bool]] = None, + list: Optional[pulumi.Input[bool]] = None, + lzip: Optional[pulumi.Input[bool]] = None, + lzma: Optional[pulumi.Input[bool]] = None, + lzop: Optional[pulumi.Input[bool]] = None, + no_overwrite_dir: Optional[pulumi.Input[bool]] = None, + no_seek: Optional[pulumi.Input[bool]] = None, + overwrite: Optional[pulumi.Input[bool]] = None, + overwrite_dir: Optional[pulumi.Input[bool]] = None, + remove_files: Optional[pulumi.Input[bool]] = None, + skip_old_files: Optional[pulumi.Input[bool]] = None, + sparse: Optional[pulumi.Input[bool]] = None, + strip_components: Optional[pulumi.Input[int]] = None, + suffix: Optional[pulumi.Input[str]] = None, + to_stdout: Optional[pulumi.Input[bool]] = None, + transform: Optional[pulumi.Input[str]] = None, + unlink_first: Optional[pulumi.Input[bool]] = None, + update: Optional[pulumi.Input[bool]] = None, + verbose: Optional[pulumi.Input[bool]] = None, + verify: Optional[pulumi.Input[bool]] = None, + xz: Optional[pulumi.Input[bool]] = None, + zstd: Optional[pulumi.Input[bool]] = None, + __props__=None): + opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts) + if not isinstance(opts, pulumi.ResourceOptions): + raise TypeError('Expected resource options to be a ResourceOptions instance') + if opts.id is None: + if __props__ is not None: + raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource') + __props__ = TarArgs.__new__(TarArgs) + + __props__.__dict__["append"] = append + __props__.__dict__["args"] = args + __props__.__dict__["bzip2"] = bzip2 + __props__.__dict__["create"] = create + __props__.__dict__["delete"] = delete + __props__.__dict__["diff"] = diff + __props__.__dict__["directory"] = directory + __props__.__dict__["exclude"] = exclude + __props__.__dict__["exclude_from"] = exclude_from + __props__.__dict__["exclude_vcs"] = exclude_vcs + __props__.__dict__["exclude_vcs_ignores"] = exclude_vcs_ignores + __props__.__dict__["extract"] = extract + __props__.__dict__["file"] = file + __props__.__dict__["gzip"] = gzip + __props__.__dict__["ignore_command_error"] = ignore_command_error + __props__.__dict__["keep_directory_symlink"] = keep_directory_symlink + __props__.__dict__["keep_newer_files"] = keep_newer_files + __props__.__dict__["keep_oldfiles"] = keep_oldfiles + __props__.__dict__["list"] = list + __props__.__dict__["lzip"] = lzip + __props__.__dict__["lzma"] = lzma + __props__.__dict__["lzop"] = lzop + __props__.__dict__["no_overwrite_dir"] = no_overwrite_dir + __props__.__dict__["no_seek"] = no_seek + __props__.__dict__["overwrite"] = overwrite + __props__.__dict__["overwrite_dir"] = overwrite_dir + __props__.__dict__["remove_files"] = remove_files + __props__.__dict__["skip_old_files"] = skip_old_files + __props__.__dict__["sparse"] = sparse + __props__.__dict__["strip_components"] = strip_components + __props__.__dict__["suffix"] = suffix + __props__.__dict__["to_stdout"] = to_stdout + __props__.__dict__["transform"] = transform + __props__.__dict__["unlink_first"] = unlink_first + __props__.__dict__["update"] = update + __props__.__dict__["verbose"] = verbose + __props__.__dict__["verify"] = verify + __props__.__dict__["xz"] = xz + __props__.__dict__["zstd"] = zstd + __props__.__dict__["created_files"] = None + __props__.__dict__["exit_code"] = None + __props__.__dict__["moved_files"] = None + __props__.__dict__["stderr"] = None + __props__.__dict__["stdout"] = None + super(Tar, __self__).__init__( + 'baremetal:cmd:Tar', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None) -> 'Tar': + """ + Get an existing Tar resource's state with the given name, id, and optional extra + properties used to qualify the lookup. + + :param str resource_name: The unique name of the resulting resource. + :param pulumi.Input[str] id: The unique provider ID of the resource to lookup. + :param pulumi.ResourceOptions opts: Options for the resource. + """ + opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id)) + + __props__ = TarArgs.__new__(TarArgs) + + __props__.__dict__["args"] = None + __props__.__dict__["created_files"] = None + __props__.__dict__["exit_code"] = None + __props__.__dict__["moved_files"] = None + __props__.__dict__["stderr"] = None + __props__.__dict__["stdout"] = None + return Tar(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter + def args(self) -> pulumi.Output['outputs.TarArgs']: + return pulumi.get(self, "args") + + @property + @pulumi.getter(name="createdFiles") + def created_files(self) -> pulumi.Output[Sequence[str]]: + return pulumi.get(self, "created_files") + + @property + @pulumi.getter(name="exitCode") + def exit_code(self) -> pulumi.Output[int]: + return pulumi.get(self, "exit_code") + + @property + @pulumi.getter(name="movedFiles") + def moved_files(self) -> pulumi.Output[Mapping[str, str]]: + return pulumi.get(self, "moved_files") + + @property + @pulumi.getter + def stderr(self) -> pulumi.Output[str]: + return pulumi.get(self, "stderr") + + @property + @pulumi.getter + def stdout(self) -> pulumi.Output[str]: + return pulumi.get(self, "stdout") + diff --git a/tests/lifecycle_test.go b/tests/lifecycle_test.go index 9e6326ee..4f7132a9 100644 --- a/tests/lifecycle_test.go +++ b/tests/lifecycle_test.go @@ -1,6 +1,7 @@ package tests import ( + "bytes" "context" "path" @@ -14,10 +15,10 @@ import ( "github.com/unmango/pulumi-baremetal/tests/util" ) -const work = "/tmp/lifecycle" +const workRoot = "/tmp/lifecycle" func containerPath(elem ...string) string { - parts := append([]string{work}, elem...) + parts := append([]string{workRoot}, elem...) return path.Join(parts...) } @@ -29,7 +30,7 @@ var _ = Describe("Command Resources", func() { server = util.NewServer() By("creating a workspace in the container") - _, err := provisioner.Exec(ctx, "mkdir", "-p", work) + _, err := provisioner.Exec(ctx, "mkdir", "-p", workRoot) Expect(err).NotTo(HaveOccurred()) By("fetching provisioner connection details") @@ -150,6 +151,105 @@ var _ = Describe("Command Resources", func() { }) }) + Describe("Tar", Ordered, func() { + work := containerPath("tar") + fileName := "someFile.txt" + contents := "Some text that really doesn't matter" + archive := containerPath("tar", "test-archive.tar.gz") + dest := containerPath("tar", "destination") + expectedFile := containerPath("tar", "destination", fileName) + + BeforeAll(func(ctx context.Context) { + By("ensuring container directories exist") + _, err := provisioner.Exec(ctx, "mkdir", "-p", work, dest) + Expect(err).NotTo(HaveOccurred()) + + By("creating an archive to operate on") + buf := &bytes.Buffer{} + err = util.CreateTarArchive(buf, map[string]string{ + fileName: contents, + }) + Expect(err).NotTo(HaveOccurred()) + + By("writing the archive to the container") + err = provisioner.WriteFile(ctx, archive, buf.Bytes()) + Expect(err).NotTo(HaveOccurred()) + }) + + test := integration.LifeCycleTest{ + Resource: "baremetal:cmd:Tar", + Create: integration.Operation{ + Inputs: resource.NewPropertyMapFromMap(map[string]interface{}{ + "extract": true, + "file": archive, + "directory": dest, + "args": []string{fileName}, + }), + Hook: func(inputs, output resource.PropertyMap) { + Expect(output["stderr"]).To(HavePropertyValue("")) + Expect(provisioner).To(ContainFile(context.Background(), expectedFile)) + }, + ExpectedOutput: resource.NewPropertyMapFromMap(map[string]interface{}{ + "exitCode": 0, + "stdout": "", + "stderr": "", + "createdFiles": []string{expectedFile}, + "movedFiles": map[string]string{}, + "args": map[string]interface{}{ + "extract": true, + "file": archive, + "directory": dest, + "args": []string{fileName}, + + // Defaults + "gzip": false, + "keepDirectorySymlink": false, + "unlinkFirst": false, + "xz": false, + "list": false, + "ignoreCommandError": false, + "excludeFrom": "", + "lzop": false, + "append": false, + "update": false, + "delete": false, + "excludeVcs": false, + "verbose": false, + "lzip": false, + "overwriteDir": false, + "transform": "", + "create": false, + "skipOldFiles": false, + "excludeVcsIgnores": false, + "verify": false, + "suffix": "", + "diff": false, + "exclude": "", + "stripComponents": 0, + "bzip2": false, + "keepNewerFiles": false, + "removeFiles": false, + "noSeek": false, + "zstd": false, + "overwrite": false, + "sparse": false, + "toStdout": false, + "lzma": false, + "keepOldfiles": false, + "noOverwriteDir": false, + }, + }), + }, + } + + It("should complete a full lifecycle", func(ctx context.Context) { + run(server, test) + + Expect(provisioner).To(ContainFile(ctx, archive)) + Expect(provisioner).NotTo(ContainFile(ctx, expectedFile)) + }) + }) + Describe("Tee", Ordered, func() { stdin := "Test lifecycle stdin" newStdin := "Updated stdin" diff --git a/tests/util/archive.go b/tests/util/archive.go new file mode 100644 index 00000000..c9dba5be --- /dev/null +++ b/tests/util/archive.go @@ -0,0 +1,32 @@ +package util + +import ( + "archive/tar" + "compress/gzip" + "fmt" + "io" +) + +func CreateTarArchive(w io.Writer, members map[string]string) error { + g := gzip.NewWriter(w) + defer func() { + _ = g.Close() + }() + + t := tar.NewWriter(g) + defer func() { + _ = t.Close() + }() + + for k, v := range members { + if err := t.WriteHeader(&tar.Header{Name: k, Size: int64(len(v))}); err != nil { + return fmt.Errorf("writing header for %s: %w", k, err) + } + + if _, err := t.Write([]byte(v)); err != nil { + return fmt.Errorf("writing contents for %s: %w", k, err) + } + } + + return nil +}