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