From 4b772200c235bb2328c36692dfe3dbd0efc509f7 Mon Sep 17 00:00:00 2001 From: Erik Rasmussen Date: Sun, 11 Aug 2024 17:42:47 -0500 Subject: [PATCH] Add a basic passthrough kubeadm resource (#113) * Stub out all the files * Dead simple kubeadm component --- provider/pkg/provider/kubeadm/kubeadm.go | 40 ++++ provider/provider.go | 2 + sdk/dotnet/Kubeadm/Inputs/KubeadmArgsArgs.cs | 29 +++ sdk/dotnet/Kubeadm/Kubeadm.cs | 121 ++++++++++ sdk/dotnet/Kubeadm/Outputs/KubeadmArgs.cs | 25 +++ sdk/dotnet/Kubeadm/README.md | 0 sdk/go/baremetal/kubeadm/init.go | 44 ++++ sdk/go/baremetal/kubeadm/kubeadm.go | 175 +++++++++++++++ sdk/go/baremetal/kubeadm/pulumiTypes.go | 81 +++++++ sdk/go/baremetal/x/kubeadm/init.go | 44 ++++ sdk/go/baremetal/x/kubeadm/kubeadm.go | 164 ++++++++++++++ sdk/go/baremetal/x/kubeadm/pulumiTypes.go | 68 ++++++ sdk/nodejs/index.ts | 2 + sdk/nodejs/kubeadm/index.ts | 25 +++ sdk/nodejs/kubeadm/kubeadm.ts | 93 ++++++++ sdk/nodejs/tsconfig.json | 2 + sdk/nodejs/types/input.ts | 6 + sdk/nodejs/types/output.ts | 7 + sdk/python/unmango_baremetal/__init__.py | 11 + .../unmango_baremetal/kubeadm/__init__.py | 10 + .../unmango_baremetal/kubeadm/_inputs.py | 31 +++ .../unmango_baremetal/kubeadm/kubeadm.py | 210 ++++++++++++++++++ .../unmango_baremetal/kubeadm/outputs.py | 27 +++ 23 files changed, 1217 insertions(+) create mode 100644 provider/pkg/provider/kubeadm/kubeadm.go create mode 100644 sdk/dotnet/Kubeadm/Inputs/KubeadmArgsArgs.cs create mode 100644 sdk/dotnet/Kubeadm/Kubeadm.cs create mode 100644 sdk/dotnet/Kubeadm/Outputs/KubeadmArgs.cs create mode 100644 sdk/dotnet/Kubeadm/README.md create mode 100644 sdk/go/baremetal/kubeadm/init.go create mode 100644 sdk/go/baremetal/kubeadm/kubeadm.go create mode 100644 sdk/go/baremetal/kubeadm/pulumiTypes.go create mode 100644 sdk/go/baremetal/x/kubeadm/init.go create mode 100644 sdk/go/baremetal/x/kubeadm/kubeadm.go create mode 100644 sdk/go/baremetal/x/kubeadm/pulumiTypes.go create mode 100644 sdk/nodejs/kubeadm/index.ts create mode 100644 sdk/nodejs/kubeadm/kubeadm.ts create mode 100644 sdk/python/unmango_baremetal/kubeadm/__init__.py create mode 100644 sdk/python/unmango_baremetal/kubeadm/_inputs.py create mode 100644 sdk/python/unmango_baremetal/kubeadm/kubeadm.py create mode 100644 sdk/python/unmango_baremetal/kubeadm/outputs.py diff --git a/provider/pkg/provider/kubeadm/kubeadm.go b/provider/pkg/provider/kubeadm/kubeadm.go new file mode 100644 index 00000000..5468418a --- /dev/null +++ b/provider/pkg/provider/kubeadm/kubeadm.go @@ -0,0 +1,40 @@ +package kubeadm + +import ( + "context" + "fmt" + + "github.com/pulumi/pulumi-go-provider/infer" + pb "github.com/unmango/pulumi-baremetal/gen/go/unmango/baremetal/v1alpha1" + "github.com/unmango/pulumi-baremetal/provider/pkg/provider/cmd" +) + +type KubeadmArgs struct { + cmd.ArgsBase + + Commands []string `pulumi:"commands"` +} + +func (a KubeadmArgs) Cmd() *pb.Command { + return Builder(func(b *cmd.B) { + for _, c := range a.Commands { + b.Arg(c) + } + }) +} + +type Kubeadm struct{} + +type KubeadmState = cmd.State[KubeadmArgs] + +// Create implements infer.CustomCreate. +func (Kubeadm) Create(ctx context.Context, name string, inputs cmd.CommandArgs[KubeadmArgs], preview bool) (string, KubeadmState, error) { + state := KubeadmState{} + if err := state.Create(ctx, inputs, preview); err != nil { + return name, state, fmt.Errorf("kubeadm: %w", err) + } + + return name, state, nil +} + +var _ = (infer.CustomCreate[cmd.CommandArgs[KubeadmArgs], KubeadmState])((*Kubeadm)(nil)) diff --git a/provider/provider.go b/provider/provider.go index 1126fe2e..961fcd65 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -7,6 +7,7 @@ import ( "github.com/pulumi/pulumi/sdk/v3/go/common/tokens" "github.com/unmango/pulumi-baremetal/provider/pkg/provider" "github.com/unmango/pulumi-baremetal/provider/pkg/provider/coreutils" + "github.com/unmango/pulumi-baremetal/provider/pkg/provider/kubeadm" ) const Name string = "baremetal" @@ -51,6 +52,7 @@ func Provider() p.Provider { infer.Resource[coreutils.Mv](), infer.Resource[coreutils.Rm](), infer.Resource[coreutils.Tee](), + infer.Resource[kubeadm.Kubeadm](), }, Components: []infer.InferredComponent{ // Consuming external resources is no bueno atm diff --git a/sdk/dotnet/Kubeadm/Inputs/KubeadmArgsArgs.cs b/sdk/dotnet/Kubeadm/Inputs/KubeadmArgsArgs.cs new file mode 100644 index 00000000..34f86f5d --- /dev/null +++ b/sdk/dotnet/Kubeadm/Inputs/KubeadmArgsArgs.cs @@ -0,0 +1,29 @@ +// *** 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.Kubeadm.Inputs +{ + + public sealed class KubeadmArgsArgs : global::Pulumi.ResourceArgs + { + [Input("commands", required: true)] + private InputList? _commands; + public InputList Commands + { + get => _commands ?? (_commands = new InputList()); + set => _commands = value; + } + + public KubeadmArgsArgs() + { + } + public static new KubeadmArgsArgs Empty => new KubeadmArgsArgs(); + } +} diff --git a/sdk/dotnet/Kubeadm/Kubeadm.cs b/sdk/dotnet/Kubeadm/Kubeadm.cs new file mode 100644 index 00000000..e46f3cc0 --- /dev/null +++ b/sdk/dotnet/Kubeadm/Kubeadm.cs @@ -0,0 +1,121 @@ +// *** 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.Kubeadm +{ + [BaremetalResourceType("baremetal:kubeadm:Kubeadm")] + public partial class Kubeadm : global::Pulumi.CustomResource + { + [Output("args")] + public Output Args { get; private set; } = null!; + + [Output("createdFiles")] + public Output> CreatedFiles { get; private set; } = null!; + + [Output("customDelete")] + public Output> CustomDelete { get; private set; } = null!; + + [Output("customUpdate")] + public Output> CustomUpdate { 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!; + + [Output("triggers")] + public Output> Triggers { get; private set; } = null!; + + + /// + /// Create a Kubeadm 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 Kubeadm(string name, KubeadmArgs args, CustomResourceOptions? options = null) + : base("baremetal:kubeadm:Kubeadm", name, args ?? new KubeadmArgs(), MakeResourceOptions(options, "")) + { + } + + private Kubeadm(string name, Input id, CustomResourceOptions? options = null) + : base("baremetal:kubeadm:Kubeadm", 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 Kubeadm 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 Kubeadm Get(string name, Input id, CustomResourceOptions? options = null) + { + return new Kubeadm(name, id, options); + } + } + + public sealed class KubeadmArgs : global::Pulumi.ResourceArgs + { + [Input("args", required: true)] + public Input Args { get; set; } = null!; + + [Input("customDelete")] + private InputList? _customDelete; + public InputList CustomDelete + { + get => _customDelete ?? (_customDelete = new InputList()); + set => _customDelete = value; + } + + [Input("customUpdate")] + private InputList? _customUpdate; + public InputList CustomUpdate + { + get => _customUpdate ?? (_customUpdate = new InputList()); + set => _customUpdate = value; + } + + [Input("triggers")] + private InputList? _triggers; + public InputList Triggers + { + get => _triggers ?? (_triggers = new InputList()); + set => _triggers = value; + } + + public KubeadmArgs() + { + } + public static new KubeadmArgs Empty => new KubeadmArgs(); + } +} diff --git a/sdk/dotnet/Kubeadm/Outputs/KubeadmArgs.cs b/sdk/dotnet/Kubeadm/Outputs/KubeadmArgs.cs new file mode 100644 index 00000000..04ce6e48 --- /dev/null +++ b/sdk/dotnet/Kubeadm/Outputs/KubeadmArgs.cs @@ -0,0 +1,25 @@ +// *** 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.Kubeadm.Outputs +{ + + [OutputType] + public sealed class KubeadmArgs + { + public readonly ImmutableArray Commands; + + [OutputConstructor] + private KubeadmArgs(ImmutableArray commands) + { + Commands = commands; + } + } +} diff --git a/sdk/dotnet/Kubeadm/README.md b/sdk/dotnet/Kubeadm/README.md new file mode 100644 index 00000000..e69de29b diff --git a/sdk/go/baremetal/kubeadm/init.go b/sdk/go/baremetal/kubeadm/init.go new file mode 100644 index 00000000..9f17423b --- /dev/null +++ b/sdk/go/baremetal/kubeadm/init.go @@ -0,0 +1,44 @@ +// 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 kubeadm + +import ( + "fmt" + + "github.com/blang/semver" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/unmango/pulumi-baremetal/sdk/go/baremetal/internal" +) + +type module struct { + version semver.Version +} + +func (m *module) Version() semver.Version { + return m.version +} + +func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { + switch typ { + case "baremetal:kubeadm:Kubeadm": + r = &Kubeadm{} + default: + return nil, fmt.Errorf("unknown resource type: %s", typ) + } + + err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) + return +} + +func init() { + version, err := internal.PkgVersion() + if err != nil { + version = semver.Version{Major: 1} + } + pulumi.RegisterResourceModule( + "baremetal", + "kubeadm", + &module{version}, + ) +} diff --git a/sdk/go/baremetal/kubeadm/kubeadm.go b/sdk/go/baremetal/kubeadm/kubeadm.go new file mode 100644 index 00000000..5bed7a79 --- /dev/null +++ b/sdk/go/baremetal/kubeadm/kubeadm.go @@ -0,0 +1,175 @@ +// 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 kubeadm + +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 Kubeadm struct { + pulumi.CustomResourceState + + Args KubeadmArgsTypeOutput `pulumi:"args"` + CreatedFiles pulumi.StringArrayOutput `pulumi:"createdFiles"` + CustomDelete pulumi.StringArrayOutput `pulumi:"customDelete"` + CustomUpdate pulumi.StringArrayOutput `pulumi:"customUpdate"` + ExitCode pulumi.IntOutput `pulumi:"exitCode"` + MovedFiles pulumi.StringMapOutput `pulumi:"movedFiles"` + Stderr pulumi.StringOutput `pulumi:"stderr"` + Stdout pulumi.StringOutput `pulumi:"stdout"` + Triggers pulumi.ArrayOutput `pulumi:"triggers"` +} + +// NewKubeadm registers a new resource with the given unique name, arguments, and options. +func NewKubeadm(ctx *pulumi.Context, + name string, args *KubeadmArgs, opts ...pulumi.ResourceOption) (*Kubeadm, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.Args == nil { + return nil, errors.New("invalid value for required argument 'Args'") + } + opts = internal.PkgResourceDefaultOpts(opts) + var resource Kubeadm + err := ctx.RegisterResource("baremetal:kubeadm:Kubeadm", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetKubeadm gets an existing Kubeadm 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 GetKubeadm(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *KubeadmState, opts ...pulumi.ResourceOption) (*Kubeadm, error) { + var resource Kubeadm + err := ctx.ReadResource("baremetal:kubeadm:Kubeadm", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Kubeadm resources. +type kubeadmState struct { +} + +type KubeadmState struct { +} + +func (KubeadmState) ElementType() reflect.Type { + return reflect.TypeOf((*kubeadmState)(nil)).Elem() +} + +type kubeadmArgs struct { + Args KubeadmArgsType `pulumi:"args"` + CustomDelete []string `pulumi:"customDelete"` + CustomUpdate []string `pulumi:"customUpdate"` + Triggers []interface{} `pulumi:"triggers"` +} + +// The set of arguments for constructing a Kubeadm resource. +type KubeadmArgs struct { + Args KubeadmArgsTypeInput + CustomDelete pulumi.StringArrayInput + CustomUpdate pulumi.StringArrayInput + Triggers pulumi.ArrayInput +} + +func (KubeadmArgs) ElementType() reflect.Type { + return reflect.TypeOf((*kubeadmArgs)(nil)).Elem() +} + +type KubeadmInput interface { + pulumi.Input + + ToKubeadmOutput() KubeadmOutput + ToKubeadmOutputWithContext(ctx context.Context) KubeadmOutput +} + +func (*Kubeadm) ElementType() reflect.Type { + return reflect.TypeOf((**Kubeadm)(nil)).Elem() +} + +func (i *Kubeadm) ToKubeadmOutput() KubeadmOutput { + return i.ToKubeadmOutputWithContext(context.Background()) +} + +func (i *Kubeadm) ToKubeadmOutputWithContext(ctx context.Context) KubeadmOutput { + return pulumi.ToOutputWithContext(ctx, i).(KubeadmOutput) +} + +func (i *Kubeadm) ToOutput(ctx context.Context) pulumix.Output[*Kubeadm] { + return pulumix.Output[*Kubeadm]{ + OutputState: i.ToKubeadmOutputWithContext(ctx).OutputState, + } +} + +type KubeadmOutput struct{ *pulumi.OutputState } + +func (KubeadmOutput) ElementType() reflect.Type { + return reflect.TypeOf((**Kubeadm)(nil)).Elem() +} + +func (o KubeadmOutput) ToKubeadmOutput() KubeadmOutput { + return o +} + +func (o KubeadmOutput) ToKubeadmOutputWithContext(ctx context.Context) KubeadmOutput { + return o +} + +func (o KubeadmOutput) ToOutput(ctx context.Context) pulumix.Output[*Kubeadm] { + return pulumix.Output[*Kubeadm]{ + OutputState: o.OutputState, + } +} + +func (o KubeadmOutput) Args() KubeadmArgsTypeOutput { + return o.ApplyT(func(v *Kubeadm) KubeadmArgsTypeOutput { return v.Args }).(KubeadmArgsTypeOutput) +} + +func (o KubeadmOutput) CreatedFiles() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Kubeadm) pulumi.StringArrayOutput { return v.CreatedFiles }).(pulumi.StringArrayOutput) +} + +func (o KubeadmOutput) CustomDelete() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Kubeadm) pulumi.StringArrayOutput { return v.CustomDelete }).(pulumi.StringArrayOutput) +} + +func (o KubeadmOutput) CustomUpdate() pulumi.StringArrayOutput { + return o.ApplyT(func(v *Kubeadm) pulumi.StringArrayOutput { return v.CustomUpdate }).(pulumi.StringArrayOutput) +} + +func (o KubeadmOutput) ExitCode() pulumi.IntOutput { + return o.ApplyT(func(v *Kubeadm) pulumi.IntOutput { return v.ExitCode }).(pulumi.IntOutput) +} + +func (o KubeadmOutput) MovedFiles() pulumi.StringMapOutput { + return o.ApplyT(func(v *Kubeadm) pulumi.StringMapOutput { return v.MovedFiles }).(pulumi.StringMapOutput) +} + +func (o KubeadmOutput) Stderr() pulumi.StringOutput { + return o.ApplyT(func(v *Kubeadm) pulumi.StringOutput { return v.Stderr }).(pulumi.StringOutput) +} + +func (o KubeadmOutput) Stdout() pulumi.StringOutput { + return o.ApplyT(func(v *Kubeadm) pulumi.StringOutput { return v.Stdout }).(pulumi.StringOutput) +} + +func (o KubeadmOutput) Triggers() pulumi.ArrayOutput { + return o.ApplyT(func(v *Kubeadm) pulumi.ArrayOutput { return v.Triggers }).(pulumi.ArrayOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*KubeadmInput)(nil)).Elem(), &Kubeadm{}) + pulumi.RegisterOutputType(KubeadmOutput{}) +} diff --git a/sdk/go/baremetal/kubeadm/pulumiTypes.go b/sdk/go/baremetal/kubeadm/pulumiTypes.go new file mode 100644 index 00000000..013e7bbc --- /dev/null +++ b/sdk/go/baremetal/kubeadm/pulumiTypes.go @@ -0,0 +1,81 @@ +// 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 kubeadm + +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" +) + +var _ = internal.GetEnvOrDefault + +type KubeadmArgsType struct { + Commands []string `pulumi:"commands"` +} + +// KubeadmArgsTypeInput is an input type that accepts KubeadmArgsTypeArgs and KubeadmArgsTypeOutput values. +// You can construct a concrete instance of `KubeadmArgsTypeInput` via: +// +// KubeadmArgsTypeArgs{...} +type KubeadmArgsTypeInput interface { + pulumi.Input + + ToKubeadmArgsTypeOutput() KubeadmArgsTypeOutput + ToKubeadmArgsTypeOutputWithContext(context.Context) KubeadmArgsTypeOutput +} + +type KubeadmArgsTypeArgs struct { + Commands pulumi.StringArrayInput `pulumi:"commands"` +} + +func (KubeadmArgsTypeArgs) ElementType() reflect.Type { + return reflect.TypeOf((*KubeadmArgsType)(nil)).Elem() +} + +func (i KubeadmArgsTypeArgs) ToKubeadmArgsTypeOutput() KubeadmArgsTypeOutput { + return i.ToKubeadmArgsTypeOutputWithContext(context.Background()) +} + +func (i KubeadmArgsTypeArgs) ToKubeadmArgsTypeOutputWithContext(ctx context.Context) KubeadmArgsTypeOutput { + return pulumi.ToOutputWithContext(ctx, i).(KubeadmArgsTypeOutput) +} + +func (i KubeadmArgsTypeArgs) ToOutput(ctx context.Context) pulumix.Output[KubeadmArgsType] { + return pulumix.Output[KubeadmArgsType]{ + OutputState: i.ToKubeadmArgsTypeOutputWithContext(ctx).OutputState, + } +} + +type KubeadmArgsTypeOutput struct{ *pulumi.OutputState } + +func (KubeadmArgsTypeOutput) ElementType() reflect.Type { + return reflect.TypeOf((*KubeadmArgsType)(nil)).Elem() +} + +func (o KubeadmArgsTypeOutput) ToKubeadmArgsTypeOutput() KubeadmArgsTypeOutput { + return o +} + +func (o KubeadmArgsTypeOutput) ToKubeadmArgsTypeOutputWithContext(ctx context.Context) KubeadmArgsTypeOutput { + return o +} + +func (o KubeadmArgsTypeOutput) ToOutput(ctx context.Context) pulumix.Output[KubeadmArgsType] { + return pulumix.Output[KubeadmArgsType]{ + OutputState: o.OutputState, + } +} + +func (o KubeadmArgsTypeOutput) Commands() pulumi.StringArrayOutput { + return o.ApplyT(func(v KubeadmArgsType) []string { return v.Commands }).(pulumi.StringArrayOutput) +} + +func init() { + pulumi.RegisterInputType(reflect.TypeOf((*KubeadmArgsTypeInput)(nil)).Elem(), KubeadmArgsTypeArgs{}) + pulumi.RegisterOutputType(KubeadmArgsTypeOutput{}) +} diff --git a/sdk/go/baremetal/x/kubeadm/init.go b/sdk/go/baremetal/x/kubeadm/init.go new file mode 100644 index 00000000..9f17423b --- /dev/null +++ b/sdk/go/baremetal/x/kubeadm/init.go @@ -0,0 +1,44 @@ +// 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 kubeadm + +import ( + "fmt" + + "github.com/blang/semver" + "github.com/pulumi/pulumi/sdk/v3/go/pulumi" + "github.com/unmango/pulumi-baremetal/sdk/go/baremetal/internal" +) + +type module struct { + version semver.Version +} + +func (m *module) Version() semver.Version { + return m.version +} + +func (m *module) Construct(ctx *pulumi.Context, name, typ, urn string) (r pulumi.Resource, err error) { + switch typ { + case "baremetal:kubeadm:Kubeadm": + r = &Kubeadm{} + default: + return nil, fmt.Errorf("unknown resource type: %s", typ) + } + + err = ctx.RegisterResource(typ, name, nil, r, pulumi.URN_(urn)) + return +} + +func init() { + version, err := internal.PkgVersion() + if err != nil { + version = semver.Version{Major: 1} + } + pulumi.RegisterResourceModule( + "baremetal", + "kubeadm", + &module{version}, + ) +} diff --git a/sdk/go/baremetal/x/kubeadm/kubeadm.go b/sdk/go/baremetal/x/kubeadm/kubeadm.go new file mode 100644 index 00000000..71c6c4b8 --- /dev/null +++ b/sdk/go/baremetal/x/kubeadm/kubeadm.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 kubeadm + +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 Kubeadm struct { + pulumi.CustomResourceState + + Args pulumix.GPtrOutput[KubeadmArgsType, KubeadmArgsTypeOutput] `pulumi:"args"` + CreatedFiles pulumix.ArrayOutput[string] `pulumi:"createdFiles"` + CustomDelete pulumix.ArrayOutput[string] `pulumi:"customDelete"` + CustomUpdate pulumix.ArrayOutput[string] `pulumi:"customUpdate"` + ExitCode pulumix.Output[int] `pulumi:"exitCode"` + MovedFiles pulumix.MapOutput[string] `pulumi:"movedFiles"` + Stderr pulumix.Output[string] `pulumi:"stderr"` + Stdout pulumix.Output[string] `pulumi:"stdout"` + Triggers pulumix.ArrayOutput[any] `pulumi:"triggers"` +} + +// NewKubeadm registers a new resource with the given unique name, arguments, and options. +func NewKubeadm(ctx *pulumi.Context, + name string, args *KubeadmArgs, opts ...pulumi.ResourceOption) (*Kubeadm, error) { + if args == nil { + return nil, errors.New("missing one or more required arguments") + } + + if args.Args == nil { + return nil, errors.New("invalid value for required argument 'Args'") + } + opts = internal.PkgResourceDefaultOpts(opts) + var resource Kubeadm + err := ctx.RegisterResource("baremetal:kubeadm:Kubeadm", name, args, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// GetKubeadm gets an existing Kubeadm 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 GetKubeadm(ctx *pulumi.Context, + name string, id pulumi.IDInput, state *KubeadmState, opts ...pulumi.ResourceOption) (*Kubeadm, error) { + var resource Kubeadm + err := ctx.ReadResource("baremetal:kubeadm:Kubeadm", name, id, state, &resource, opts...) + if err != nil { + return nil, err + } + return &resource, nil +} + +// Input properties used for looking up and filtering Kubeadm resources. +type kubeadmState struct { +} + +type KubeadmState struct { +} + +func (KubeadmState) ElementType() reflect.Type { + return reflect.TypeOf((*kubeadmState)(nil)).Elem() +} + +type kubeadmArgs struct { + Args KubeadmArgsType `pulumi:"args"` + CustomDelete []string `pulumi:"customDelete"` + CustomUpdate []string `pulumi:"customUpdate"` + Triggers []interface{} `pulumi:"triggers"` +} + +// The set of arguments for constructing a Kubeadm resource. +type KubeadmArgs struct { + Args pulumix.Input[*KubeadmArgsTypeArgs] + CustomDelete pulumix.Input[[]string] + CustomUpdate pulumix.Input[[]string] + Triggers pulumix.Input[[]any] +} + +func (KubeadmArgs) ElementType() reflect.Type { + return reflect.TypeOf((*kubeadmArgs)(nil)).Elem() +} + +type KubeadmOutput struct{ *pulumi.OutputState } + +func (KubeadmOutput) ElementType() reflect.Type { + return reflect.TypeOf((*Kubeadm)(nil)).Elem() +} + +func (o KubeadmOutput) ToKubeadmOutput() KubeadmOutput { + return o +} + +func (o KubeadmOutput) ToKubeadmOutputWithContext(ctx context.Context) KubeadmOutput { + return o +} + +func (o KubeadmOutput) ToOutput(ctx context.Context) pulumix.Output[Kubeadm] { + return pulumix.Output[Kubeadm]{ + OutputState: o.OutputState, + } +} + +func (o KubeadmOutput) Args() pulumix.GPtrOutput[KubeadmArgsType, KubeadmArgsTypeOutput] { + value := pulumix.Apply[Kubeadm](o, func(v Kubeadm) pulumix.GPtrOutput[KubeadmArgsType, KubeadmArgsTypeOutput] { return v.Args }) + unwrapped := pulumix.Flatten[*KubeadmArgsType, pulumix.GPtrOutput[KubeadmArgsType, KubeadmArgsTypeOutput]](value) + return pulumix.GPtrOutput[KubeadmArgsType, KubeadmArgsTypeOutput]{OutputState: unwrapped.OutputState} +} + +func (o KubeadmOutput) CreatedFiles() pulumix.ArrayOutput[string] { + value := pulumix.Apply[Kubeadm](o, func(v Kubeadm) pulumix.ArrayOutput[string] { return v.CreatedFiles }) + unwrapped := pulumix.Flatten[[]string, pulumix.ArrayOutput[string]](value) + return pulumix.ArrayOutput[string]{OutputState: unwrapped.OutputState} +} + +func (o KubeadmOutput) CustomDelete() pulumix.ArrayOutput[string] { + value := pulumix.Apply[Kubeadm](o, func(v Kubeadm) pulumix.ArrayOutput[string] { return v.CustomDelete }) + unwrapped := pulumix.Flatten[[]string, pulumix.ArrayOutput[string]](value) + return pulumix.ArrayOutput[string]{OutputState: unwrapped.OutputState} +} + +func (o KubeadmOutput) CustomUpdate() pulumix.ArrayOutput[string] { + value := pulumix.Apply[Kubeadm](o, func(v Kubeadm) pulumix.ArrayOutput[string] { return v.CustomUpdate }) + unwrapped := pulumix.Flatten[[]string, pulumix.ArrayOutput[string]](value) + return pulumix.ArrayOutput[string]{OutputState: unwrapped.OutputState} +} + +func (o KubeadmOutput) ExitCode() pulumix.Output[int] { + value := pulumix.Apply[Kubeadm](o, func(v Kubeadm) pulumix.Output[int] { return v.ExitCode }) + return pulumix.Flatten[int, pulumix.Output[int]](value) +} + +func (o KubeadmOutput) MovedFiles() pulumix.MapOutput[string] { + value := pulumix.Apply[Kubeadm](o, func(v Kubeadm) 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 KubeadmOutput) Stderr() pulumix.Output[string] { + value := pulumix.Apply[Kubeadm](o, func(v Kubeadm) pulumix.Output[string] { return v.Stderr }) + return pulumix.Flatten[string, pulumix.Output[string]](value) +} + +func (o KubeadmOutput) Stdout() pulumix.Output[string] { + value := pulumix.Apply[Kubeadm](o, func(v Kubeadm) pulumix.Output[string] { return v.Stdout }) + return pulumix.Flatten[string, pulumix.Output[string]](value) +} + +func (o KubeadmOutput) Triggers() pulumix.ArrayOutput[any] { + value := pulumix.Apply[Kubeadm](o, func(v Kubeadm) pulumix.ArrayOutput[any] { return v.Triggers }) + unwrapped := pulumix.Flatten[[]interface{}, pulumix.ArrayOutput[any]](value) + return pulumix.ArrayOutput[any]{OutputState: unwrapped.OutputState} +} + +func init() { + pulumi.RegisterOutputType(KubeadmOutput{}) +} diff --git a/sdk/go/baremetal/x/kubeadm/pulumiTypes.go b/sdk/go/baremetal/x/kubeadm/pulumiTypes.go new file mode 100644 index 00000000..9174448e --- /dev/null +++ b/sdk/go/baremetal/x/kubeadm/pulumiTypes.go @@ -0,0 +1,68 @@ +// 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 kubeadm + +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" +) + +var _ = internal.GetEnvOrDefault + +type KubeadmArgsType struct { + Commands []string `pulumi:"commands"` +} + +type KubeadmArgsTypeArgs struct { + Commands pulumix.Input[[]string] `pulumi:"commands"` +} + +func (KubeadmArgsTypeArgs) ElementType() reflect.Type { + return reflect.TypeOf((*KubeadmArgsType)(nil)).Elem() +} + +func (i KubeadmArgsTypeArgs) ToKubeadmArgsTypeOutput() KubeadmArgsTypeOutput { + return i.ToKubeadmArgsTypeOutputWithContext(context.Background()) +} + +func (i KubeadmArgsTypeArgs) ToKubeadmArgsTypeOutputWithContext(ctx context.Context) KubeadmArgsTypeOutput { + return pulumi.ToOutputWithContext(ctx, i).(KubeadmArgsTypeOutput) +} + +func (i *KubeadmArgsTypeArgs) ToOutput(ctx context.Context) pulumix.Output[*KubeadmArgsTypeArgs] { + return pulumix.Val(i) +} + +type KubeadmArgsTypeOutput struct{ *pulumi.OutputState } + +func (KubeadmArgsTypeOutput) ElementType() reflect.Type { + return reflect.TypeOf((*KubeadmArgsType)(nil)).Elem() +} + +func (o KubeadmArgsTypeOutput) ToKubeadmArgsTypeOutput() KubeadmArgsTypeOutput { + return o +} + +func (o KubeadmArgsTypeOutput) ToKubeadmArgsTypeOutputWithContext(ctx context.Context) KubeadmArgsTypeOutput { + return o +} + +func (o KubeadmArgsTypeOutput) ToOutput(ctx context.Context) pulumix.Output[KubeadmArgsType] { + return pulumix.Output[KubeadmArgsType]{ + OutputState: o.OutputState, + } +} + +func (o KubeadmArgsTypeOutput) Commands() pulumix.ArrayOutput[string] { + value := pulumix.Apply[KubeadmArgsType](o, func(v KubeadmArgsType) []string { return v.Commands }) + return pulumix.ArrayOutput[string]{OutputState: value.OutputState} +} + +func init() { + pulumi.RegisterOutputType(KubeadmArgsTypeOutput{}) +} diff --git a/sdk/nodejs/index.ts b/sdk/nodejs/index.ts index 33005e12..a636f191 100644 --- a/sdk/nodejs/index.ts +++ b/sdk/nodejs/index.ts @@ -14,11 +14,13 @@ utilities.lazyLoad(exports, ["Provider"], () => require("./provider")); // Export sub-modules: import * as config from "./config"; import * as coreutils from "./coreutils"; +import * as kubeadm from "./kubeadm"; import * as types from "./types"; export { config, coreutils, + kubeadm, types, }; pulumi.runtime.registerResourcePackage("baremetal", { diff --git a/sdk/nodejs/kubeadm/index.ts b/sdk/nodejs/kubeadm/index.ts new file mode 100644 index 00000000..1b8a7241 --- /dev/null +++ b/sdk/nodejs/kubeadm/index.ts @@ -0,0 +1,25 @@ +// *** 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 utilities from "../utilities"; + +// Export members: +export { KubeadmArgs } from "./kubeadm"; +export type Kubeadm = import("./kubeadm").Kubeadm; +export const Kubeadm: typeof import("./kubeadm").Kubeadm = null as any; +utilities.lazyLoad(exports, ["Kubeadm"], () => require("./kubeadm")); + + +const _module = { + version: utilities.getVersion(), + construct: (name: string, type: string, urn: string): pulumi.Resource => { + switch (type) { + case "baremetal:kubeadm:Kubeadm": + return new Kubeadm(name, undefined, { urn }) + default: + throw new Error(`unknown resource type ${type}`); + } + }, +}; +pulumi.runtime.registerResourceModule("baremetal", "kubeadm", _module) diff --git a/sdk/nodejs/kubeadm/kubeadm.ts b/sdk/nodejs/kubeadm/kubeadm.ts new file mode 100644 index 00000000..0ec33bd8 --- /dev/null +++ b/sdk/nodejs/kubeadm/kubeadm.ts @@ -0,0 +1,93 @@ +// *** 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 Kubeadm extends pulumi.CustomResource { + /** + * Get an existing Kubeadm 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): Kubeadm { + return new Kubeadm(name, undefined as any, { ...opts, id: id }); + } + + /** @internal */ + public static readonly __pulumiType = 'baremetal:kubeadm:Kubeadm'; + + /** + * Returns true if the given object is an instance of Kubeadm. 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 Kubeadm { + if (obj === undefined || obj === null) { + return false; + } + return obj['__pulumiType'] === Kubeadm.__pulumiType; + } + + public readonly args!: pulumi.Output; + public /*out*/ readonly createdFiles!: pulumi.Output; + public readonly customDelete!: pulumi.Output; + public readonly customUpdate!: 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; + public readonly triggers!: pulumi.Output; + + /** + * Create a Kubeadm 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: KubeadmArgs, opts?: pulumi.CustomResourceOptions) { + let resourceInputs: pulumi.Inputs = {}; + opts = opts || {}; + if (!opts.id) { + if ((!args || args.args === undefined) && !opts.urn) { + throw new Error("Missing required property 'args'"); + } + resourceInputs["args"] = args ? args.args : undefined; + resourceInputs["customDelete"] = args ? args.customDelete : undefined; + resourceInputs["customUpdate"] = args ? args.customUpdate : undefined; + resourceInputs["triggers"] = args ? args.triggers : undefined; + resourceInputs["createdFiles"] = undefined /*out*/; + resourceInputs["exitCode"] = undefined /*out*/; + resourceInputs["movedFiles"] = undefined /*out*/; + resourceInputs["stderr"] = undefined /*out*/; + resourceInputs["stdout"] = undefined /*out*/; + } else { + resourceInputs["args"] = undefined /*out*/; + resourceInputs["createdFiles"] = undefined /*out*/; + resourceInputs["customDelete"] = undefined /*out*/; + resourceInputs["customUpdate"] = undefined /*out*/; + resourceInputs["exitCode"] = undefined /*out*/; + resourceInputs["movedFiles"] = undefined /*out*/; + resourceInputs["stderr"] = undefined /*out*/; + resourceInputs["stdout"] = undefined /*out*/; + resourceInputs["triggers"] = undefined /*out*/; + } + opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); + super(Kubeadm.__pulumiType, name, resourceInputs, opts); + } +} + +/** + * The set of arguments for constructing a Kubeadm resource. + */ +export interface KubeadmArgs { + args: pulumi.Input; + customDelete?: pulumi.Input[]>; + customUpdate?: pulumi.Input[]>; + triggers?: pulumi.Input; +} diff --git a/sdk/nodejs/tsconfig.json b/sdk/nodejs/tsconfig.json index 57cccb62..0b7e612f 100644 --- a/sdk/nodejs/tsconfig.json +++ b/sdk/nodejs/tsconfig.json @@ -25,6 +25,8 @@ "coreutils/tee.ts", "coreutils/wget.ts", "index.ts", + "kubeadm/index.ts", + "kubeadm/kubeadm.ts", "provider.ts", "types/index.ts", "types/input.ts", diff --git a/sdk/nodejs/types/input.ts b/sdk/nodejs/types/input.ts index e81f988f..48aa3a88 100644 --- a/sdk/nodejs/types/input.ts +++ b/sdk/nodejs/types/input.ts @@ -167,3 +167,9 @@ export namespace coreutils { wait?: pulumi.Input; } } + +export namespace kubeadm { + export interface KubeadmArgsArgs { + commands: pulumi.Input[]>; + } +} diff --git a/sdk/nodejs/types/output.ts b/sdk/nodejs/types/output.ts index 7322a479..f34bb0df 100644 --- a/sdk/nodejs/types/output.ts +++ b/sdk/nodejs/types/output.ts @@ -168,3 +168,10 @@ export namespace coreutils { } } + +export namespace kubeadm { + export interface KubeadmArgs { + commands: string[]; + } + +} diff --git a/sdk/python/unmango_baremetal/__init__.py b/sdk/python/unmango_baremetal/__init__.py index ff245d29..c6ac2baa 100644 --- a/sdk/python/unmango_baremetal/__init__.py +++ b/sdk/python/unmango_baremetal/__init__.py @@ -13,9 +13,12 @@ config = __config import unmango_baremetal.coreutils as __coreutils coreutils = __coreutils + import unmango_baremetal.kubeadm as __kubeadm + kubeadm = __kubeadm else: config = _utilities.lazy_import('unmango_baremetal.config') coreutils = _utilities.lazy_import('unmango_baremetal.coreutils') + kubeadm = _utilities.lazy_import('unmango_baremetal.kubeadm') _utilities.register( resource_modules=""" @@ -34,6 +37,14 @@ "baremetal:coreutils:Tee": "Tee", "baremetal:coreutils:Wget": "Wget" } + }, + { + "pkg": "baremetal", + "mod": "kubeadm", + "fqn": "unmango_baremetal.kubeadm", + "classes": { + "baremetal:kubeadm:Kubeadm": "Kubeadm" + } } ] """, diff --git a/sdk/python/unmango_baremetal/kubeadm/__init__.py b/sdk/python/unmango_baremetal/kubeadm/__init__.py new file mode 100644 index 00000000..36ccfdce --- /dev/null +++ b/sdk/python/unmango_baremetal/kubeadm/__init__.py @@ -0,0 +1,10 @@ +# 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! *** + +from .. import _utilities +import typing +# Export this package's modules as members: +from .kubeadm import * +from ._inputs import * +from . import outputs diff --git a/sdk/python/unmango_baremetal/kubeadm/_inputs.py b/sdk/python/unmango_baremetal/kubeadm/_inputs.py new file mode 100644 index 00000000..17da2818 --- /dev/null +++ b/sdk/python/unmango_baremetal/kubeadm/_inputs.py @@ -0,0 +1,31 @@ +# 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 + +__all__ = [ + 'KubeadmArgsArgs', +] + +@pulumi.input_type +class KubeadmArgsArgs: + def __init__(__self__, *, + commands: pulumi.Input[Sequence[pulumi.Input[str]]]): + pulumi.set(__self__, "commands", commands) + + @property + @pulumi.getter + def commands(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]: + return pulumi.get(self, "commands") + + @commands.setter + def commands(self, value: pulumi.Input[Sequence[pulumi.Input[str]]]): + pulumi.set(self, "commands", value) + + diff --git a/sdk/python/unmango_baremetal/kubeadm/kubeadm.py b/sdk/python/unmango_baremetal/kubeadm/kubeadm.py new file mode 100644 index 00000000..1d8cc624 --- /dev/null +++ b/sdk/python/unmango_baremetal/kubeadm/kubeadm.py @@ -0,0 +1,210 @@ +# 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 +from ._inputs import * + +__all__ = ['KubeadmArgs', 'Kubeadm'] + +@pulumi.input_type +class KubeadmArgs: + def __init__(__self__, *, + args: pulumi.Input['KubeadmArgsArgs'], + custom_delete: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + custom_update: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + triggers: Optional[pulumi.Input[Sequence[Any]]] = None): + """ + The set of arguments for constructing a Kubeadm resource. + """ + pulumi.set(__self__, "args", args) + if custom_delete is not None: + pulumi.set(__self__, "custom_delete", custom_delete) + if custom_update is not None: + pulumi.set(__self__, "custom_update", custom_update) + if triggers is not None: + pulumi.set(__self__, "triggers", triggers) + + @property + @pulumi.getter + def args(self) -> pulumi.Input['KubeadmArgsArgs']: + return pulumi.get(self, "args") + + @args.setter + def args(self, value: pulumi.Input['KubeadmArgsArgs']): + pulumi.set(self, "args", value) + + @property + @pulumi.getter(name="customDelete") + def custom_delete(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: + return pulumi.get(self, "custom_delete") + + @custom_delete.setter + def custom_delete(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): + pulumi.set(self, "custom_delete", value) + + @property + @pulumi.getter(name="customUpdate") + def custom_update(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]: + return pulumi.get(self, "custom_update") + + @custom_update.setter + def custom_update(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]): + pulumi.set(self, "custom_update", value) + + @property + @pulumi.getter + def triggers(self) -> Optional[pulumi.Input[Sequence[Any]]]: + return pulumi.get(self, "triggers") + + @triggers.setter + def triggers(self, value: Optional[pulumi.Input[Sequence[Any]]]): + pulumi.set(self, "triggers", value) + + +class Kubeadm(pulumi.CustomResource): + @overload + def __init__(__self__, + resource_name: str, + opts: Optional[pulumi.ResourceOptions] = None, + args: Optional[pulumi.Input[Union['KubeadmArgsArgs', 'KubeadmArgsArgsDict']]] = None, + custom_delete: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + custom_update: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + triggers: Optional[pulumi.Input[Sequence[Any]]] = None, + __props__=None): + """ + Create a Kubeadm 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: KubeadmArgs, + opts: Optional[pulumi.ResourceOptions] = None): + """ + Create a Kubeadm resource with the given unique name, props, and options. + :param str resource_name: The name of the resource. + :param KubeadmArgs 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(KubeadmArgs, 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, + args: Optional[pulumi.Input[Union['KubeadmArgsArgs', 'KubeadmArgsArgsDict']]] = None, + custom_delete: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + custom_update: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None, + triggers: Optional[pulumi.Input[Sequence[Any]]] = 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__ = KubeadmArgs.__new__(KubeadmArgs) + + if args is None and not opts.urn: + raise TypeError("Missing required property 'args'") + __props__.__dict__["args"] = args + __props__.__dict__["custom_delete"] = custom_delete + __props__.__dict__["custom_update"] = custom_update + __props__.__dict__["triggers"] = triggers + __props__.__dict__["created_files"] = None + __props__.__dict__["exit_code"] = None + __props__.__dict__["moved_files"] = None + __props__.__dict__["stderr"] = None + __props__.__dict__["stdout"] = None + super(Kubeadm, __self__).__init__( + 'baremetal:kubeadm:Kubeadm', + resource_name, + __props__, + opts) + + @staticmethod + def get(resource_name: str, + id: pulumi.Input[str], + opts: Optional[pulumi.ResourceOptions] = None) -> 'Kubeadm': + """ + Get an existing Kubeadm 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__ = KubeadmArgs.__new__(KubeadmArgs) + + __props__.__dict__["args"] = None + __props__.__dict__["created_files"] = None + __props__.__dict__["custom_delete"] = None + __props__.__dict__["custom_update"] = None + __props__.__dict__["exit_code"] = None + __props__.__dict__["moved_files"] = None + __props__.__dict__["stderr"] = None + __props__.__dict__["stdout"] = None + __props__.__dict__["triggers"] = None + return Kubeadm(resource_name, opts=opts, __props__=__props__) + + @property + @pulumi.getter + def args(self) -> pulumi.Output['outputs.KubeadmArgs']: + 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="customDelete") + def custom_delete(self) -> pulumi.Output[Optional[Sequence[str]]]: + return pulumi.get(self, "custom_delete") + + @property + @pulumi.getter(name="customUpdate") + def custom_update(self) -> pulumi.Output[Optional[Sequence[str]]]: + return pulumi.get(self, "custom_update") + + @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") + + @property + @pulumi.getter + def triggers(self) -> pulumi.Output[Optional[Sequence[Any]]]: + return pulumi.get(self, "triggers") + diff --git a/sdk/python/unmango_baremetal/kubeadm/outputs.py b/sdk/python/unmango_baremetal/kubeadm/outputs.py new file mode 100644 index 00000000..4c094b36 --- /dev/null +++ b/sdk/python/unmango_baremetal/kubeadm/outputs.py @@ -0,0 +1,27 @@ +# 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 + +__all__ = [ + 'KubeadmArgs', +] + +@pulumi.output_type +class KubeadmArgs(dict): + def __init__(__self__, *, + commands: Sequence[str]): + pulumi.set(__self__, "commands", commands) + + @property + @pulumi.getter + def commands(self) -> Sequence[str]: + return pulumi.get(self, "commands") + +