github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/persistentVolumeClaim.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  // PersistentVolumeClaim is a user's request for and claim to a persistent volume
    15  type PersistentVolumeClaim 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 desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
    25  	Spec PersistentVolumeClaimSpecPtrOutput `pulumi:"spec"`
    26  	// status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
    27  	Status PersistentVolumeClaimStatusPtrOutput `pulumi:"status"`
    28  }
    29  
    30  // NewPersistentVolumeClaim registers a new resource with the given unique name, arguments, and options.
    31  func NewPersistentVolumeClaim(ctx *pulumi.Context,
    32  	name string, args *PersistentVolumeClaimArgs, opts ...pulumi.ResourceOption) (*PersistentVolumeClaim, error) {
    33  	if args == nil {
    34  		args = &PersistentVolumeClaimArgs{}
    35  	}
    36  
    37  	args.ApiVersion = pulumi.StringPtr("v1")
    38  	args.Kind = pulumi.StringPtr("PersistentVolumeClaim")
    39  	var resource PersistentVolumeClaim
    40  	err := ctx.RegisterResource("kubernetes:core/v1:PersistentVolumeClaim", name, args, &resource, opts...)
    41  	if err != nil {
    42  		return nil, err
    43  	}
    44  	return &resource, nil
    45  }
    46  
    47  // GetPersistentVolumeClaim gets an existing PersistentVolumeClaim 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 GetPersistentVolumeClaim(ctx *pulumi.Context,
    50  	name string, id pulumi.IDInput, state *PersistentVolumeClaimState, opts ...pulumi.ResourceOption) (*PersistentVolumeClaim, error) {
    51  	var resource PersistentVolumeClaim
    52  	err := ctx.ReadResource("kubernetes:core/v1:PersistentVolumeClaim", 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 PersistentVolumeClaim resources.
    60  type persistentVolumeClaimState struct {
    61  }
    62  
    63  type PersistentVolumeClaimState struct {
    64  }
    65  
    66  func (PersistentVolumeClaimState) ElementType() reflect.Type {
    67  	return reflect.TypeOf((*persistentVolumeClaimState)(nil)).Elem()
    68  }
    69  
    70  type persistentVolumeClaimArgs 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 desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
    78  	Spec *PersistentVolumeClaimSpec `pulumi:"spec"`
    79  }
    80  
    81  // The set of arguments for constructing a PersistentVolumeClaim resource.
    82  type PersistentVolumeClaimArgs 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 desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
    90  	Spec PersistentVolumeClaimSpecPtrInput
    91  }
    92  
    93  func (PersistentVolumeClaimArgs) ElementType() reflect.Type {
    94  	return reflect.TypeOf((*persistentVolumeClaimArgs)(nil)).Elem()
    95  }
    96  
    97  type PersistentVolumeClaimInput interface {
    98  	pulumi.Input
    99  
   100  	ToPersistentVolumeClaimOutput() PersistentVolumeClaimOutput
   101  	ToPersistentVolumeClaimOutputWithContext(ctx context.Context) PersistentVolumeClaimOutput
   102  }
   103  
   104  func (*PersistentVolumeClaim) ElementType() reflect.Type {
   105  	return reflect.TypeOf((**PersistentVolumeClaim)(nil)).Elem()
   106  }
   107  
   108  func (i *PersistentVolumeClaim) ToPersistentVolumeClaimOutput() PersistentVolumeClaimOutput {
   109  	return i.ToPersistentVolumeClaimOutputWithContext(context.Background())
   110  }
   111  
   112  func (i *PersistentVolumeClaim) ToPersistentVolumeClaimOutputWithContext(ctx context.Context) PersistentVolumeClaimOutput {
   113  	return pulumi.ToOutputWithContext(ctx, i).(PersistentVolumeClaimOutput)
   114  }
   115  
   116  // PersistentVolumeClaimArrayInput is an input type that accepts PersistentVolumeClaimArray and PersistentVolumeClaimArrayOutput values.
   117  // You can construct a concrete instance of `PersistentVolumeClaimArrayInput` via:
   118  //
   119  //	PersistentVolumeClaimArray{ PersistentVolumeClaimArgs{...} }
   120  type PersistentVolumeClaimArrayInput interface {
   121  	pulumi.Input
   122  
   123  	ToPersistentVolumeClaimArrayOutput() PersistentVolumeClaimArrayOutput
   124  	ToPersistentVolumeClaimArrayOutputWithContext(context.Context) PersistentVolumeClaimArrayOutput
   125  }
   126  
   127  type PersistentVolumeClaimArray []PersistentVolumeClaimInput
   128  
   129  func (PersistentVolumeClaimArray) ElementType() reflect.Type {
   130  	return reflect.TypeOf((*[]*PersistentVolumeClaim)(nil)).Elem()
   131  }
   132  
   133  func (i PersistentVolumeClaimArray) ToPersistentVolumeClaimArrayOutput() PersistentVolumeClaimArrayOutput {
   134  	return i.ToPersistentVolumeClaimArrayOutputWithContext(context.Background())
   135  }
   136  
   137  func (i PersistentVolumeClaimArray) ToPersistentVolumeClaimArrayOutputWithContext(ctx context.Context) PersistentVolumeClaimArrayOutput {
   138  	return pulumi.ToOutputWithContext(ctx, i).(PersistentVolumeClaimArrayOutput)
   139  }
   140  
   141  // PersistentVolumeClaimMapInput is an input type that accepts PersistentVolumeClaimMap and PersistentVolumeClaimMapOutput values.
   142  // You can construct a concrete instance of `PersistentVolumeClaimMapInput` via:
   143  //
   144  //	PersistentVolumeClaimMap{ "key": PersistentVolumeClaimArgs{...} }
   145  type PersistentVolumeClaimMapInput interface {
   146  	pulumi.Input
   147  
   148  	ToPersistentVolumeClaimMapOutput() PersistentVolumeClaimMapOutput
   149  	ToPersistentVolumeClaimMapOutputWithContext(context.Context) PersistentVolumeClaimMapOutput
   150  }
   151  
   152  type PersistentVolumeClaimMap map[string]PersistentVolumeClaimInput
   153  
   154  func (PersistentVolumeClaimMap) ElementType() reflect.Type {
   155  	return reflect.TypeOf((*map[string]*PersistentVolumeClaim)(nil)).Elem()
   156  }
   157  
   158  func (i PersistentVolumeClaimMap) ToPersistentVolumeClaimMapOutput() PersistentVolumeClaimMapOutput {
   159  	return i.ToPersistentVolumeClaimMapOutputWithContext(context.Background())
   160  }
   161  
   162  func (i PersistentVolumeClaimMap) ToPersistentVolumeClaimMapOutputWithContext(ctx context.Context) PersistentVolumeClaimMapOutput {
   163  	return pulumi.ToOutputWithContext(ctx, i).(PersistentVolumeClaimMapOutput)
   164  }
   165  
   166  type PersistentVolumeClaimOutput struct{ *pulumi.OutputState }
   167  
   168  func (PersistentVolumeClaimOutput) ElementType() reflect.Type {
   169  	return reflect.TypeOf((**PersistentVolumeClaim)(nil)).Elem()
   170  }
   171  
   172  func (o PersistentVolumeClaimOutput) ToPersistentVolumeClaimOutput() PersistentVolumeClaimOutput {
   173  	return o
   174  }
   175  
   176  func (o PersistentVolumeClaimOutput) ToPersistentVolumeClaimOutputWithContext(ctx context.Context) PersistentVolumeClaimOutput {
   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 PersistentVolumeClaimOutput) ApiVersion() pulumi.StringPtrOutput {
   182  	return o.ApplyT(func(v *PersistentVolumeClaim) 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 PersistentVolumeClaimOutput) Kind() pulumi.StringPtrOutput {
   187  	return o.ApplyT(func(v *PersistentVolumeClaim) 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 PersistentVolumeClaimOutput) Metadata() metav1.ObjectMetaPtrOutput {
   192  	return o.ApplyT(func(v *PersistentVolumeClaim) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   193  }
   194  
   195  // spec defines the desired characteristics of a volume requested by a pod author. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
   196  func (o PersistentVolumeClaimOutput) Spec() PersistentVolumeClaimSpecPtrOutput {
   197  	return o.ApplyT(func(v *PersistentVolumeClaim) PersistentVolumeClaimSpecPtrOutput { return v.Spec }).(PersistentVolumeClaimSpecPtrOutput)
   198  }
   199  
   200  // status represents the current information/status of a persistent volume claim. Read-only. More info: https://kubernetes.io/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
   201  func (o PersistentVolumeClaimOutput) Status() PersistentVolumeClaimStatusPtrOutput {
   202  	return o.ApplyT(func(v *PersistentVolumeClaim) PersistentVolumeClaimStatusPtrOutput { return v.Status }).(PersistentVolumeClaimStatusPtrOutput)
   203  }
   204  
   205  type PersistentVolumeClaimArrayOutput struct{ *pulumi.OutputState }
   206  
   207  func (PersistentVolumeClaimArrayOutput) ElementType() reflect.Type {
   208  	return reflect.TypeOf((*[]*PersistentVolumeClaim)(nil)).Elem()
   209  }
   210  
   211  func (o PersistentVolumeClaimArrayOutput) ToPersistentVolumeClaimArrayOutput() PersistentVolumeClaimArrayOutput {
   212  	return o
   213  }
   214  
   215  func (o PersistentVolumeClaimArrayOutput) ToPersistentVolumeClaimArrayOutputWithContext(ctx context.Context) PersistentVolumeClaimArrayOutput {
   216  	return o
   217  }
   218  
   219  func (o PersistentVolumeClaimArrayOutput) Index(i pulumi.IntInput) PersistentVolumeClaimOutput {
   220  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PersistentVolumeClaim {
   221  		return vs[0].([]*PersistentVolumeClaim)[vs[1].(int)]
   222  	}).(PersistentVolumeClaimOutput)
   223  }
   224  
   225  type PersistentVolumeClaimMapOutput struct{ *pulumi.OutputState }
   226  
   227  func (PersistentVolumeClaimMapOutput) ElementType() reflect.Type {
   228  	return reflect.TypeOf((*map[string]*PersistentVolumeClaim)(nil)).Elem()
   229  }
   230  
   231  func (o PersistentVolumeClaimMapOutput) ToPersistentVolumeClaimMapOutput() PersistentVolumeClaimMapOutput {
   232  	return o
   233  }
   234  
   235  func (o PersistentVolumeClaimMapOutput) ToPersistentVolumeClaimMapOutputWithContext(ctx context.Context) PersistentVolumeClaimMapOutput {
   236  	return o
   237  }
   238  
   239  func (o PersistentVolumeClaimMapOutput) MapIndex(k pulumi.StringInput) PersistentVolumeClaimOutput {
   240  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PersistentVolumeClaim {
   241  		return vs[0].(map[string]*PersistentVolumeClaim)[vs[1].(string)]
   242  	}).(PersistentVolumeClaimOutput)
   243  }
   244  
   245  func init() {
   246  	pulumi.RegisterInputType(reflect.TypeOf((*PersistentVolumeClaimInput)(nil)).Elem(), &PersistentVolumeClaim{})
   247  	pulumi.RegisterInputType(reflect.TypeOf((*PersistentVolumeClaimArrayInput)(nil)).Elem(), PersistentVolumeClaimArray{})
   248  	pulumi.RegisterInputType(reflect.TypeOf((*PersistentVolumeClaimMapInput)(nil)).Elem(), PersistentVolumeClaimMap{})
   249  	pulumi.RegisterOutputType(PersistentVolumeClaimOutput{})
   250  	pulumi.RegisterOutputType(PersistentVolumeClaimArrayOutput{})
   251  	pulumi.RegisterOutputType(PersistentVolumeClaimMapOutput{})
   252  }