github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/storage/v1beta1/volumeAttachment.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  // VolumeAttachment captures the intent to attach or detach the specified volume to/from the specified node.
    16  //
    17  // VolumeAttachment objects are non-namespaced.
    18  type VolumeAttachment 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  	// Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    26  	Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
    27  	// Specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.
    28  	Spec VolumeAttachmentSpecOutput `pulumi:"spec"`
    29  	// Status of the VolumeAttachment request. Populated by the entity completing the attach or detach operation, i.e. the external-attacher.
    30  	Status VolumeAttachmentStatusPtrOutput `pulumi:"status"`
    31  }
    32  
    33  // NewVolumeAttachment registers a new resource with the given unique name, arguments, and options.
    34  func NewVolumeAttachment(ctx *pulumi.Context,
    35  	name string, args *VolumeAttachmentArgs, opts ...pulumi.ResourceOption) (*VolumeAttachment, error) {
    36  	if args == nil {
    37  		return nil, errors.New("missing one or more required arguments")
    38  	}
    39  
    40  	if args.Spec == nil {
    41  		return nil, errors.New("invalid value for required argument 'Spec'")
    42  	}
    43  	args.ApiVersion = pulumi.StringPtr("storage.k8s.io/v1beta1")
    44  	args.Kind = pulumi.StringPtr("VolumeAttachment")
    45  	aliases := pulumi.Aliases([]pulumi.Alias{
    46  		{
    47  			Type: pulumi.String("kubernetes:storage.k8s.io/v1:VolumeAttachment"),
    48  		},
    49  		{
    50  			Type: pulumi.String("kubernetes:storage.k8s.io/v1alpha1:VolumeAttachment"),
    51  		},
    52  	})
    53  	opts = append(opts, aliases)
    54  	var resource VolumeAttachment
    55  	err := ctx.RegisterResource("kubernetes:storage.k8s.io/v1beta1:VolumeAttachment", name, args, &resource, opts...)
    56  	if err != nil {
    57  		return nil, err
    58  	}
    59  	return &resource, nil
    60  }
    61  
    62  // GetVolumeAttachment gets an existing VolumeAttachment resource's state with the given name, ID, and optional
    63  // state properties that are used to uniquely qualify the lookup (nil if not required).
    64  func GetVolumeAttachment(ctx *pulumi.Context,
    65  	name string, id pulumi.IDInput, state *VolumeAttachmentState, opts ...pulumi.ResourceOption) (*VolumeAttachment, error) {
    66  	var resource VolumeAttachment
    67  	err := ctx.ReadResource("kubernetes:storage.k8s.io/v1beta1:VolumeAttachment", name, id, state, &resource, opts...)
    68  	if err != nil {
    69  		return nil, err
    70  	}
    71  	return &resource, nil
    72  }
    73  
    74  // Input properties used for looking up and filtering VolumeAttachment resources.
    75  type volumeAttachmentState struct {
    76  }
    77  
    78  type VolumeAttachmentState struct {
    79  }
    80  
    81  func (VolumeAttachmentState) ElementType() reflect.Type {
    82  	return reflect.TypeOf((*volumeAttachmentState)(nil)).Elem()
    83  }
    84  
    85  type volumeAttachmentArgs struct {
    86  	// 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
    87  	ApiVersion *string `pulumi:"apiVersion"`
    88  	// 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
    89  	Kind *string `pulumi:"kind"`
    90  	// Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    91  	Metadata *metav1.ObjectMeta `pulumi:"metadata"`
    92  	// Specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.
    93  	Spec VolumeAttachmentSpec `pulumi:"spec"`
    94  }
    95  
    96  // The set of arguments for constructing a VolumeAttachment resource.
    97  type VolumeAttachmentArgs struct {
    98  	// 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
    99  	ApiVersion pulumi.StringPtrInput
   100  	// 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
   101  	Kind pulumi.StringPtrInput
   102  	// Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   103  	Metadata metav1.ObjectMetaPtrInput
   104  	// Specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.
   105  	Spec VolumeAttachmentSpecInput
   106  }
   107  
   108  func (VolumeAttachmentArgs) ElementType() reflect.Type {
   109  	return reflect.TypeOf((*volumeAttachmentArgs)(nil)).Elem()
   110  }
   111  
   112  type VolumeAttachmentInput interface {
   113  	pulumi.Input
   114  
   115  	ToVolumeAttachmentOutput() VolumeAttachmentOutput
   116  	ToVolumeAttachmentOutputWithContext(ctx context.Context) VolumeAttachmentOutput
   117  }
   118  
   119  func (*VolumeAttachment) ElementType() reflect.Type {
   120  	return reflect.TypeOf((**VolumeAttachment)(nil)).Elem()
   121  }
   122  
   123  func (i *VolumeAttachment) ToVolumeAttachmentOutput() VolumeAttachmentOutput {
   124  	return i.ToVolumeAttachmentOutputWithContext(context.Background())
   125  }
   126  
   127  func (i *VolumeAttachment) ToVolumeAttachmentOutputWithContext(ctx context.Context) VolumeAttachmentOutput {
   128  	return pulumi.ToOutputWithContext(ctx, i).(VolumeAttachmentOutput)
   129  }
   130  
   131  // VolumeAttachmentArrayInput is an input type that accepts VolumeAttachmentArray and VolumeAttachmentArrayOutput values.
   132  // You can construct a concrete instance of `VolumeAttachmentArrayInput` via:
   133  //
   134  //	VolumeAttachmentArray{ VolumeAttachmentArgs{...} }
   135  type VolumeAttachmentArrayInput interface {
   136  	pulumi.Input
   137  
   138  	ToVolumeAttachmentArrayOutput() VolumeAttachmentArrayOutput
   139  	ToVolumeAttachmentArrayOutputWithContext(context.Context) VolumeAttachmentArrayOutput
   140  }
   141  
   142  type VolumeAttachmentArray []VolumeAttachmentInput
   143  
   144  func (VolumeAttachmentArray) ElementType() reflect.Type {
   145  	return reflect.TypeOf((*[]*VolumeAttachment)(nil)).Elem()
   146  }
   147  
   148  func (i VolumeAttachmentArray) ToVolumeAttachmentArrayOutput() VolumeAttachmentArrayOutput {
   149  	return i.ToVolumeAttachmentArrayOutputWithContext(context.Background())
   150  }
   151  
   152  func (i VolumeAttachmentArray) ToVolumeAttachmentArrayOutputWithContext(ctx context.Context) VolumeAttachmentArrayOutput {
   153  	return pulumi.ToOutputWithContext(ctx, i).(VolumeAttachmentArrayOutput)
   154  }
   155  
   156  // VolumeAttachmentMapInput is an input type that accepts VolumeAttachmentMap and VolumeAttachmentMapOutput values.
   157  // You can construct a concrete instance of `VolumeAttachmentMapInput` via:
   158  //
   159  //	VolumeAttachmentMap{ "key": VolumeAttachmentArgs{...} }
   160  type VolumeAttachmentMapInput interface {
   161  	pulumi.Input
   162  
   163  	ToVolumeAttachmentMapOutput() VolumeAttachmentMapOutput
   164  	ToVolumeAttachmentMapOutputWithContext(context.Context) VolumeAttachmentMapOutput
   165  }
   166  
   167  type VolumeAttachmentMap map[string]VolumeAttachmentInput
   168  
   169  func (VolumeAttachmentMap) ElementType() reflect.Type {
   170  	return reflect.TypeOf((*map[string]*VolumeAttachment)(nil)).Elem()
   171  }
   172  
   173  func (i VolumeAttachmentMap) ToVolumeAttachmentMapOutput() VolumeAttachmentMapOutput {
   174  	return i.ToVolumeAttachmentMapOutputWithContext(context.Background())
   175  }
   176  
   177  func (i VolumeAttachmentMap) ToVolumeAttachmentMapOutputWithContext(ctx context.Context) VolumeAttachmentMapOutput {
   178  	return pulumi.ToOutputWithContext(ctx, i).(VolumeAttachmentMapOutput)
   179  }
   180  
   181  type VolumeAttachmentOutput struct{ *pulumi.OutputState }
   182  
   183  func (VolumeAttachmentOutput) ElementType() reflect.Type {
   184  	return reflect.TypeOf((**VolumeAttachment)(nil)).Elem()
   185  }
   186  
   187  func (o VolumeAttachmentOutput) ToVolumeAttachmentOutput() VolumeAttachmentOutput {
   188  	return o
   189  }
   190  
   191  func (o VolumeAttachmentOutput) ToVolumeAttachmentOutputWithContext(ctx context.Context) VolumeAttachmentOutput {
   192  	return o
   193  }
   194  
   195  // 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
   196  func (o VolumeAttachmentOutput) ApiVersion() pulumi.StringPtrOutput {
   197  	return o.ApplyT(func(v *VolumeAttachment) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   198  }
   199  
   200  // 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
   201  func (o VolumeAttachmentOutput) Kind() pulumi.StringPtrOutput {
   202  	return o.ApplyT(func(v *VolumeAttachment) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   203  }
   204  
   205  // Standard object metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   206  func (o VolumeAttachmentOutput) Metadata() metav1.ObjectMetaPtrOutput {
   207  	return o.ApplyT(func(v *VolumeAttachment) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   208  }
   209  
   210  // Specification of the desired attach/detach volume behavior. Populated by the Kubernetes system.
   211  func (o VolumeAttachmentOutput) Spec() VolumeAttachmentSpecOutput {
   212  	return o.ApplyT(func(v *VolumeAttachment) VolumeAttachmentSpecOutput { return v.Spec }).(VolumeAttachmentSpecOutput)
   213  }
   214  
   215  // Status of the VolumeAttachment request. Populated by the entity completing the attach or detach operation, i.e. the external-attacher.
   216  func (o VolumeAttachmentOutput) Status() VolumeAttachmentStatusPtrOutput {
   217  	return o.ApplyT(func(v *VolumeAttachment) VolumeAttachmentStatusPtrOutput { return v.Status }).(VolumeAttachmentStatusPtrOutput)
   218  }
   219  
   220  type VolumeAttachmentArrayOutput struct{ *pulumi.OutputState }
   221  
   222  func (VolumeAttachmentArrayOutput) ElementType() reflect.Type {
   223  	return reflect.TypeOf((*[]*VolumeAttachment)(nil)).Elem()
   224  }
   225  
   226  func (o VolumeAttachmentArrayOutput) ToVolumeAttachmentArrayOutput() VolumeAttachmentArrayOutput {
   227  	return o
   228  }
   229  
   230  func (o VolumeAttachmentArrayOutput) ToVolumeAttachmentArrayOutputWithContext(ctx context.Context) VolumeAttachmentArrayOutput {
   231  	return o
   232  }
   233  
   234  func (o VolumeAttachmentArrayOutput) Index(i pulumi.IntInput) VolumeAttachmentOutput {
   235  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *VolumeAttachment {
   236  		return vs[0].([]*VolumeAttachment)[vs[1].(int)]
   237  	}).(VolumeAttachmentOutput)
   238  }
   239  
   240  type VolumeAttachmentMapOutput struct{ *pulumi.OutputState }
   241  
   242  func (VolumeAttachmentMapOutput) ElementType() reflect.Type {
   243  	return reflect.TypeOf((*map[string]*VolumeAttachment)(nil)).Elem()
   244  }
   245  
   246  func (o VolumeAttachmentMapOutput) ToVolumeAttachmentMapOutput() VolumeAttachmentMapOutput {
   247  	return o
   248  }
   249  
   250  func (o VolumeAttachmentMapOutput) ToVolumeAttachmentMapOutputWithContext(ctx context.Context) VolumeAttachmentMapOutput {
   251  	return o
   252  }
   253  
   254  func (o VolumeAttachmentMapOutput) MapIndex(k pulumi.StringInput) VolumeAttachmentOutput {
   255  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *VolumeAttachment {
   256  		return vs[0].(map[string]*VolumeAttachment)[vs[1].(string)]
   257  	}).(VolumeAttachmentOutput)
   258  }
   259  
   260  func init() {
   261  	pulumi.RegisterInputType(reflect.TypeOf((*VolumeAttachmentInput)(nil)).Elem(), &VolumeAttachment{})
   262  	pulumi.RegisterInputType(reflect.TypeOf((*VolumeAttachmentArrayInput)(nil)).Elem(), VolumeAttachmentArray{})
   263  	pulumi.RegisterInputType(reflect.TypeOf((*VolumeAttachmentMapInput)(nil)).Elem(), VolumeAttachmentMap{})
   264  	pulumi.RegisterOutputType(VolumeAttachmentOutput{})
   265  	pulumi.RegisterOutputType(VolumeAttachmentArrayOutput{})
   266  	pulumi.RegisterOutputType(VolumeAttachmentMapOutput{})
   267  }