From 887e995d573813375af9d333c093158e2e975db7 Mon Sep 17 00:00:00 2001 From: Erik Rasmussen Date: Sun, 4 Aug 2024 19:49:48 -0500 Subject: [PATCH] Add mkdir and mktemp (#97) * Add mkdir and mktemp * Get tests working * Regen SDKs --- .../unmango/baremetal/v1alpha1/command.pb.go | 74 +++-- .../unmango/baremetal/v1alpha1/command.proto | 2 + provider/pkg/provider/cmd/mkdir.go | 73 +++++ provider/pkg/provider/cmd/mktemp.go | 85 ++++++ provider/pkg/provisioner/cmd/service.go | 4 + provider/provider.go | 2 + sdk/dotnet/Cmd/Mkdir.cs | 108 +++++++ sdk/dotnet/Cmd/Mktemp.cs | 115 +++++++ sdk/dotnet/Cmd/Outputs/MkdirArgs.cs | 46 +++ sdk/dotnet/Cmd/Outputs/MktempArgs.cs | 62 ++++ sdk/go/baremetal/cmd/init.go | 4 + sdk/go/baremetal/cmd/mkdir.go | 164 ++++++++++ sdk/go/baremetal/cmd/mktemp.go | 168 +++++++++++ sdk/go/baremetal/cmd/pulumiTypes.go | 128 ++++++++ sdk/go/baremetal/x/cmd/init.go | 4 + sdk/go/baremetal/x/cmd/mkdir.go | 147 +++++++++ sdk/go/baremetal/x/cmd/mktemp.go | 151 ++++++++++ sdk/go/baremetal/x/cmd/pulumiTypes.go | 129 ++++++++ sdk/nodejs/cmd/index.ts | 14 + sdk/nodejs/cmd/mkdir.ts | 92 ++++++ sdk/nodejs/cmd/mktemp.ts | 97 ++++++ sdk/nodejs/tsconfig.json | 2 + sdk/nodejs/types/output.ts | 22 ++ sdk/python/unmango_baremetal/__init__.py | 2 + sdk/python/unmango_baremetal/cmd/__init__.py | 2 + sdk/python/unmango_baremetal/cmd/mkdir.py | 222 ++++++++++++++ sdk/python/unmango_baremetal/cmd/mktemp.py | 281 ++++++++++++++++++ sdk/python/unmango_baremetal/cmd/outputs.py | 156 ++++++++++ tests/lifecycle_test.go | 65 ++++ 29 files changed, 2388 insertions(+), 33 deletions(-) create mode 100644 provider/pkg/provider/cmd/mkdir.go create mode 100644 provider/pkg/provider/cmd/mktemp.go create mode 100644 sdk/dotnet/Cmd/Mkdir.cs create mode 100644 sdk/dotnet/Cmd/Mktemp.cs create mode 100644 sdk/dotnet/Cmd/Outputs/MkdirArgs.cs create mode 100644 sdk/dotnet/Cmd/Outputs/MktempArgs.cs create mode 100644 sdk/go/baremetal/cmd/mkdir.go create mode 100644 sdk/go/baremetal/cmd/mktemp.go create mode 100644 sdk/go/baremetal/x/cmd/mkdir.go create mode 100644 sdk/go/baremetal/x/cmd/mktemp.go create mode 100644 sdk/nodejs/cmd/mkdir.ts create mode 100644 sdk/nodejs/cmd/mktemp.ts create mode 100644 sdk/python/unmango_baremetal/cmd/mkdir.py create mode 100644 sdk/python/unmango_baremetal/cmd/mktemp.py diff --git a/gen/go/unmango/baremetal/v1alpha1/command.pb.go b/gen/go/unmango/baremetal/v1alpha1/command.pb.go index f2c7f31e..201fb107 100644 --- a/gen/go/unmango/baremetal/v1alpha1/command.pb.go +++ b/gen/go/unmango/baremetal/v1alpha1/command.pb.go @@ -29,6 +29,8 @@ const ( Bin_BIN_WGET Bin = 3 Bin_BIN_MV Bin = 4 Bin_BIN_TAR Bin = 5 + Bin_BIN_MKDIR Bin = 6 + Bin_BIN_MKTEMP Bin = 7 ) // Enum value maps for Bin. @@ -40,6 +42,8 @@ var ( 3: "BIN_WGET", 4: "BIN_MV", 5: "BIN_TAR", + 6: "BIN_MKDIR", + 7: "BIN_MKTEMP", } Bin_value = map[string]int32{ "BIN_UNSPECIFIED": 0, @@ -48,6 +52,8 @@ var ( "BIN_WGET": 3, "BIN_MV": 4, "BIN_TAR": 5, + "BIN_MKDIR": 6, + "BIN_MKTEMP": 7, } ) @@ -776,50 +782,52 @@ 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, 0x5a, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x2a, 0x79, 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, 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, + 0x07, 0x42, 0x49, 0x4e, 0x5f, 0x54, 0x41, 0x52, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x42, 0x49, + 0x4e, 0x5f, 0x4d, 0x4b, 0x44, 0x49, 0x52, 0x10, 0x06, 0x12, 0x0e, 0x0a, 0x0a, 0x42, 0x49, 0x4e, + 0x5f, 0x4d, 0x4b, 0x54, 0x45, 0x4d, 0x50, 0x10, 0x07, 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, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 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, - 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, + 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, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, + 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, 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, 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, + 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 bde5c7fc..cb7b3381 100644 --- a/proto/unmango/baremetal/v1alpha1/command.proto +++ b/proto/unmango/baremetal/v1alpha1/command.proto @@ -69,4 +69,6 @@ enum Bin { BIN_WGET = 3; BIN_MV = 4; BIN_TAR = 5; + BIN_MKDIR = 6; + BIN_MKTEMP = 7; } diff --git a/provider/pkg/provider/cmd/mkdir.go b/provider/pkg/provider/cmd/mkdir.go new file mode 100644 index 00000000..92eedde6 --- /dev/null +++ b/provider/pkg/provider/cmd/mkdir.go @@ -0,0 +1,73 @@ +package cmd + +import ( + "context" + "fmt" + + "github.com/pulumi/pulumi-go-provider/infer" + pb "github.com/unmango/pulumi-baremetal/gen/go/unmango/baremetal/v1alpha1" +) + +type MkdirArgs struct { + DefaultFileManipulator + Directory []string `pulumi:"directory"` + Mode string `pulumi:"mode,optional"` + Parents bool `pulumi:"parents,optional"` + Verbose bool `pulumi:"verbose,optional"` + Help bool `pulumi:"help,optional"` + Version bool `pulumi:"version,optional"` +} + +// Cmd implements CommandArgs. +func (m MkdirArgs) Cmd() *pb.Command { + b := builder{m.Directory} + b.opv(m.Mode, "--mode") + b.op(m.Parents, "--parents") + b.op(m.Verbose, "--verbose") + b.op(m.Help, "--help") + b.op(m.Version, "--version") + + return &pb.Command{ + Bin: pb.Bin_BIN_MKDIR, + Args: b.args, + } +} + +var _ CommandArgs = MkdirArgs{} + +type Mkdir struct{} + +type MkdirState = CommandState[MkdirArgs] + +// Create implements infer.CustomCreate. +func (Mkdir) Create(ctx context.Context, name string, inputs MkdirArgs, preview bool) (id string, output MkdirState, err error) { + state := MkdirState{} + if err := state.Create(ctx, inputs, preview); err != nil { + return name, state, fmt.Errorf("mkdir: %w", err) + } + + return name, state, nil +} + +// Update implements infer.CustomUpdate. +func (Mkdir) Update(ctx context.Context, id string, olds MkdirState, news MkdirArgs, preview bool) (MkdirState, error) { + state, err := olds.Update(ctx, news, preview) + if err != nil { + return olds, fmt.Errorf("mkdir: %w", err) + } + + return state, nil +} + +// Delete implements infer.CustomDelete. +func (Mkdir) Delete(ctx context.Context, id string, props MkdirState) error { + if err := props.Delete(ctx); err != nil { + return fmt.Errorf("mkdir: %w", err) + } + + return nil +} + +var _ = (infer.CustomCreate[MkdirArgs, MkdirState])((*Mkdir)(nil)) +var _ = (infer.CustomUpdate[MkdirArgs, MkdirState])((*Mkdir)(nil)) +var _ = (infer.CustomDelete[MkdirState])((*Mkdir)(nil)) diff --git a/provider/pkg/provider/cmd/mktemp.go b/provider/pkg/provider/cmd/mktemp.go new file mode 100644 index 00000000..32d76ced --- /dev/null +++ b/provider/pkg/provider/cmd/mktemp.go @@ -0,0 +1,85 @@ +package cmd + +import ( + "context" + "fmt" + + "github.com/pulumi/pulumi-go-provider/infer" + pb "github.com/unmango/pulumi-baremetal/gen/go/unmango/baremetal/v1alpha1" +) + +type MktempArgs struct { + DefaultFileManipulator + Template string `pulumi:"template,optional"` + Directory bool `pulumi:"directory,optional"` + DryRun bool `pulumi:"dryRun,optional"` + Quiet bool `pulumi:"quiet,optional"` + Suffix string `pulumi:"suffix,optional"` + P string `pulumi:"p,optional"` + TmpDir bool `pulumi:"tmpdir,optional"` + T bool `pulumi:"t,optional"` + Help bool `pulumi:"help,optional"` + Version bool `pulumi:"version,optional"` +} + +// Cmd implements CommandArgs. +func (m MktempArgs) Cmd() *pb.Command { + b := builder{} + b.op(m.Directory, "--directory") + b.op(m.DryRun, "--dry-run") + b.op(m.Quiet, "--quiet") + b.opv(m.Suffix, "--suffix") + b.opv(m.P, "-p") + b.op(m.TmpDir, "--tmpdir") + b.op(m.T, "-t") + b.op(m.Help, "--help") + b.op(m.Version, "--version") + + if m.Template != "" { + b.arg(m.Template) + } + + return &pb.Command{ + Bin: pb.Bin_BIN_MKTEMP, + Args: b.args, + } +} + +var _ CommandArgs = MktempArgs{} + +type Mktemp struct{} + +type MktempState = CommandState[MktempArgs] + +// Create implements infer.CustomCreate. +func (Mktemp) Create(ctx context.Context, name string, inputs MktempArgs, preview bool) (id string, output MktempState, err error) { + state := MktempState{} + if err := state.Create(ctx, inputs, preview); err != nil { + return name, state, fmt.Errorf("mktemp: %w", err) + } + + return name, state, nil +} + +// Update implements infer.CustomUpdate. +func (Mktemp) Update(ctx context.Context, id string, olds MktempState, news MktempArgs, preview bool) (MktempState, error) { + state, err := olds.Update(ctx, news, preview) + if err != nil { + return olds, fmt.Errorf("mktemp: %w", err) + } + + return state, nil +} + +// Delete implements infer.CustomDelete. +func (Mktemp) Delete(ctx context.Context, id string, props MktempState) error { + if err := props.Delete(ctx); err != nil { + return fmt.Errorf("mktemp: %w", err) + } + + return nil +} + +var _ = (infer.CustomCreate[MktempArgs, MktempState])((*Mktemp)(nil)) +var _ = (infer.CustomUpdate[MktempArgs, MktempState])((*Mktemp)(nil)) +var _ = (infer.CustomDelete[MktempState])((*Mktemp)(nil)) diff --git a/provider/pkg/provisioner/cmd/service.go b/provider/pkg/provisioner/cmd/service.go index aeb5bf56..58c433e6 100644 --- a/provider/pkg/provisioner/cmd/service.go +++ b/provider/pkg/provisioner/cmd/service.go @@ -211,6 +211,10 @@ func (s *service) Delete(ctx context.Context, req *pb.DeleteRequest) (*pb.Delete func binPath(b pb.Bin) (string, error) { switch b { + case pb.Bin_BIN_MKDIR: + return "mkdir", nil + case pb.Bin_BIN_MKTEMP: + return "mktemp", nil case pb.Bin_BIN_MV: return "mv", nil case pb.Bin_BIN_RM: diff --git a/provider/provider.go b/provider/provider.go index 3b3d50ff..c0ef6cb1 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -46,6 +46,8 @@ func Provider() p.Provider { }, Config: infer.Config[provider.Config](), Resources: []infer.InferredResource{ + infer.Resource[cmd.Mkdir](), + infer.Resource[cmd.Mktemp](), infer.Resource[cmd.Mv](), infer.Resource[cmd.Rm](), infer.Resource[cmd.Tar](), diff --git a/sdk/dotnet/Cmd/Mkdir.cs b/sdk/dotnet/Cmd/Mkdir.cs new file mode 100644 index 00000000..d3ee16f5 --- /dev/null +++ b/sdk/dotnet/Cmd/Mkdir.cs @@ -0,0 +1,108 @@ +// *** 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:Mkdir")] + public partial class Mkdir : 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 Mkdir 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 Mkdir(string name, MkdirArgs args, CustomResourceOptions? options = null) + : base("baremetal:cmd:Mkdir", name, args ?? new MkdirArgs(), MakeResourceOptions(options, "")) + { + } + + private Mkdir(string name, Input id, CustomResourceOptions? options = null) + : base("baremetal:cmd:Mkdir", 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 Mkdir 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 Mkdir Get(string name, Input id, CustomResourceOptions? options = null) + { + return new Mkdir(name, id, options); + } + } + + public sealed class MkdirArgs : global::Pulumi.ResourceArgs + { + [Input("directory", required: true)] + private InputList? _directory; + public InputList Directory + { + get => _directory ?? (_directory = new InputList()); + set => _directory = value; + } + + [Input("help")] + public Input? Help { get; set; } + + [Input("mode")] + public Input? Mode { get; set; } + + [Input("parents")] + public Input? Parents { get; set; } + + [Input("verbose")] + public Input? Verbose { get; set; } + + [Input("version")] + public Input? Version { get; set; } + + public MkdirArgs() + { + } + public static new MkdirArgs Empty => new MkdirArgs(); + } +} diff --git a/sdk/dotnet/Cmd/Mktemp.cs b/sdk/dotnet/Cmd/Mktemp.cs new file mode 100644 index 00000000..dd7e8a3f --- /dev/null +++ b/sdk/dotnet/Cmd/Mktemp.cs @@ -0,0 +1,115 @@ +// *** 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:Mktemp")] + public partial class Mktemp : 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 Mktemp 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 Mktemp(string name, MktempArgs? args = null, CustomResourceOptions? options = null) + : base("baremetal:cmd:Mktemp", name, args ?? new MktempArgs(), MakeResourceOptions(options, "")) + { + } + + private Mktemp(string name, Input id, CustomResourceOptions? options = null) + : base("baremetal:cmd:Mktemp", 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 Mktemp 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 Mktemp Get(string name, Input id, CustomResourceOptions? options = null) + { + return new Mktemp(name, id, options); + } + } + + public sealed class MktempArgs : global::Pulumi.ResourceArgs + { + [Input("directory")] + public Input? Directory { get; set; } + + [Input("dryRun")] + public Input? DryRun { get; set; } + + [Input("help")] + public Input? Help { get; set; } + + [Input("p")] + public Input? P { get; set; } + + [Input("quiet")] + public Input? Quiet { get; set; } + + [Input("suffix")] + public Input? Suffix { get; set; } + + [Input("t")] + public Input? T { get; set; } + + [Input("template")] + public Input? Template { get; set; } + + [Input("tmpdir")] + public Input? Tmpdir { get; set; } + + [Input("version")] + public Input? Version { get; set; } + + public MktempArgs() + { + } + public static new MktempArgs Empty => new MktempArgs(); + } +} diff --git a/sdk/dotnet/Cmd/Outputs/MkdirArgs.cs b/sdk/dotnet/Cmd/Outputs/MkdirArgs.cs new file mode 100644 index 00000000..dcdad816 --- /dev/null +++ b/sdk/dotnet/Cmd/Outputs/MkdirArgs.cs @@ -0,0 +1,46 @@ +// *** 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 MkdirArgs + { + public readonly ImmutableArray Directory; + public readonly bool? Help; + public readonly string? Mode; + public readonly bool? Parents; + public readonly bool? Verbose; + public readonly bool? Version; + + [OutputConstructor] + private MkdirArgs( + ImmutableArray directory, + + bool? help, + + string? mode, + + bool? parents, + + bool? verbose, + + bool? version) + { + Directory = directory; + Help = help; + Mode = mode; + Parents = parents; + Verbose = verbose; + Version = version; + } + } +} diff --git a/sdk/dotnet/Cmd/Outputs/MktempArgs.cs b/sdk/dotnet/Cmd/Outputs/MktempArgs.cs new file mode 100644 index 00000000..9bea6cf9 --- /dev/null +++ b/sdk/dotnet/Cmd/Outputs/MktempArgs.cs @@ -0,0 +1,62 @@ +// *** 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 MktempArgs + { + public readonly bool? Directory; + public readonly bool? DryRun; + public readonly bool? Help; + public readonly string? P; + public readonly bool? Quiet; + public readonly string? Suffix; + public readonly bool? T; + public readonly string? Template; + public readonly bool? Tmpdir; + public readonly bool? Version; + + [OutputConstructor] + private MktempArgs( + bool? directory, + + bool? dryRun, + + bool? help, + + string? p, + + bool? quiet, + + string? suffix, + + bool? t, + + string? template, + + bool? tmpdir, + + bool? version) + { + Directory = directory; + DryRun = dryRun; + Help = help; + P = p; + Quiet = quiet; + Suffix = suffix; + T = t; + Template = template; + Tmpdir = tmpdir; + Version = version; + } + } +} diff --git a/sdk/go/baremetal/cmd/init.go b/sdk/go/baremetal/cmd/init.go index 5cff1c70..b84699b9 100644 --- a/sdk/go/baremetal/cmd/init.go +++ b/sdk/go/baremetal/cmd/init.go @@ -21,6 +21,10 @@ func (m *module) Version() semver.Version { func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { switch typ { + case "baremetal:cmd:Mkdir": + r = &Mkdir{} + case "baremetal:cmd:Mktemp": + r = &Mktemp{} case "baremetal:cmd:Mv": r = &Mv{} case "baremetal:cmd:Rm": diff --git a/sdk/go/baremetal/cmd/mkdir.go b/sdk/go/baremetal/cmd/mkdir.go new file mode 100644 index 00000000..c70e396d --- /dev/null +++ b/sdk/go/baremetal/cmd/mkdir.go @@ -0,0 +1,164 @@ +// 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" + + "errors" + "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 Mkdir struct { + pulumi.CustomResourceState + + Args MkdirArgsTypeOutput `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"` +} + +// NewMkdir registers a new resource with the given unique name, arguments, and options. +func NewMkdir(ctx *pulumi.Context, + name string, args *MkdirArgs, opts ...pulumi.ResourceOption) (*Mkdir, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.Directory == nil { + return nil, errors.New("invalid value for required argument 'Directory'") + } + opts = internal.PkgResourceDefaultOpts(opts) + var resource Mkdir + err := ctx.RegisterResource("baremetal:cmd:Mkdir", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetMkdir gets an existing Mkdir 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 GetMkdir(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *MkdirState, opts ...pulumi.ResourceOption) (*Mkdir, error) { + var resource Mkdir + err := ctx.ReadResource("baremetal:cmd:Mkdir", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Mkdir resources. +type mkdirState struct { +} + +type MkdirState struct { +} + +func (MkdirState) ElementType() reflect.Type { + return reflect.TypeOf((*mkdirState)(nil)).Elem() +} + +type mkdirArgs struct { + Directory []string `pulumi:"directory"` + Help *bool `pulumi:"help"` + Mode *string `pulumi:"mode"` + Parents *bool `pulumi:"parents"` + Verbose *bool `pulumi:"verbose"` + Version *bool `pulumi:"version"` +} + +// The set of arguments for constructing a Mkdir resource. +type MkdirArgs struct { + Directory pulumi.StringArrayInput + Help pulumi.BoolPtrInput + Mode pulumi.StringPtrInput + Parents pulumi.BoolPtrInput + Verbose pulumi.BoolPtrInput + Version pulumi.BoolPtrInput +} + +func (MkdirArgs) ElementType() reflect.Type { + return reflect.TypeOf((*mkdirArgs)(nil)).Elem() +} + +type MkdirInput interface { + pulumi.Input + + ToMkdirOutput() MkdirOutput + ToMkdirOutputWithContext(ctx context.Context) MkdirOutput +} + +func (*Mkdir) ElementType() reflect.Type { + return reflect.TypeOf((**Mkdir)(nil)).Elem() +} + +func (i *Mkdir) ToMkdirOutput() MkdirOutput { + return i.ToMkdirOutputWithContext(context.Background()) +} + +func (i *Mkdir) ToMkdirOutputWithContext(ctx context.Context) MkdirOutput { + return pulumi.ToOutputWithContext(ctx, i).(MkdirOutput) +} + +func (i *Mkdir) ToOutput(ctx context.Context) pulumix.Output[*Mkdir] { + return pulumix.Output[*Mkdir]{ + OutputState: i.ToMkdirOutputWithContext(ctx).OutputState, + } +} + +type MkdirOutput struct{ *pulumi.OutputState } + +func (MkdirOutput) ElementType() reflect.Type { + return reflect.TypeOf((**Mkdir)(nil)).Elem() +} + +func (o MkdirOutput) ToMkdirOutput() MkdirOutput { + return o +} + +func (o MkdirOutput) ToMkdirOutputWithContext(ctx context.Context) MkdirOutput { + return o +} + +func (o MkdirOutput) ToOutput(ctx context.Context) pulumix.Output[*Mkdir] { + return pulumix.Output[*Mkdir]{ + OutputState: o.OutputState, + } +} + +func (o MkdirOutput) Args() MkdirArgsTypeOutput { + return o.ApplyT(func(v *Mkdir) MkdirArgsTypeOutput { return v.Args }).(MkdirArgsTypeOutput) +} + +func (o MkdirOutput) CreatedFiles() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Mkdir) pulumi.StringArrayOutput { return v.CreatedFiles }).(pulumi.StringArrayOutput) +} + +func (o MkdirOutput) ExitCode() pulumi.IntOutput { + return o.ApplyT(func(v *Mkdir) pulumi.IntOutput { return v.ExitCode }).(pulumi.IntOutput) +} + +func (o MkdirOutput) MovedFiles() pulumi.StringMapOutput { + return o.ApplyT(func(v *Mkdir) pulumi.StringMapOutput { return v.MovedFiles }).(pulumi.StringMapOutput) +} + +func (o MkdirOutput) Stderr() pulumi.StringOutput { + return o.ApplyT(func(v *Mkdir) pulumi.StringOutput { return v.Stderr }).(pulumi.StringOutput) +} + +func (o MkdirOutput) Stdout() pulumi.StringOutput { + return o.ApplyT(func(v *Mkdir) pulumi.StringOutput { return v.Stdout }).(pulumi.StringOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*MkdirInput)(nil)).Elem(), &Mkdir{}) + pulumi.RegisterOutputType(MkdirOutput{}) +} diff --git a/sdk/go/baremetal/cmd/mktemp.go b/sdk/go/baremetal/cmd/mktemp.go new file mode 100644 index 00000000..153f9f56 --- /dev/null +++ b/sdk/go/baremetal/cmd/mktemp.go @@ -0,0 +1,168 @@ +// 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 Mktemp struct { + pulumi.CustomResourceState + + Args MktempArgsTypeOutput `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"` +} + +// NewMktemp registers a new resource with the given unique name, arguments, and options. +func NewMktemp(ctx *pulumi.Context, + name string, args *MktempArgs, opts ...pulumi.ResourceOption) (*Mktemp, error) { + if args == nil { + args = &MktempArgs{} + } + + opts = internal.PkgResourceDefaultOpts(opts) + var resource Mktemp + err := ctx.RegisterResource("baremetal:cmd:Mktemp", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetMktemp gets an existing Mktemp 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 GetMktemp(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *MktempState, opts ...pulumi.ResourceOption) (*Mktemp, error) { + var resource Mktemp + err := ctx.ReadResource("baremetal:cmd:Mktemp", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Mktemp resources. +type mktempState struct { +} + +type MktempState struct { +} + +func (MktempState) ElementType() reflect.Type { + return reflect.TypeOf((*mktempState)(nil)).Elem() +} + +type mktempArgs struct { + Directory *bool `pulumi:"directory"` + DryRun *bool `pulumi:"dryRun"` + Help *bool `pulumi:"help"` + P *string `pulumi:"p"` + Quiet *bool `pulumi:"quiet"` + Suffix *string `pulumi:"suffix"` + T *bool `pulumi:"t"` + Template *string `pulumi:"template"` + Tmpdir *bool `pulumi:"tmpdir"` + Version *bool `pulumi:"version"` +} + +// The set of arguments for constructing a Mktemp resource. +type MktempArgs struct { + Directory pulumi.BoolPtrInput + DryRun pulumi.BoolPtrInput + Help pulumi.BoolPtrInput + P pulumi.StringPtrInput + Quiet pulumi.BoolPtrInput + Suffix pulumi.StringPtrInput + T pulumi.BoolPtrInput + Template pulumi.StringPtrInput + Tmpdir pulumi.BoolPtrInput + Version pulumi.BoolPtrInput +} + +func (MktempArgs) ElementType() reflect.Type { + return reflect.TypeOf((*mktempArgs)(nil)).Elem() +} + +type MktempInput interface { + pulumi.Input + + ToMktempOutput() MktempOutput + ToMktempOutputWithContext(ctx context.Context) MktempOutput +} + +func (*Mktemp) ElementType() reflect.Type { + return reflect.TypeOf((**Mktemp)(nil)).Elem() +} + +func (i *Mktemp) ToMktempOutput() MktempOutput { + return i.ToMktempOutputWithContext(context.Background()) +} + +func (i *Mktemp) ToMktempOutputWithContext(ctx context.Context) MktempOutput { + return pulumi.ToOutputWithContext(ctx, i).(MktempOutput) +} + +func (i *Mktemp) ToOutput(ctx context.Context) pulumix.Output[*Mktemp] { + return pulumix.Output[*Mktemp]{ + OutputState: i.ToMktempOutputWithContext(ctx).OutputState, + } +} + +type MktempOutput struct{ *pulumi.OutputState } + +func (MktempOutput) ElementType() reflect.Type { + return reflect.TypeOf((**Mktemp)(nil)).Elem() +} + +func (o MktempOutput) ToMktempOutput() MktempOutput { + return o +} + +func (o MktempOutput) ToMktempOutputWithContext(ctx context.Context) MktempOutput { + return o +} + +func (o MktempOutput) ToOutput(ctx context.Context) pulumix.Output[*Mktemp] { + return pulumix.Output[*Mktemp]{ + OutputState: o.OutputState, + } +} + +func (o MktempOutput) Args() MktempArgsTypeOutput { + return o.ApplyT(func(v *Mktemp) MktempArgsTypeOutput { return v.Args }).(MktempArgsTypeOutput) +} + +func (o MktempOutput) CreatedFiles() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Mktemp) pulumi.StringArrayOutput { return v.CreatedFiles }).(pulumi.StringArrayOutput) +} + +func (o MktempOutput) ExitCode() pulumi.IntOutput { + return o.ApplyT(func(v *Mktemp) pulumi.IntOutput { return v.ExitCode }).(pulumi.IntOutput) +} + +func (o MktempOutput) MovedFiles() pulumi.StringMapOutput { + return o.ApplyT(func(v *Mktemp) pulumi.StringMapOutput { return v.MovedFiles }).(pulumi.StringMapOutput) +} + +func (o MktempOutput) Stderr() pulumi.StringOutput { + return o.ApplyT(func(v *Mktemp) pulumi.StringOutput { return v.Stderr }).(pulumi.StringOutput) +} + +func (o MktempOutput) Stdout() pulumi.StringOutput { + return o.ApplyT(func(v *Mktemp) pulumi.StringOutput { return v.Stdout }).(pulumi.StringOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*MktempInput)(nil)).Elem(), &Mktemp{}) + pulumi.RegisterOutputType(MktempOutput{}) +} diff --git a/sdk/go/baremetal/cmd/pulumiTypes.go b/sdk/go/baremetal/cmd/pulumiTypes.go index 88402f14..a673d123 100644 --- a/sdk/go/baremetal/cmd/pulumiTypes.go +++ b/sdk/go/baremetal/cmd/pulumiTypes.go @@ -14,6 +14,132 @@ import ( var _ = internal.GetEnvOrDefault +type MkdirArgsType struct { + Directory []string `pulumi:"directory"` + Help *bool `pulumi:"help"` + Mode *string `pulumi:"mode"` + Parents *bool `pulumi:"parents"` + Verbose *bool `pulumi:"verbose"` + Version *bool `pulumi:"version"` +} + +type MkdirArgsTypeOutput struct{ *pulumi.OutputState } + +func (MkdirArgsTypeOutput) ElementType() reflect.Type { + return reflect.TypeOf((*MkdirArgsType)(nil)).Elem() +} + +func (o MkdirArgsTypeOutput) ToMkdirArgsTypeOutput() MkdirArgsTypeOutput { + return o +} + +func (o MkdirArgsTypeOutput) ToMkdirArgsTypeOutputWithContext(ctx context.Context) MkdirArgsTypeOutput { + return o +} + +func (o MkdirArgsTypeOutput) ToOutput(ctx context.Context) pulumix.Output[MkdirArgsType] { + return pulumix.Output[MkdirArgsType]{ + OutputState: o.OutputState, + } +} + +func (o MkdirArgsTypeOutput) Directory() pulumi.StringArrayOutput { + return o.ApplyT(func(v MkdirArgsType) []string { return v.Directory }).(pulumi.StringArrayOutput) +} + +func (o MkdirArgsTypeOutput) Help() pulumi.BoolPtrOutput { + return o.ApplyT(func(v MkdirArgsType) *bool { return v.Help }).(pulumi.BoolPtrOutput) +} + +func (o MkdirArgsTypeOutput) Mode() pulumi.StringPtrOutput { + return o.ApplyT(func(v MkdirArgsType) *string { return v.Mode }).(pulumi.StringPtrOutput) +} + +func (o MkdirArgsTypeOutput) Parents() pulumi.BoolPtrOutput { + return o.ApplyT(func(v MkdirArgsType) *bool { return v.Parents }).(pulumi.BoolPtrOutput) +} + +func (o MkdirArgsTypeOutput) Verbose() pulumi.BoolPtrOutput { + return o.ApplyT(func(v MkdirArgsType) *bool { return v.Verbose }).(pulumi.BoolPtrOutput) +} + +func (o MkdirArgsTypeOutput) Version() pulumi.BoolPtrOutput { + return o.ApplyT(func(v MkdirArgsType) *bool { return v.Version }).(pulumi.BoolPtrOutput) +} + +type MktempArgsType struct { + Directory *bool `pulumi:"directory"` + DryRun *bool `pulumi:"dryRun"` + Help *bool `pulumi:"help"` + P *string `pulumi:"p"` + Quiet *bool `pulumi:"quiet"` + Suffix *string `pulumi:"suffix"` + T *bool `pulumi:"t"` + Template *string `pulumi:"template"` + Tmpdir *bool `pulumi:"tmpdir"` + Version *bool `pulumi:"version"` +} + +type MktempArgsTypeOutput struct{ *pulumi.OutputState } + +func (MktempArgsTypeOutput) ElementType() reflect.Type { + return reflect.TypeOf((*MktempArgsType)(nil)).Elem() +} + +func (o MktempArgsTypeOutput) ToMktempArgsTypeOutput() MktempArgsTypeOutput { + return o +} + +func (o MktempArgsTypeOutput) ToMktempArgsTypeOutputWithContext(ctx context.Context) MktempArgsTypeOutput { + return o +} + +func (o MktempArgsTypeOutput) ToOutput(ctx context.Context) pulumix.Output[MktempArgsType] { + return pulumix.Output[MktempArgsType]{ + OutputState: o.OutputState, + } +} + +func (o MktempArgsTypeOutput) Directory() pulumi.BoolPtrOutput { + return o.ApplyT(func(v MktempArgsType) *bool { return v.Directory }).(pulumi.BoolPtrOutput) +} + +func (o MktempArgsTypeOutput) DryRun() pulumi.BoolPtrOutput { + return o.ApplyT(func(v MktempArgsType) *bool { return v.DryRun }).(pulumi.BoolPtrOutput) +} + +func (o MktempArgsTypeOutput) Help() pulumi.BoolPtrOutput { + return o.ApplyT(func(v MktempArgsType) *bool { return v.Help }).(pulumi.BoolPtrOutput) +} + +func (o MktempArgsTypeOutput) P() pulumi.StringPtrOutput { + return o.ApplyT(func(v MktempArgsType) *string { return v.P }).(pulumi.StringPtrOutput) +} + +func (o MktempArgsTypeOutput) Quiet() pulumi.BoolPtrOutput { + return o.ApplyT(func(v MktempArgsType) *bool { return v.Quiet }).(pulumi.BoolPtrOutput) +} + +func (o MktempArgsTypeOutput) Suffix() pulumi.StringPtrOutput { + return o.ApplyT(func(v MktempArgsType) *string { return v.Suffix }).(pulumi.StringPtrOutput) +} + +func (o MktempArgsTypeOutput) T() pulumi.BoolPtrOutput { + return o.ApplyT(func(v MktempArgsType) *bool { return v.T }).(pulumi.BoolPtrOutput) +} + +func (o MktempArgsTypeOutput) Template() pulumi.StringPtrOutput { + return o.ApplyT(func(v MktempArgsType) *string { return v.Template }).(pulumi.StringPtrOutput) +} + +func (o MktempArgsTypeOutput) Tmpdir() pulumi.BoolPtrOutput { + return o.ApplyT(func(v MktempArgsType) *bool { return v.Tmpdir }).(pulumi.BoolPtrOutput) +} + +func (o MktempArgsTypeOutput) Version() pulumi.BoolPtrOutput { + return o.ApplyT(func(v MktempArgsType) *bool { return v.Version }).(pulumi.BoolPtrOutput) +} + type MvArgsType struct { Backup *string `pulumi:"backup"` Destination *string `pulumi:"destination"` @@ -675,6 +801,8 @@ func (o WgetArgsTypeOutput) Wait() pulumi.StringPtrOutput { } func init() { + pulumi.RegisterOutputType(MkdirArgsTypeOutput{}) + pulumi.RegisterOutputType(MktempArgsTypeOutput{}) pulumi.RegisterOutputType(MvArgsTypeOutput{}) pulumi.RegisterOutputType(RmArgsTypeOutput{}) pulumi.RegisterOutputType(TarArgsTypeOutput{}) diff --git a/sdk/go/baremetal/x/cmd/init.go b/sdk/go/baremetal/x/cmd/init.go index 5cff1c70..b84699b9 100644 --- a/sdk/go/baremetal/x/cmd/init.go +++ b/sdk/go/baremetal/x/cmd/init.go @@ -21,6 +21,10 @@ func (m *module) Version() semver.Version { func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { switch typ { + case "baremetal:cmd:Mkdir": + r = &Mkdir{} + case "baremetal:cmd:Mktemp": + r = &Mktemp{} case "baremetal:cmd:Mv": r = &Mv{} case "baremetal:cmd:Rm": diff --git a/sdk/go/baremetal/x/cmd/mkdir.go b/sdk/go/baremetal/x/cmd/mkdir.go new file mode 100644 index 00000000..479219e5 --- /dev/null +++ b/sdk/go/baremetal/x/cmd/mkdir.go @@ -0,0 +1,147 @@ +// 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" + + "errors" + "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 Mkdir struct { + pulumi.CustomResourceState + + Args pulumix.GPtrOutput[MkdirArgsType, MkdirArgsTypeOutput] `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"` +} + +// NewMkdir registers a new resource with the given unique name, arguments, and options. +func NewMkdir(ctx *pulumi.Context, + name string, args *MkdirArgs, opts ...pulumi.ResourceOption) (*Mkdir, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.Directory == nil { + return nil, errors.New("invalid value for required argument 'Directory'") + } + opts = internal.PkgResourceDefaultOpts(opts) + var resource Mkdir + err := ctx.RegisterResource("baremetal:cmd:Mkdir", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetMkdir gets an existing Mkdir 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 GetMkdir(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *MkdirState, opts ...pulumi.ResourceOption) (*Mkdir, error) { + var resource Mkdir + err := ctx.ReadResource("baremetal:cmd:Mkdir", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Mkdir resources. +type mkdirState struct { +} + +type MkdirState struct { +} + +func (MkdirState) ElementType() reflect.Type { + return reflect.TypeOf((*mkdirState)(nil)).Elem() +} + +type mkdirArgs struct { + Directory []string `pulumi:"directory"` + Help *bool `pulumi:"help"` + Mode *string `pulumi:"mode"` + Parents *bool `pulumi:"parents"` + Verbose *bool `pulumi:"verbose"` + Version *bool `pulumi:"version"` +} + +// The set of arguments for constructing a Mkdir resource. +type MkdirArgs struct { + Directory pulumix.Input[[]string] + Help pulumix.Input[*bool] + Mode pulumix.Input[*string] + Parents pulumix.Input[*bool] + Verbose pulumix.Input[*bool] + Version pulumix.Input[*bool] +} + +func (MkdirArgs) ElementType() reflect.Type { + return reflect.TypeOf((*mkdirArgs)(nil)).Elem() +} + +type MkdirOutput struct{ *pulumi.OutputState } + +func (MkdirOutput) ElementType() reflect.Type { + return reflect.TypeOf((*Mkdir)(nil)).Elem() +} + +func (o MkdirOutput) ToMkdirOutput() MkdirOutput { + return o +} + +func (o MkdirOutput) ToMkdirOutputWithContext(ctx context.Context) MkdirOutput { + return o +} + +func (o MkdirOutput) ToOutput(ctx context.Context) pulumix.Output[Mkdir] { + return pulumix.Output[Mkdir]{ + OutputState: o.OutputState, + } +} + +func (o MkdirOutput) Args() pulumix.GPtrOutput[MkdirArgsType, MkdirArgsTypeOutput] { + value := pulumix.Apply[Mkdir](o, func(v Mkdir) pulumix.GPtrOutput[MkdirArgsType, MkdirArgsTypeOutput] { return v.Args }) + unwrapped := pulumix.Flatten[*MkdirArgsType, pulumix.GPtrOutput[MkdirArgsType, MkdirArgsTypeOutput]](value) + return pulumix.GPtrOutput[MkdirArgsType, MkdirArgsTypeOutput]{OutputState: unwrapped.OutputState} +} + +func (o MkdirOutput) CreatedFiles() pulumix.ArrayOutput[string] { + value := pulumix.Apply[Mkdir](o, func(v Mkdir) pulumix.ArrayOutput[string] { return v.CreatedFiles }) + unwrapped := pulumix.Flatten[[]string, pulumix.ArrayOutput[string]](value) + return pulumix.ArrayOutput[string]{OutputState: unwrapped.OutputState} +} + +func (o MkdirOutput) ExitCode() pulumix.Output[int] { + value := pulumix.Apply[Mkdir](o, func(v Mkdir) pulumix.Output[int] { return v.ExitCode }) + return pulumix.Flatten[int, pulumix.Output[int]](value) +} + +func (o MkdirOutput) MovedFiles() pulumix.MapOutput[string] { + value := pulumix.Apply[Mkdir](o, func(v Mkdir) 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 MkdirOutput) Stderr() pulumix.Output[string] { + value := pulumix.Apply[Mkdir](o, func(v Mkdir) pulumix.Output[string] { return v.Stderr }) + return pulumix.Flatten[string, pulumix.Output[string]](value) +} + +func (o MkdirOutput) Stdout() pulumix.Output[string] { + value := pulumix.Apply[Mkdir](o, func(v Mkdir) pulumix.Output[string] { return v.Stdout }) + return pulumix.Flatten[string, pulumix.Output[string]](value) +} + +func init() { + pulumi.RegisterOutputType(MkdirOutput{}) +} diff --git a/sdk/go/baremetal/x/cmd/mktemp.go b/sdk/go/baremetal/x/cmd/mktemp.go new file mode 100644 index 00000000..f8363aa0 --- /dev/null +++ b/sdk/go/baremetal/x/cmd/mktemp.go @@ -0,0 +1,151 @@ +// 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 Mktemp struct { + pulumi.CustomResourceState + + Args pulumix.GPtrOutput[MktempArgsType, MktempArgsTypeOutput] `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"` +} + +// NewMktemp registers a new resource with the given unique name, arguments, and options. +func NewMktemp(ctx *pulumi.Context, + name string, args *MktempArgs, opts ...pulumi.ResourceOption) (*Mktemp, error) { + if args == nil { + args = &MktempArgs{} + } + + opts = internal.PkgResourceDefaultOpts(opts) + var resource Mktemp + err := ctx.RegisterResource("baremetal:cmd:Mktemp", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetMktemp gets an existing Mktemp 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 GetMktemp(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *MktempState, opts ...pulumi.ResourceOption) (*Mktemp, error) { + var resource Mktemp + err := ctx.ReadResource("baremetal:cmd:Mktemp", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Mktemp resources. +type mktempState struct { +} + +type MktempState struct { +} + +func (MktempState) ElementType() reflect.Type { + return reflect.TypeOf((*mktempState)(nil)).Elem() +} + +type mktempArgs struct { + Directory *bool `pulumi:"directory"` + DryRun *bool `pulumi:"dryRun"` + Help *bool `pulumi:"help"` + P *string `pulumi:"p"` + Quiet *bool `pulumi:"quiet"` + Suffix *string `pulumi:"suffix"` + T *bool `pulumi:"t"` + Template *string `pulumi:"template"` + Tmpdir *bool `pulumi:"tmpdir"` + Version *bool `pulumi:"version"` +} + +// The set of arguments for constructing a Mktemp resource. +type MktempArgs struct { + Directory pulumix.Input[*bool] + DryRun pulumix.Input[*bool] + Help pulumix.Input[*bool] + P pulumix.Input[*string] + Quiet pulumix.Input[*bool] + Suffix pulumix.Input[*string] + T pulumix.Input[*bool] + Template pulumix.Input[*string] + Tmpdir pulumix.Input[*bool] + Version pulumix.Input[*bool] +} + +func (MktempArgs) ElementType() reflect.Type { + return reflect.TypeOf((*mktempArgs)(nil)).Elem() +} + +type MktempOutput struct{ *pulumi.OutputState } + +func (MktempOutput) ElementType() reflect.Type { + return reflect.TypeOf((*Mktemp)(nil)).Elem() +} + +func (o MktempOutput) ToMktempOutput() MktempOutput { + return o +} + +func (o MktempOutput) ToMktempOutputWithContext(ctx context.Context) MktempOutput { + return o +} + +func (o MktempOutput) ToOutput(ctx context.Context) pulumix.Output[Mktemp] { + return pulumix.Output[Mktemp]{ + OutputState: o.OutputState, + } +} + +func (o MktempOutput) Args() pulumix.GPtrOutput[MktempArgsType, MktempArgsTypeOutput] { + value := pulumix.Apply[Mktemp](o, func(v Mktemp) pulumix.GPtrOutput[MktempArgsType, MktempArgsTypeOutput] { return v.Args }) + unwrapped := pulumix.Flatten[*MktempArgsType, pulumix.GPtrOutput[MktempArgsType, MktempArgsTypeOutput]](value) + return pulumix.GPtrOutput[MktempArgsType, MktempArgsTypeOutput]{OutputState: unwrapped.OutputState} +} + +func (o MktempOutput) CreatedFiles() pulumix.ArrayOutput[string] { + value := pulumix.Apply[Mktemp](o, func(v Mktemp) pulumix.ArrayOutput[string] { return v.CreatedFiles }) + unwrapped := pulumix.Flatten[[]string, pulumix.ArrayOutput[string]](value) + return pulumix.ArrayOutput[string]{OutputState: unwrapped.OutputState} +} + +func (o MktempOutput) ExitCode() pulumix.Output[int] { + value := pulumix.Apply[Mktemp](o, func(v Mktemp) pulumix.Output[int] { return v.ExitCode }) + return pulumix.Flatten[int, pulumix.Output[int]](value) +} + +func (o MktempOutput) MovedFiles() pulumix.MapOutput[string] { + value := pulumix.Apply[Mktemp](o, func(v Mktemp) 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 MktempOutput) Stderr() pulumix.Output[string] { + value := pulumix.Apply[Mktemp](o, func(v Mktemp) pulumix.Output[string] { return v.Stderr }) + return pulumix.Flatten[string, pulumix.Output[string]](value) +} + +func (o MktempOutput) Stdout() pulumix.Output[string] { + value := pulumix.Apply[Mktemp](o, func(v Mktemp) pulumix.Output[string] { return v.Stdout }) + return pulumix.Flatten[string, pulumix.Output[string]](value) +} + +func init() { + pulumi.RegisterOutputType(MktempOutput{}) +} diff --git a/sdk/go/baremetal/x/cmd/pulumiTypes.go b/sdk/go/baremetal/x/cmd/pulumiTypes.go index 3a4df42d..0ee019d6 100644 --- a/sdk/go/baremetal/x/cmd/pulumiTypes.go +++ b/sdk/go/baremetal/x/cmd/pulumiTypes.go @@ -14,6 +14,133 @@ import ( var _ = internal.GetEnvOrDefault +type MkdirArgsType struct { + Directory []string `pulumi:"directory"` + Help *bool `pulumi:"help"` + Mode *string `pulumi:"mode"` + Parents *bool `pulumi:"parents"` + Verbose *bool `pulumi:"verbose"` + Version *bool `pulumi:"version"` +} + +type MkdirArgsTypeOutput struct{ *pulumi.OutputState } + +func (MkdirArgsTypeOutput) ElementType() reflect.Type { + return reflect.TypeOf((*MkdirArgsType)(nil)).Elem() +} + +func (o MkdirArgsTypeOutput) ToMkdirArgsTypeOutput() MkdirArgsTypeOutput { + return o +} + +func (o MkdirArgsTypeOutput) ToMkdirArgsTypeOutputWithContext(ctx context.Context) MkdirArgsTypeOutput { + return o +} + +func (o MkdirArgsTypeOutput) ToOutput(ctx context.Context) pulumix.Output[MkdirArgsType] { + return pulumix.Output[MkdirArgsType]{ + OutputState: o.OutputState, + } +} + +func (o MkdirArgsTypeOutput) Directory() pulumix.ArrayOutput[string] { + value := pulumix.Apply[MkdirArgsType](o, func(v MkdirArgsType) []string { return v.Directory }) + return pulumix.ArrayOutput[string]{OutputState: value.OutputState} +} + +func (o MkdirArgsTypeOutput) Help() pulumix.Output[*bool] { + return pulumix.Apply[MkdirArgsType](o, func(v MkdirArgsType) *bool { return v.Help }) +} + +func (o MkdirArgsTypeOutput) Mode() pulumix.Output[*string] { + return pulumix.Apply[MkdirArgsType](o, func(v MkdirArgsType) *string { return v.Mode }) +} + +func (o MkdirArgsTypeOutput) Parents() pulumix.Output[*bool] { + return pulumix.Apply[MkdirArgsType](o, func(v MkdirArgsType) *bool { return v.Parents }) +} + +func (o MkdirArgsTypeOutput) Verbose() pulumix.Output[*bool] { + return pulumix.Apply[MkdirArgsType](o, func(v MkdirArgsType) *bool { return v.Verbose }) +} + +func (o MkdirArgsTypeOutput) Version() pulumix.Output[*bool] { + return pulumix.Apply[MkdirArgsType](o, func(v MkdirArgsType) *bool { return v.Version }) +} + +type MktempArgsType struct { + Directory *bool `pulumi:"directory"` + DryRun *bool `pulumi:"dryRun"` + Help *bool `pulumi:"help"` + P *string `pulumi:"p"` + Quiet *bool `pulumi:"quiet"` + Suffix *string `pulumi:"suffix"` + T *bool `pulumi:"t"` + Template *string `pulumi:"template"` + Tmpdir *bool `pulumi:"tmpdir"` + Version *bool `pulumi:"version"` +} + +type MktempArgsTypeOutput struct{ *pulumi.OutputState } + +func (MktempArgsTypeOutput) ElementType() reflect.Type { + return reflect.TypeOf((*MktempArgsType)(nil)).Elem() +} + +func (o MktempArgsTypeOutput) ToMktempArgsTypeOutput() MktempArgsTypeOutput { + return o +} + +func (o MktempArgsTypeOutput) ToMktempArgsTypeOutputWithContext(ctx context.Context) MktempArgsTypeOutput { + return o +} + +func (o MktempArgsTypeOutput) ToOutput(ctx context.Context) pulumix.Output[MktempArgsType] { + return pulumix.Output[MktempArgsType]{ + OutputState: o.OutputState, + } +} + +func (o MktempArgsTypeOutput) Directory() pulumix.Output[*bool] { + return pulumix.Apply[MktempArgsType](o, func(v MktempArgsType) *bool { return v.Directory }) +} + +func (o MktempArgsTypeOutput) DryRun() pulumix.Output[*bool] { + return pulumix.Apply[MktempArgsType](o, func(v MktempArgsType) *bool { return v.DryRun }) +} + +func (o MktempArgsTypeOutput) Help() pulumix.Output[*bool] { + return pulumix.Apply[MktempArgsType](o, func(v MktempArgsType) *bool { return v.Help }) +} + +func (o MktempArgsTypeOutput) P() pulumix.Output[*string] { + return pulumix.Apply[MktempArgsType](o, func(v MktempArgsType) *string { return v.P }) +} + +func (o MktempArgsTypeOutput) Quiet() pulumix.Output[*bool] { + return pulumix.Apply[MktempArgsType](o, func(v MktempArgsType) *bool { return v.Quiet }) +} + +func (o MktempArgsTypeOutput) Suffix() pulumix.Output[*string] { + return pulumix.Apply[MktempArgsType](o, func(v MktempArgsType) *string { return v.Suffix }) +} + +func (o MktempArgsTypeOutput) T() pulumix.Output[*bool] { + return pulumix.Apply[MktempArgsType](o, func(v MktempArgsType) *bool { return v.T }) +} + +func (o MktempArgsTypeOutput) Template() pulumix.Output[*string] { + return pulumix.Apply[MktempArgsType](o, func(v MktempArgsType) *string { return v.Template }) +} + +func (o MktempArgsTypeOutput) Tmpdir() pulumix.Output[*bool] { + return pulumix.Apply[MktempArgsType](o, func(v MktempArgsType) *bool { return v.Tmpdir }) +} + +func (o MktempArgsTypeOutput) Version() pulumix.Output[*bool] { + return pulumix.Apply[MktempArgsType](o, func(v MktempArgsType) *bool { return v.Version }) +} + type MvArgsType struct { Backup *string `pulumi:"backup"` Destination *string `pulumi:"destination"` @@ -681,6 +808,8 @@ func (o WgetArgsTypeOutput) Wait() pulumix.Output[*string] { } func init() { + pulumi.RegisterOutputType(MkdirArgsTypeOutput{}) + pulumi.RegisterOutputType(MktempArgsTypeOutput{}) pulumi.RegisterOutputType(MvArgsTypeOutput{}) pulumi.RegisterOutputType(RmArgsTypeOutput{}) pulumi.RegisterOutputType(TarArgsTypeOutput{}) diff --git a/sdk/nodejs/cmd/index.ts b/sdk/nodejs/cmd/index.ts index fcecfbd1..6e8d4c14 100644 --- a/sdk/nodejs/cmd/index.ts +++ b/sdk/nodejs/cmd/index.ts @@ -5,6 +5,16 @@ import * as pulumi from "@pulumi/pulumi"; import * as utilities from "../utilities"; // Export members: +export { MkdirArgs } from "./mkdir"; +export type Mkdir = import("./mkdir").Mkdir; +export const Mkdir: typeof import("./mkdir").Mkdir = null as any; +utilities.lazyLoad(exports, ["Mkdir"], () => require("./mkdir")); + +export { MktempArgs } from "./mktemp"; +export type Mktemp = import("./mktemp").Mktemp; +export const Mktemp: typeof import("./mktemp").Mktemp = null as any; +utilities.lazyLoad(exports, ["Mktemp"], () => require("./mktemp")); + export { MvArgs } from "./mv"; export type Mv = import("./mv").Mv; export const Mv: typeof import("./mv").Mv = null as any; @@ -35,6 +45,10 @@ const _module = { version: utilities.getVersion(), construct: (name: string, type: string, urn: string): pulumi.Resource => { switch (type) { + case "baremetal:cmd:Mkdir": + return new Mkdir(name, undefined, { urn }) + case "baremetal:cmd:Mktemp": + return new Mktemp(name, undefined, { urn }) case "baremetal:cmd:Mv": return new Mv(name, undefined, { urn }) case "baremetal:cmd:Rm": diff --git a/sdk/nodejs/cmd/mkdir.ts b/sdk/nodejs/cmd/mkdir.ts new file mode 100644 index 00000000..f4bd1632 --- /dev/null +++ b/sdk/nodejs/cmd/mkdir.ts @@ -0,0 +1,92 @@ +// *** 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 Mkdir extends pulumi.CustomResource { + /** + * Get an existing Mkdir 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): Mkdir { + return new Mkdir(name, undefined as any, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'baremetal:cmd:Mkdir'; + + /** + * Returns true if the given object is an instance of Mkdir. 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 Mkdir { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === Mkdir.__pulumiType; + } + + public /*out*/ 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 Mkdir 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: MkdirArgs, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (!opts.id) { + if ((!args || args.directory === undefined) && !opts.urn) { + throw new Error("Missing required property 'directory'"); + } + resourceInputs["directory"] = args ? args.directory : undefined; + resourceInputs["help"] = args ? args.help : undefined; + resourceInputs["mode"] = args ? args.mode : undefined; + resourceInputs["parents"] = args ? args.parents : undefined; + resourceInputs["verbose"] = args ? args.verbose : undefined; + resourceInputs["version"] = args ? args.version : undefined; + resourceInputs["args"] = undefined /*out*/; + 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(Mkdir.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * The set of arguments for constructing a Mkdir resource. + */ +export interface MkdirArgs { + directory: pulumi.Input[]>; + help?: pulumi.Input; + mode?: pulumi.Input; + parents?: pulumi.Input; + verbose?: pulumi.Input; + version?: pulumi.Input; +} diff --git a/sdk/nodejs/cmd/mktemp.ts b/sdk/nodejs/cmd/mktemp.ts new file mode 100644 index 00000000..63fabc88 --- /dev/null +++ b/sdk/nodejs/cmd/mktemp.ts @@ -0,0 +1,97 @@ +// *** 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 Mktemp extends pulumi.CustomResource { + /** + * Get an existing Mktemp 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): Mktemp { + return new Mktemp(name, undefined as any, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'baremetal:cmd:Mktemp'; + + /** + * Returns true if the given object is an instance of Mktemp. 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 Mktemp { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === Mktemp.__pulumiType; + } + + public /*out*/ 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 Mktemp 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?: MktempArgs, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (!opts.id) { + resourceInputs["directory"] = args ? args.directory : undefined; + resourceInputs["dryRun"] = args ? args.dryRun : undefined; + resourceInputs["help"] = args ? args.help : undefined; + resourceInputs["p"] = args ? args.p : undefined; + resourceInputs["quiet"] = args ? args.quiet : undefined; + resourceInputs["suffix"] = args ? args.suffix : undefined; + resourceInputs["t"] = args ? args.t : undefined; + resourceInputs["template"] = args ? args.template : undefined; + resourceInputs["tmpdir"] = args ? args.tmpdir : undefined; + resourceInputs["version"] = args ? args.version : undefined; + resourceInputs["args"] = undefined /*out*/; + 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(Mktemp.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * The set of arguments for constructing a Mktemp resource. + */ +export interface MktempArgs { + directory?: pulumi.Input; + dryRun?: pulumi.Input; + help?: pulumi.Input; + p?: pulumi.Input; + quiet?: pulumi.Input; + suffix?: pulumi.Input; + t?: pulumi.Input; + template?: pulumi.Input; + tmpdir?: pulumi.Input; + version?: pulumi.Input; +} diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 969e4748..6fd28efa 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -14,6 +14,8 @@ }, "files": [ "cmd/index.ts", + "cmd/mkdir.ts", + "cmd/mktemp.ts", "cmd/mv.ts", "cmd/rm.ts", "cmd/tar.ts", diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index ad1616a0..329e7691 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -6,6 +6,28 @@ import * as inputs from "../types/input"; import * as outputs from "../types/output"; export namespace cmd { + export interface MkdirArgs { + directory: string[]; + help?: boolean; + mode?: string; + parents?: boolean; + verbose?: boolean; + version?: boolean; + } + + export interface MktempArgs { + directory?: boolean; + dryRun?: boolean; + help?: boolean; + p?: string; + quiet?: boolean; + suffix?: string; + t?: boolean; + template?: string; + tmpdir?: boolean; + version?: boolean; + } + export interface MvArgs { backup?: string; destination?: string; diff --git a/sdk/python/unmango_baremetal/__init__.py b/sdk/python/unmango_baremetal/__init__.py index e4073ef3..1fd95246 100644 --- a/sdk/python/unmango_baremetal/__init__.py +++ b/sdk/python/unmango_baremetal/__init__.py @@ -25,6 +25,8 @@ "mod": "cmd", "fqn": "unmango_baremetal.cmd", "classes": { + "baremetal:cmd:Mkdir": "Mkdir", + "baremetal:cmd:Mktemp": "Mktemp", "baremetal:cmd:Mv": "Mv", "baremetal:cmd:Rm": "Rm", "baremetal:cmd:Tar": "Tar", diff --git a/sdk/python/unmango_baremetal/cmd/__init__.py b/sdk/python/unmango_baremetal/cmd/__init__.py index f780e1d2..33ddebfa 100644 --- a/sdk/python/unmango_baremetal/cmd/__init__.py +++ b/sdk/python/unmango_baremetal/cmd/__init__.py @@ -5,6 +5,8 @@ from .. import _utilities import typing # Export this package's modules as members: +from .mkdir import * +from .mktemp import * from .mv import * from .rm import * from .tar import * diff --git a/sdk/python/unmango_baremetal/cmd/mkdir.py b/sdk/python/unmango_baremetal/cmd/mkdir.py new file mode 100644 index 00000000..561393c1 --- /dev/null +++ b/sdk/python/unmango_baremetal/cmd/mkdir.py @@ -0,0 +1,222 @@ +# 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__ = ['MkdirArgs', 'Mkdir'] + +@pulumi.input_type +class MkdirArgs: + def __init__(__self__, *, + directory: pulumi.Input[Sequence[pulumi.Input[str]]], + help: Optional[pulumi.Input[bool]] = None, + mode: Optional[pulumi.Input[str]] = None, + parents: Optional[pulumi.Input[bool]] = None, + verbose: Optional[pulumi.Input[bool]] = None, + version: Optional[pulumi.Input[bool]] = None): + """ + The set of arguments for constructing a Mkdir resource. + """ + pulumi.set(__self__, "directory", directory) + if help is not None: + pulumi.set(__self__, "help", help) + if mode is not None: + pulumi.set(__self__, "mode", mode) + if parents is not None: + pulumi.set(__self__, "parents", parents) + if verbose is not None: + pulumi.set(__self__, "verbose", verbose) + if version is not None: + pulumi.set(__self__, "version", version) + + @property + @pulumi.getter + def directory(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]: + return pulumi.get(self, "directory") + + @directory.setter + def directory(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]): + pulumi.set(self, "directory", value) + + @property + @pulumi.getter + def help(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "help") + + @help.setter + def help(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "help", value) + + @property + @pulumi.getter + def mode(self) -> Optional[pulumi.Input[str]]: + return pulumi.get(self, "mode") + + @mode.setter + def mode(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "mode", value) + + @property + @pulumi.getter + def parents(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "parents") + + @parents.setter + def parents(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "parents", 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 version(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "version") + + @version.setter + def version(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "version", value) + + +class Mkdir(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + directory: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + help: Optional[pulumi.Input[bool]] = None, + mode: Optional[pulumi.Input[str]] = None, + parents: Optional[pulumi.Input[bool]] = None, + verbose: Optional[pulumi.Input[bool]] = None, + version: Optional[pulumi.Input[bool]] = None, + __props__=None): + """ + Create a Mkdir 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: MkdirArgs, + opts: Optional[pulumi.ResourceOptions] = None): + """ + Create a Mkdir resource with the given unique name, props, and options. + :param str resource_name: The name of the resource. + :param MkdirArgs 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(MkdirArgs, 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, + directory: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + help: Optional[pulumi.Input[bool]] = None, + mode: Optional[pulumi.Input[str]] = None, + parents: Optional[pulumi.Input[bool]] = None, + verbose: Optional[pulumi.Input[bool]] = None, + version: 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__ = MkdirArgs.__new__(MkdirArgs) + + if directory is None and not opts.urn: + raise TypeError("Missing required property 'directory'") + __props__.__dict__["directory"] = directory + __props__.__dict__["help"] = help + __props__.__dict__["mode"] = mode + __props__.__dict__["parents"] = parents + __props__.__dict__["verbose"] = verbose + __props__.__dict__["version"] = version + __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 + super(Mkdir, __self__).__init__( + 'baremetal:cmd:Mkdir', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None) -> 'Mkdir': + """ + Get an existing Mkdir 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__ = MkdirArgs.__new__(MkdirArgs) + + __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 Mkdir(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter + def args(self) -> pulumi.Output['outputs.MkdirArgs']: + 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/sdk/python/unmango_baremetal/cmd/mktemp.py b/sdk/python/unmango_baremetal/cmd/mktemp.py new file mode 100644 index 00000000..6418b094 --- /dev/null +++ b/sdk/python/unmango_baremetal/cmd/mktemp.py @@ -0,0 +1,281 @@ +# 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__ = ['MktempArgs', 'Mktemp'] + +@pulumi.input_type +class MktempArgs: + def __init__(__self__, *, + directory: Optional[pulumi.Input[bool]] = None, + dry_run: Optional[pulumi.Input[bool]] = None, + help: Optional[pulumi.Input[bool]] = None, + p: Optional[pulumi.Input[str]] = None, + quiet: Optional[pulumi.Input[bool]] = None, + suffix: Optional[pulumi.Input[str]] = None, + t: Optional[pulumi.Input[bool]] = None, + template: Optional[pulumi.Input[str]] = None, + tmpdir: Optional[pulumi.Input[bool]] = None, + version: Optional[pulumi.Input[bool]] = None): + """ + The set of arguments for constructing a Mktemp resource. + """ + if directory is not None: + pulumi.set(__self__, "directory", directory) + if dry_run is not None: + pulumi.set(__self__, "dry_run", dry_run) + if help is not None: + pulumi.set(__self__, "help", help) + if p is not None: + pulumi.set(__self__, "p", p) + if quiet is not None: + pulumi.set(__self__, "quiet", quiet) + if suffix is not None: + pulumi.set(__self__, "suffix", suffix) + if t is not None: + pulumi.set(__self__, "t", t) + if template is not None: + pulumi.set(__self__, "template", template) + if tmpdir is not None: + pulumi.set(__self__, "tmpdir", tmpdir) + if version is not None: + pulumi.set(__self__, "version", version) + + @property + @pulumi.getter + def directory(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "directory") + + @directory.setter + def directory(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "directory", value) + + @property + @pulumi.getter(name="dryRun") + def dry_run(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "dry_run") + + @dry_run.setter + def dry_run(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "dry_run", value) + + @property + @pulumi.getter + def help(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "help") + + @help.setter + def help(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "help", value) + + @property + @pulumi.getter + def p(self) -> Optional[pulumi.Input[str]]: + return pulumi.get(self, "p") + + @p.setter + def p(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "p", value) + + @property + @pulumi.getter + def quiet(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "quiet") + + @quiet.setter + def quiet(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "quiet", 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 + def t(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "t") + + @t.setter + def t(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "t", value) + + @property + @pulumi.getter + def template(self) -> Optional[pulumi.Input[str]]: + return pulumi.get(self, "template") + + @template.setter + def template(self, value: Optional[pulumi.Input[str]]): + pulumi.set(self, "template", value) + + @property + @pulumi.getter + def tmpdir(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "tmpdir") + + @tmpdir.setter + def tmpdir(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "tmpdir", value) + + @property + @pulumi.getter + def version(self) -> Optional[pulumi.Input[bool]]: + return pulumi.get(self, "version") + + @version.setter + def version(self, value: Optional[pulumi.Input[bool]]): + pulumi.set(self, "version", value) + + +class Mktemp(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + directory: Optional[pulumi.Input[bool]] = None, + dry_run: Optional[pulumi.Input[bool]] = None, + help: Optional[pulumi.Input[bool]] = None, + p: Optional[pulumi.Input[str]] = None, + quiet: Optional[pulumi.Input[bool]] = None, + suffix: Optional[pulumi.Input[str]] = None, + t: Optional[pulumi.Input[bool]] = None, + template: Optional[pulumi.Input[str]] = None, + tmpdir: Optional[pulumi.Input[bool]] = None, + version: Optional[pulumi.Input[bool]] = None, + __props__=None): + """ + Create a Mktemp 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[MktempArgs] = None, + opts: Optional[pulumi.ResourceOptions] = None): + """ + Create a Mktemp resource with the given unique name, props, and options. + :param str resource_name: The name of the resource. + :param MktempArgs 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(MktempArgs, 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, + directory: Optional[pulumi.Input[bool]] = None, + dry_run: Optional[pulumi.Input[bool]] = None, + help: Optional[pulumi.Input[bool]] = None, + p: Optional[pulumi.Input[str]] = None, + quiet: Optional[pulumi.Input[bool]] = None, + suffix: Optional[pulumi.Input[str]] = None, + t: Optional[pulumi.Input[bool]] = None, + template: Optional[pulumi.Input[str]] = None, + tmpdir: Optional[pulumi.Input[bool]] = None, + version: 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__ = MktempArgs.__new__(MktempArgs) + + __props__.__dict__["directory"] = directory + __props__.__dict__["dry_run"] = dry_run + __props__.__dict__["help"] = help + __props__.__dict__["p"] = p + __props__.__dict__["quiet"] = quiet + __props__.__dict__["suffix"] = suffix + __props__.__dict__["t"] = t + __props__.__dict__["template"] = template + __props__.__dict__["tmpdir"] = tmpdir + __props__.__dict__["version"] = version + __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 + super(Mktemp, __self__).__init__( + 'baremetal:cmd:Mktemp', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None) -> 'Mktemp': + """ + Get an existing Mktemp 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__ = MktempArgs.__new__(MktempArgs) + + __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 Mktemp(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter + def args(self) -> pulumi.Output['outputs.MktempArgs']: + 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/sdk/python/unmango_baremetal/cmd/outputs.py b/sdk/python/unmango_baremetal/cmd/outputs.py index 045465b0..7920b43e 100644 --- a/sdk/python/unmango_baremetal/cmd/outputs.py +++ b/sdk/python/unmango_baremetal/cmd/outputs.py @@ -10,6 +10,8 @@ from .. import _utilities __all__ = [ + 'MkdirArgs', + 'MktempArgs', 'MvArgs', 'RmArgs', 'TarArgs', @@ -17,6 +19,160 @@ 'WgetArgs', ] +@pulumi.output_type +class MkdirArgs(dict): + def __init__(__self__, *, + directory: Sequence[str], + help: Optional[bool] = None, + mode: Optional[str] = None, + parents: Optional[bool] = None, + verbose: Optional[bool] = None, + version: Optional[bool] = None): + pulumi.set(__self__, "directory", directory) + if help is not None: + pulumi.set(__self__, "help", help) + if mode is not None: + pulumi.set(__self__, "mode", mode) + if parents is not None: + pulumi.set(__self__, "parents", parents) + if verbose is not None: + pulumi.set(__self__, "verbose", verbose) + if version is not None: + pulumi.set(__self__, "version", version) + + @property + @pulumi.getter + def directory(self) -> Sequence[str]: + return pulumi.get(self, "directory") + + @property + @pulumi.getter + def help(self) -> Optional[bool]: + return pulumi.get(self, "help") + + @property + @pulumi.getter + def mode(self) -> Optional[str]: + return pulumi.get(self, "mode") + + @property + @pulumi.getter + def parents(self) -> Optional[bool]: + return pulumi.get(self, "parents") + + @property + @pulumi.getter + def verbose(self) -> Optional[bool]: + return pulumi.get(self, "verbose") + + @property + @pulumi.getter + def version(self) -> Optional[bool]: + return pulumi.get(self, "version") + + +@pulumi.output_type +class MktempArgs(dict): + @staticmethod + def __key_warning(key: str): + suggest = None + if key == "dryRun": + suggest = "dry_run" + + if suggest: + pulumi.log.warn(f"Key '{key}' not found in MktempArgs. Access the value via the '{suggest}' property getter instead.") + + def __getitem__(self, key: str) -> Any: + MktempArgs.__key_warning(key) + return super().__getitem__(key) + + def get(self, key: str, default = None) -> Any: + MktempArgs.__key_warning(key) + return super().get(key, default) + + def __init__(__self__, *, + directory: Optional[bool] = None, + dry_run: Optional[bool] = None, + help: Optional[bool] = None, + p: Optional[str] = None, + quiet: Optional[bool] = None, + suffix: Optional[str] = None, + t: Optional[bool] = None, + template: Optional[str] = None, + tmpdir: Optional[bool] = None, + version: Optional[bool] = None): + if directory is not None: + pulumi.set(__self__, "directory", directory) + if dry_run is not None: + pulumi.set(__self__, "dry_run", dry_run) + if help is not None: + pulumi.set(__self__, "help", help) + if p is not None: + pulumi.set(__self__, "p", p) + if quiet is not None: + pulumi.set(__self__, "quiet", quiet) + if suffix is not None: + pulumi.set(__self__, "suffix", suffix) + if t is not None: + pulumi.set(__self__, "t", t) + if template is not None: + pulumi.set(__self__, "template", template) + if tmpdir is not None: + pulumi.set(__self__, "tmpdir", tmpdir) + if version is not None: + pulumi.set(__self__, "version", version) + + @property + @pulumi.getter + def directory(self) -> Optional[bool]: + return pulumi.get(self, "directory") + + @property + @pulumi.getter(name="dryRun") + def dry_run(self) -> Optional[bool]: + return pulumi.get(self, "dry_run") + + @property + @pulumi.getter + def help(self) -> Optional[bool]: + return pulumi.get(self, "help") + + @property + @pulumi.getter + def p(self) -> Optional[str]: + return pulumi.get(self, "p") + + @property + @pulumi.getter + def quiet(self) -> Optional[bool]: + return pulumi.get(self, "quiet") + + @property + @pulumi.getter + def suffix(self) -> Optional[str]: + return pulumi.get(self, "suffix") + + @property + @pulumi.getter + def t(self) -> Optional[bool]: + return pulumi.get(self, "t") + + @property + @pulumi.getter + def template(self) -> Optional[str]: + return pulumi.get(self, "template") + + @property + @pulumi.getter + def tmpdir(self) -> Optional[bool]: + return pulumi.get(self, "tmpdir") + + @property + @pulumi.getter + def version(self) -> Optional[bool]: + return pulumi.get(self, "version") + + @pulumi.output_type class MvArgs(dict): @staticmethod diff --git a/tests/lifecycle_test.go b/tests/lifecycle_test.go index 4f7132a9..aceb9235 100644 --- a/tests/lifecycle_test.go +++ b/tests/lifecycle_test.go @@ -104,6 +104,71 @@ var _ = Describe("Command Resources", func() { }) }) + Describe("Mkdir", Ordered, func() { + expectedDir := containerPath("mkdir-test") + + test := integration.LifeCycleTest{ + Resource: "baremetal:cmd:Mkdir", + Create: integration.Operation{ + Inputs: resource.NewPropertyMapFromMap(map[string]interface{}{ + "directory": []string{expectedDir}, + }), + Hook: func(inputs, output resource.PropertyMap) { + Expect(output["stderr"]).To(HavePropertyValue("")) + }, + ExpectedOutput: resource.NewPropertyMapFromMap(map[string]interface{}{ + "exitCode": 0, + "stdout": "", + "stderr": "", + "createdFiles": []string{}, + "movedFiles": map[string]string{}, + "args": map[string]interface{}{ + "directory": []string{expectedDir}, + + // Defaults + "mode": "", + "parents": false, + "help": false, + "version": false, + "verbose": false, + }, + }), + }, + } + + It("should complete a full lifecycle", func(ctx context.Context) { + run(server, test) + + _, err := provisioner.Exec(ctx, "touch", "blah") + Expect(err).NotTo(HaveOccurred()) + }) + }) + + Describe("Mktemp", Ordered, func() { + test := integration.LifeCycleTest{ + Resource: "baremetal:cmd:Mktemp", + Create: integration.Operation{ + Inputs: resource.NewPropertyMapFromMap(map[string]interface{}{ + "tmpdir": true, + }), + Hook: func(inputs, output resource.PropertyMap) { + Expect(output["stderr"]).To(HavePropertyValue("")) + Expect(output["stdout"].V).NotTo(BeEmpty()) + Expect(output["exitCode"].V).To(BeEquivalentTo(0)) + Expect(output["createdFiles"].V).To(BeEmpty()) + Expect(output["movedFiles"].V).To(BeEmpty()) + }, + }, + } + + It("should complete a full lifecycle", func(ctx context.Context) { + run(server, test) + + _, err := provisioner.Exec(ctx, "touch", "blah") + Expect(err).NotTo(HaveOccurred()) + }) + }) + Describe("Rm", Ordered, func() { file := containerPath("rm.txt")