github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/node.go (about)

     1  // Code generated by pulumigen DO NOT EDIT.
     2  // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
     3  
     4  package v1
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Node is a worker node in Kubernetes. Each node will have a unique identifier in the cache (i.e. in etcd).
    15  type Node struct {
    16  	pulumi.CustomResourceState
    17  
    18  	// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    19  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    20  	// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    21  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    22  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    23  	Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
    24  	// Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    25  	Spec NodeSpecPtrOutput `pulumi:"spec"`
    26  	// Most recently observed status of the node. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    27  	Status NodeStatusPtrOutput `pulumi:"status"`
    28  }
    29  
    30  // NewNode registers a new resource with the given unique name, arguments, and options.
    31  func NewNode(ctx *pulumi.Context,
    32  	name string, args *NodeArgs, opts ...pulumi.ResourceOption) (*Node, error) {
    33  	if args == nil {
    34  		args = &NodeArgs{}
    35  	}
    36  
    37  	args.ApiVersion = pulumi.StringPtr("v1")
    38  	args.Kind = pulumi.StringPtr("Node")
    39  	var resource Node
    40  	err := ctx.RegisterResource("kubernetes:core/v1:Node", name, args, &resource, opts...)
    41  	if err != nil {
    42  		return nil, err
    43  	}
    44  	return &resource, nil
    45  }
    46  
    47  // GetNode gets an existing Node resource's state with the given name, ID, and optional
    48  // state properties that are used to uniquely qualify the lookup (nil if not required).
    49  func GetNode(ctx *pulumi.Context,
    50  	name string, id pulumi.IDInput, state *NodeState, opts ...pulumi.ResourceOption) (*Node, error) {
    51  	var resource Node
    52  	err := ctx.ReadResource("kubernetes:core/v1:Node", name, id, state, &resource, opts...)
    53  	if err != nil {
    54  		return nil, err
    55  	}
    56  	return &resource, nil
    57  }
    58  
    59  // Input properties used for looking up and filtering Node resources.
    60  type nodeState struct {
    61  }
    62  
    63  type NodeState struct {
    64  }
    65  
    66  func (NodeState) ElementType() reflect.Type {
    67  	return reflect.TypeOf((*nodeState)(nil)).Elem()
    68  }
    69  
    70  type nodeArgs struct {
    71  	// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    72  	ApiVersion *string `pulumi:"apiVersion"`
    73  	// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    74  	Kind *string `pulumi:"kind"`
    75  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    76  	Metadata *metav1.ObjectMeta `pulumi:"metadata"`
    77  	// Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    78  	Spec *NodeSpec `pulumi:"spec"`
    79  }
    80  
    81  // The set of arguments for constructing a Node resource.
    82  type NodeArgs struct {
    83  	// APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
    84  	ApiVersion pulumi.StringPtrInput
    85  	// Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
    86  	Kind pulumi.StringPtrInput
    87  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    88  	Metadata metav1.ObjectMetaPtrInput
    89  	// Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    90  	Spec NodeSpecPtrInput
    91  }
    92  
    93  func (NodeArgs) ElementType() reflect.Type {
    94  	return reflect.TypeOf((*nodeArgs)(nil)).Elem()
    95  }
    96  
    97  type NodeInput interface {
    98  	pulumi.Input
    99  
   100  	ToNodeOutput() NodeOutput
   101  	ToNodeOutputWithContext(ctx context.Context) NodeOutput
   102  }
   103  
   104  func (*Node) ElementType() reflect.Type {
   105  	return reflect.TypeOf((**Node)(nil)).Elem()
   106  }
   107  
   108  func (i *Node) ToNodeOutput() NodeOutput {
   109  	return i.ToNodeOutputWithContext(context.Background())
   110  }
   111  
   112  func (i *Node) ToNodeOutputWithContext(ctx context.Context) NodeOutput {
   113  	return pulumi.ToOutputWithContext(ctx, i).(NodeOutput)
   114  }
   115  
   116  // NodeArrayInput is an input type that accepts NodeArray and NodeArrayOutput values.
   117  // You can construct a concrete instance of `NodeArrayInput` via:
   118  //
   119  //	NodeArray{ NodeArgs{...} }
   120  type NodeArrayInput interface {
   121  	pulumi.Input
   122  
   123  	ToNodeArrayOutput() NodeArrayOutput
   124  	ToNodeArrayOutputWithContext(context.Context) NodeArrayOutput
   125  }
   126  
   127  type NodeArray []NodeInput
   128  
   129  func (NodeArray) ElementType() reflect.Type {
   130  	return reflect.TypeOf((*[]*Node)(nil)).Elem()
   131  }
   132  
   133  func (i NodeArray) ToNodeArrayOutput() NodeArrayOutput {
   134  	return i.ToNodeArrayOutputWithContext(context.Background())
   135  }
   136  
   137  func (i NodeArray) ToNodeArrayOutputWithContext(ctx context.Context) NodeArrayOutput {
   138  	return pulumi.ToOutputWithContext(ctx, i).(NodeArrayOutput)
   139  }
   140  
   141  // NodeMapInput is an input type that accepts NodeMap and NodeMapOutput values.
   142  // You can construct a concrete instance of `NodeMapInput` via:
   143  //
   144  //	NodeMap{ "key": NodeArgs{...} }
   145  type NodeMapInput interface {
   146  	pulumi.Input
   147  
   148  	ToNodeMapOutput() NodeMapOutput
   149  	ToNodeMapOutputWithContext(context.Context) NodeMapOutput
   150  }
   151  
   152  type NodeMap map[string]NodeInput
   153  
   154  func (NodeMap) ElementType() reflect.Type {
   155  	return reflect.TypeOf((*map[string]*Node)(nil)).Elem()
   156  }
   157  
   158  func (i NodeMap) ToNodeMapOutput() NodeMapOutput {
   159  	return i.ToNodeMapOutputWithContext(context.Background())
   160  }
   161  
   162  func (i NodeMap) ToNodeMapOutputWithContext(ctx context.Context) NodeMapOutput {
   163  	return pulumi.ToOutputWithContext(ctx, i).(NodeMapOutput)
   164  }
   165  
   166  type NodeOutput struct{ *pulumi.OutputState }
   167  
   168  func (NodeOutput) ElementType() reflect.Type {
   169  	return reflect.TypeOf((**Node)(nil)).Elem()
   170  }
   171  
   172  func (o NodeOutput) ToNodeOutput() NodeOutput {
   173  	return o
   174  }
   175  
   176  func (o NodeOutput) ToNodeOutputWithContext(ctx context.Context) NodeOutput {
   177  	return o
   178  }
   179  
   180  // APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
   181  func (o NodeOutput) ApiVersion() pulumi.StringPtrOutput {
   182  	return o.ApplyT(func(v *Node) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   183  }
   184  
   185  // Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
   186  func (o NodeOutput) Kind() pulumi.StringPtrOutput {
   187  	return o.ApplyT(func(v *Node) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   188  }
   189  
   190  // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   191  func (o NodeOutput) Metadata() metav1.ObjectMetaPtrOutput {
   192  	return o.ApplyT(func(v *Node) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   193  }
   194  
   195  // Spec defines the behavior of a node. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   196  func (o NodeOutput) Spec() NodeSpecPtrOutput {
   197  	return o.ApplyT(func(v *Node) NodeSpecPtrOutput { return v.Spec }).(NodeSpecPtrOutput)
   198  }
   199  
   200  // Most recently observed status of the node. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   201  func (o NodeOutput) Status() NodeStatusPtrOutput {
   202  	return o.ApplyT(func(v *Node) NodeStatusPtrOutput { return v.Status }).(NodeStatusPtrOutput)
   203  }
   204  
   205  type NodeArrayOutput struct{ *pulumi.OutputState }
   206  
   207  func (NodeArrayOutput) ElementType() reflect.Type {
   208  	return reflect.TypeOf((*[]*Node)(nil)).Elem()
   209  }
   210  
   211  func (o NodeArrayOutput) ToNodeArrayOutput() NodeArrayOutput {
   212  	return o
   213  }
   214  
   215  func (o NodeArrayOutput) ToNodeArrayOutputWithContext(ctx context.Context) NodeArrayOutput {
   216  	return o
   217  }
   218  
   219  func (o NodeArrayOutput) Index(i pulumi.IntInput) NodeOutput {
   220  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Node {
   221  		return vs[0].([]*Node)[vs[1].(int)]
   222  	}).(NodeOutput)
   223  }
   224  
   225  type NodeMapOutput struct{ *pulumi.OutputState }
   226  
   227  func (NodeMapOutput) ElementType() reflect.Type {
   228  	return reflect.TypeOf((*map[string]*Node)(nil)).Elem()
   229  }
   230  
   231  func (o NodeMapOutput) ToNodeMapOutput() NodeMapOutput {
   232  	return o
   233  }
   234  
   235  func (o NodeMapOutput) ToNodeMapOutputWithContext(ctx context.Context) NodeMapOutput {
   236  	return o
   237  }
   238  
   239  func (o NodeMapOutput) MapIndex(k pulumi.StringInput) NodeOutput {
   240  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Node {
   241  		return vs[0].(map[string]*Node)[vs[1].(string)]
   242  	}).(NodeOutput)
   243  }
   244  
   245  func init() {
   246  	pulumi.RegisterInputType(reflect.TypeOf((*NodeInput)(nil)).Elem(), &Node{})
   247  	pulumi.RegisterInputType(reflect.TypeOf((*NodeArrayInput)(nil)).Elem(), NodeArray{})
   248  	pulumi.RegisterInputType(reflect.TypeOf((*NodeMapInput)(nil)).Elem(), NodeMap{})
   249  	pulumi.RegisterOutputType(NodeOutput{})
   250  	pulumi.RegisterOutputType(NodeArrayOutput{})
   251  	pulumi.RegisterOutputType(NodeMapOutput{})
   252  }