github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/storage/v1beta1/csinode.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 v1beta1
     5  
     6  import (
     7  	"context"
     8  	"reflect"
     9  
    10  	"errors"
    11  	metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // CSINode holds information about all CSI drivers installed on a node. CSI drivers do not need to create the CSINode object directly. As long as they use the node-driver-registrar sidecar container, the kubelet will automatically populate the CSINode object for the CSI driver as part of kubelet plugin registration. CSINode has the same name as a node. If the object is missing, it means either there are no CSI Drivers available on the node, or the Kubelet version is low enough that it doesn't create this object. CSINode has an OwnerReference that points to the corresponding node object.
    16  //
    17  // Deprecated: storage/v1beta1/CSINode is deprecated by storage.k8s.io/v1/CSINode.
    18  type CSINode struct {
    19  	pulumi.CustomResourceState
    20  
    21  	// 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
    22  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    23  	// 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
    24  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    25  	// metadata.name must be the Kubernetes node name.
    26  	Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
    27  	// spec is the specification of CSINode
    28  	Spec CSINodeSpecOutput `pulumi:"spec"`
    29  }
    30  
    31  // NewCSINode registers a new resource with the given unique name, arguments, and options.
    32  func NewCSINode(ctx *pulumi.Context,
    33  	name string, args *CSINodeArgs, opts ...pulumi.ResourceOption) (*CSINode, error) {
    34  	if args == nil {
    35  		return nil, errors.New("missing one or more required arguments")
    36  	}
    37  
    38  	if args.Spec == nil {
    39  		return nil, errors.New("invalid value for required argument 'Spec'")
    40  	}
    41  	args.ApiVersion = pulumi.StringPtr("storage.k8s.io/v1beta1")
    42  	args.Kind = pulumi.StringPtr("CSINode")
    43  	aliases := pulumi.Aliases([]pulumi.Alias{
    44  		{
    45  			Type: pulumi.String("kubernetes:storage.k8s.io/v1:CSINode"),
    46  		},
    47  	})
    48  	opts = append(opts, aliases)
    49  	var resource CSINode
    50  	err := ctx.RegisterResource("kubernetes:storage.k8s.io/v1beta1:CSINode", name, args, &resource, opts...)
    51  	if err != nil {
    52  		return nil, err
    53  	}
    54  	return &resource, nil
    55  }
    56  
    57  // GetCSINode gets an existing CSINode resource's state with the given name, ID, and optional
    58  // state properties that are used to uniquely qualify the lookup (nil if not required).
    59  func GetCSINode(ctx *pulumi.Context,
    60  	name string, id pulumi.IDInput, state *CSINodeState, opts ...pulumi.ResourceOption) (*CSINode, error) {
    61  	var resource CSINode
    62  	err := ctx.ReadResource("kubernetes:storage.k8s.io/v1beta1:CSINode", name, id, state, &resource, opts...)
    63  	if err != nil {
    64  		return nil, err
    65  	}
    66  	return &resource, nil
    67  }
    68  
    69  // Input properties used for looking up and filtering CSINode resources.
    70  type csinodeState struct {
    71  }
    72  
    73  type CSINodeState struct {
    74  }
    75  
    76  func (CSINodeState) ElementType() reflect.Type {
    77  	return reflect.TypeOf((*csinodeState)(nil)).Elem()
    78  }
    79  
    80  type csinodeArgs struct {
    81  	// 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
    82  	ApiVersion *string `pulumi:"apiVersion"`
    83  	// 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
    84  	Kind *string `pulumi:"kind"`
    85  	// metadata.name must be the Kubernetes node name.
    86  	Metadata *metav1.ObjectMeta `pulumi:"metadata"`
    87  	// spec is the specification of CSINode
    88  	Spec CSINodeSpec `pulumi:"spec"`
    89  }
    90  
    91  // The set of arguments for constructing a CSINode resource.
    92  type CSINodeArgs struct {
    93  	// 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
    94  	ApiVersion pulumi.StringPtrInput
    95  	// 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
    96  	Kind pulumi.StringPtrInput
    97  	// metadata.name must be the Kubernetes node name.
    98  	Metadata metav1.ObjectMetaPtrInput
    99  	// spec is the specification of CSINode
   100  	Spec CSINodeSpecInput
   101  }
   102  
   103  func (CSINodeArgs) ElementType() reflect.Type {
   104  	return reflect.TypeOf((*csinodeArgs)(nil)).Elem()
   105  }
   106  
   107  type CSINodeInput interface {
   108  	pulumi.Input
   109  
   110  	ToCSINodeOutput() CSINodeOutput
   111  	ToCSINodeOutputWithContext(ctx context.Context) CSINodeOutput
   112  }
   113  
   114  func (*CSINode) ElementType() reflect.Type {
   115  	return reflect.TypeOf((**CSINode)(nil)).Elem()
   116  }
   117  
   118  func (i *CSINode) ToCSINodeOutput() CSINodeOutput {
   119  	return i.ToCSINodeOutputWithContext(context.Background())
   120  }
   121  
   122  func (i *CSINode) ToCSINodeOutputWithContext(ctx context.Context) CSINodeOutput {
   123  	return pulumi.ToOutputWithContext(ctx, i).(CSINodeOutput)
   124  }
   125  
   126  // CSINodeArrayInput is an input type that accepts CSINodeArray and CSINodeArrayOutput values.
   127  // You can construct a concrete instance of `CSINodeArrayInput` via:
   128  //
   129  //	CSINodeArray{ CSINodeArgs{...} }
   130  type CSINodeArrayInput interface {
   131  	pulumi.Input
   132  
   133  	ToCSINodeArrayOutput() CSINodeArrayOutput
   134  	ToCSINodeArrayOutputWithContext(context.Context) CSINodeArrayOutput
   135  }
   136  
   137  type CSINodeArray []CSINodeInput
   138  
   139  func (CSINodeArray) ElementType() reflect.Type {
   140  	return reflect.TypeOf((*[]*CSINode)(nil)).Elem()
   141  }
   142  
   143  func (i CSINodeArray) ToCSINodeArrayOutput() CSINodeArrayOutput {
   144  	return i.ToCSINodeArrayOutputWithContext(context.Background())
   145  }
   146  
   147  func (i CSINodeArray) ToCSINodeArrayOutputWithContext(ctx context.Context) CSINodeArrayOutput {
   148  	return pulumi.ToOutputWithContext(ctx, i).(CSINodeArrayOutput)
   149  }
   150  
   151  // CSINodeMapInput is an input type that accepts CSINodeMap and CSINodeMapOutput values.
   152  // You can construct a concrete instance of `CSINodeMapInput` via:
   153  //
   154  //	CSINodeMap{ "key": CSINodeArgs{...} }
   155  type CSINodeMapInput interface {
   156  	pulumi.Input
   157  
   158  	ToCSINodeMapOutput() CSINodeMapOutput
   159  	ToCSINodeMapOutputWithContext(context.Context) CSINodeMapOutput
   160  }
   161  
   162  type CSINodeMap map[string]CSINodeInput
   163  
   164  func (CSINodeMap) ElementType() reflect.Type {
   165  	return reflect.TypeOf((*map[string]*CSINode)(nil)).Elem()
   166  }
   167  
   168  func (i CSINodeMap) ToCSINodeMapOutput() CSINodeMapOutput {
   169  	return i.ToCSINodeMapOutputWithContext(context.Background())
   170  }
   171  
   172  func (i CSINodeMap) ToCSINodeMapOutputWithContext(ctx context.Context) CSINodeMapOutput {
   173  	return pulumi.ToOutputWithContext(ctx, i).(CSINodeMapOutput)
   174  }
   175  
   176  type CSINodeOutput struct{ *pulumi.OutputState }
   177  
   178  func (CSINodeOutput) ElementType() reflect.Type {
   179  	return reflect.TypeOf((**CSINode)(nil)).Elem()
   180  }
   181  
   182  func (o CSINodeOutput) ToCSINodeOutput() CSINodeOutput {
   183  	return o
   184  }
   185  
   186  func (o CSINodeOutput) ToCSINodeOutputWithContext(ctx context.Context) CSINodeOutput {
   187  	return o
   188  }
   189  
   190  // 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
   191  func (o CSINodeOutput) ApiVersion() pulumi.StringPtrOutput {
   192  	return o.ApplyT(func(v *CSINode) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   193  }
   194  
   195  // 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
   196  func (o CSINodeOutput) Kind() pulumi.StringPtrOutput {
   197  	return o.ApplyT(func(v *CSINode) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   198  }
   199  
   200  // metadata.name must be the Kubernetes node name.
   201  func (o CSINodeOutput) Metadata() metav1.ObjectMetaPtrOutput {
   202  	return o.ApplyT(func(v *CSINode) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   203  }
   204  
   205  // spec is the specification of CSINode
   206  func (o CSINodeOutput) Spec() CSINodeSpecOutput {
   207  	return o.ApplyT(func(v *CSINode) CSINodeSpecOutput { return v.Spec }).(CSINodeSpecOutput)
   208  }
   209  
   210  type CSINodeArrayOutput struct{ *pulumi.OutputState }
   211  
   212  func (CSINodeArrayOutput) ElementType() reflect.Type {
   213  	return reflect.TypeOf((*[]*CSINode)(nil)).Elem()
   214  }
   215  
   216  func (o CSINodeArrayOutput) ToCSINodeArrayOutput() CSINodeArrayOutput {
   217  	return o
   218  }
   219  
   220  func (o CSINodeArrayOutput) ToCSINodeArrayOutputWithContext(ctx context.Context) CSINodeArrayOutput {
   221  	return o
   222  }
   223  
   224  func (o CSINodeArrayOutput) Index(i pulumi.IntInput) CSINodeOutput {
   225  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CSINode {
   226  		return vs[0].([]*CSINode)[vs[1].(int)]
   227  	}).(CSINodeOutput)
   228  }
   229  
   230  type CSINodeMapOutput struct{ *pulumi.OutputState }
   231  
   232  func (CSINodeMapOutput) ElementType() reflect.Type {
   233  	return reflect.TypeOf((*map[string]*CSINode)(nil)).Elem()
   234  }
   235  
   236  func (o CSINodeMapOutput) ToCSINodeMapOutput() CSINodeMapOutput {
   237  	return o
   238  }
   239  
   240  func (o CSINodeMapOutput) ToCSINodeMapOutputWithContext(ctx context.Context) CSINodeMapOutput {
   241  	return o
   242  }
   243  
   244  func (o CSINodeMapOutput) MapIndex(k pulumi.StringInput) CSINodeOutput {
   245  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CSINode {
   246  		return vs[0].(map[string]*CSINode)[vs[1].(string)]
   247  	}).(CSINodeOutput)
   248  }
   249  
   250  func init() {
   251  	pulumi.RegisterInputType(reflect.TypeOf((*CSINodeInput)(nil)).Elem(), &CSINode{})
   252  	pulumi.RegisterInputType(reflect.TypeOf((*CSINodeArrayInput)(nil)).Elem(), CSINodeArray{})
   253  	pulumi.RegisterInputType(reflect.TypeOf((*CSINodeMapInput)(nil)).Elem(), CSINodeMap{})
   254  	pulumi.RegisterOutputType(CSINodeOutput{})
   255  	pulumi.RegisterOutputType(CSINodeArrayOutput{})
   256  	pulumi.RegisterOutputType(CSINodeMapOutput{})
   257  }