github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/storage/v1beta1/csidriver.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 // CSIDriver captures information about a Container Storage Interface (CSI) volume driver deployed on the cluster. CSI drivers do not need to create the CSIDriver object directly. Instead they may use the cluster-driver-registrar sidecar container. When deployed with a CSI driver it automatically creates a CSIDriver object representing the driver. Kubernetes attach detach controller uses this object to determine whether attach is required. Kubelet uses this object to determine whether pod information needs to be passed on mount. CSIDriver objects are non-namespaced. 16 type CSIDriver struct { 17 pulumi.CustomResourceState 18 19 // 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 20 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 21 // 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 22 Kind pulumi.StringPtrOutput `pulumi:"kind"` 23 // Standard object metadata. metadata.Name indicates the name of the CSI driver that this object refers to; it MUST be the same name returned by the CSI GetPluginName() call for that driver. The driver name must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and alphanumerics between. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 24 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 25 // Specification of the CSI Driver. 26 Spec CSIDriverSpecOutput `pulumi:"spec"` 27 } 28 29 // NewCSIDriver registers a new resource with the given unique name, arguments, and options. 30 func NewCSIDriver(ctx *pulumi.Context, 31 name string, args *CSIDriverArgs, opts ...pulumi.ResourceOption) (*CSIDriver, error) { 32 if args == nil { 33 return nil, errors.New("missing one or more required arguments") 34 } 35 36 if args.Spec == nil { 37 return nil, errors.New("invalid value for required argument 'Spec'") 38 } 39 args.ApiVersion = pulumi.StringPtr("storage.k8s.io/v1beta1") 40 args.Kind = pulumi.StringPtr("CSIDriver") 41 aliases := pulumi.Aliases([]pulumi.Alias{ 42 { 43 Type: pulumi.String("kubernetes:storage.k8s.io/v1:CSIDriver"), 44 }, 45 }) 46 opts = append(opts, aliases) 47 var resource CSIDriver 48 err := ctx.RegisterResource("kubernetes:storage.k8s.io/v1beta1:CSIDriver", name, args, &resource, opts...) 49 if err != nil { 50 return nil, err 51 } 52 return &resource, nil 53 } 54 55 // GetCSIDriver gets an existing CSIDriver resource's state with the given name, ID, and optional 56 // state properties that are used to uniquely qualify the lookup (nil if not required). 57 func GetCSIDriver(ctx *pulumi.Context, 58 name string, id pulumi.IDInput, state *CSIDriverState, opts ...pulumi.ResourceOption) (*CSIDriver, error) { 59 var resource CSIDriver 60 err := ctx.ReadResource("kubernetes:storage.k8s.io/v1beta1:CSIDriver", name, id, state, &resource, opts...) 61 if err != nil { 62 return nil, err 63 } 64 return &resource, nil 65 } 66 67 // Input properties used for looking up and filtering CSIDriver resources. 68 type csidriverState struct { 69 } 70 71 type CSIDriverState struct { 72 } 73 74 func (CSIDriverState) ElementType() reflect.Type { 75 return reflect.TypeOf((*csidriverState)(nil)).Elem() 76 } 77 78 type csidriverArgs struct { 79 // 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 80 ApiVersion *string `pulumi:"apiVersion"` 81 // 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 82 Kind *string `pulumi:"kind"` 83 // Standard object metadata. metadata.Name indicates the name of the CSI driver that this object refers to; it MUST be the same name returned by the CSI GetPluginName() call for that driver. The driver name must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and alphanumerics between. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 84 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 85 // Specification of the CSI Driver. 86 Spec CSIDriverSpec `pulumi:"spec"` 87 } 88 89 // The set of arguments for constructing a CSIDriver resource. 90 type CSIDriverArgs struct { 91 // 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 92 ApiVersion pulumi.StringPtrInput 93 // 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 94 Kind pulumi.StringPtrInput 95 // Standard object metadata. metadata.Name indicates the name of the CSI driver that this object refers to; it MUST be the same name returned by the CSI GetPluginName() call for that driver. The driver name must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and alphanumerics between. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 96 Metadata metav1.ObjectMetaPtrInput 97 // Specification of the CSI Driver. 98 Spec CSIDriverSpecInput 99 } 100 101 func (CSIDriverArgs) ElementType() reflect.Type { 102 return reflect.TypeOf((*csidriverArgs)(nil)).Elem() 103 } 104 105 type CSIDriverInput interface { 106 pulumi.Input 107 108 ToCSIDriverOutput() CSIDriverOutput 109 ToCSIDriverOutputWithContext(ctx context.Context) CSIDriverOutput 110 } 111 112 func (*CSIDriver) ElementType() reflect.Type { 113 return reflect.TypeOf((**CSIDriver)(nil)).Elem() 114 } 115 116 func (i *CSIDriver) ToCSIDriverOutput() CSIDriverOutput { 117 return i.ToCSIDriverOutputWithContext(context.Background()) 118 } 119 120 func (i *CSIDriver) ToCSIDriverOutputWithContext(ctx context.Context) CSIDriverOutput { 121 return pulumi.ToOutputWithContext(ctx, i).(CSIDriverOutput) 122 } 123 124 // CSIDriverArrayInput is an input type that accepts CSIDriverArray and CSIDriverArrayOutput values. 125 // You can construct a concrete instance of `CSIDriverArrayInput` via: 126 // 127 // CSIDriverArray{ CSIDriverArgs{...} } 128 type CSIDriverArrayInput interface { 129 pulumi.Input 130 131 ToCSIDriverArrayOutput() CSIDriverArrayOutput 132 ToCSIDriverArrayOutputWithContext(context.Context) CSIDriverArrayOutput 133 } 134 135 type CSIDriverArray []CSIDriverInput 136 137 func (CSIDriverArray) ElementType() reflect.Type { 138 return reflect.TypeOf((*[]*CSIDriver)(nil)).Elem() 139 } 140 141 func (i CSIDriverArray) ToCSIDriverArrayOutput() CSIDriverArrayOutput { 142 return i.ToCSIDriverArrayOutputWithContext(context.Background()) 143 } 144 145 func (i CSIDriverArray) ToCSIDriverArrayOutputWithContext(ctx context.Context) CSIDriverArrayOutput { 146 return pulumi.ToOutputWithContext(ctx, i).(CSIDriverArrayOutput) 147 } 148 149 // CSIDriverMapInput is an input type that accepts CSIDriverMap and CSIDriverMapOutput values. 150 // You can construct a concrete instance of `CSIDriverMapInput` via: 151 // 152 // CSIDriverMap{ "key": CSIDriverArgs{...} } 153 type CSIDriverMapInput interface { 154 pulumi.Input 155 156 ToCSIDriverMapOutput() CSIDriverMapOutput 157 ToCSIDriverMapOutputWithContext(context.Context) CSIDriverMapOutput 158 } 159 160 type CSIDriverMap map[string]CSIDriverInput 161 162 func (CSIDriverMap) ElementType() reflect.Type { 163 return reflect.TypeOf((*map[string]*CSIDriver)(nil)).Elem() 164 } 165 166 func (i CSIDriverMap) ToCSIDriverMapOutput() CSIDriverMapOutput { 167 return i.ToCSIDriverMapOutputWithContext(context.Background()) 168 } 169 170 func (i CSIDriverMap) ToCSIDriverMapOutputWithContext(ctx context.Context) CSIDriverMapOutput { 171 return pulumi.ToOutputWithContext(ctx, i).(CSIDriverMapOutput) 172 } 173 174 type CSIDriverOutput struct{ *pulumi.OutputState } 175 176 func (CSIDriverOutput) ElementType() reflect.Type { 177 return reflect.TypeOf((**CSIDriver)(nil)).Elem() 178 } 179 180 func (o CSIDriverOutput) ToCSIDriverOutput() CSIDriverOutput { 181 return o 182 } 183 184 func (o CSIDriverOutput) ToCSIDriverOutputWithContext(ctx context.Context) CSIDriverOutput { 185 return o 186 } 187 188 // 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 189 func (o CSIDriverOutput) ApiVersion() pulumi.StringPtrOutput { 190 return o.ApplyT(func(v *CSIDriver) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 191 } 192 193 // 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 194 func (o CSIDriverOutput) Kind() pulumi.StringPtrOutput { 195 return o.ApplyT(func(v *CSIDriver) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 196 } 197 198 // Standard object metadata. metadata.Name indicates the name of the CSI driver that this object refers to; it MUST be the same name returned by the CSI GetPluginName() call for that driver. The driver name must be 63 characters or less, beginning and ending with an alphanumeric character ([a-z0-9A-Z]) with dashes (-), dots (.), and alphanumerics between. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 199 func (o CSIDriverOutput) Metadata() metav1.ObjectMetaPtrOutput { 200 return o.ApplyT(func(v *CSIDriver) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 201 } 202 203 // Specification of the CSI Driver. 204 func (o CSIDriverOutput) Spec() CSIDriverSpecOutput { 205 return o.ApplyT(func(v *CSIDriver) CSIDriverSpecOutput { return v.Spec }).(CSIDriverSpecOutput) 206 } 207 208 type CSIDriverArrayOutput struct{ *pulumi.OutputState } 209 210 func (CSIDriverArrayOutput) ElementType() reflect.Type { 211 return reflect.TypeOf((*[]*CSIDriver)(nil)).Elem() 212 } 213 214 func (o CSIDriverArrayOutput) ToCSIDriverArrayOutput() CSIDriverArrayOutput { 215 return o 216 } 217 218 func (o CSIDriverArrayOutput) ToCSIDriverArrayOutputWithContext(ctx context.Context) CSIDriverArrayOutput { 219 return o 220 } 221 222 func (o CSIDriverArrayOutput) Index(i pulumi.IntInput) CSIDriverOutput { 223 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CSIDriver { 224 return vs[0].([]*CSIDriver)[vs[1].(int)] 225 }).(CSIDriverOutput) 226 } 227 228 type CSIDriverMapOutput struct{ *pulumi.OutputState } 229 230 func (CSIDriverMapOutput) ElementType() reflect.Type { 231 return reflect.TypeOf((*map[string]*CSIDriver)(nil)).Elem() 232 } 233 234 func (o CSIDriverMapOutput) ToCSIDriverMapOutput() CSIDriverMapOutput { 235 return o 236 } 237 238 func (o CSIDriverMapOutput) ToCSIDriverMapOutputWithContext(ctx context.Context) CSIDriverMapOutput { 239 return o 240 } 241 242 func (o CSIDriverMapOutput) MapIndex(k pulumi.StringInput) CSIDriverOutput { 243 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CSIDriver { 244 return vs[0].(map[string]*CSIDriver)[vs[1].(string)] 245 }).(CSIDriverOutput) 246 } 247 248 func init() { 249 pulumi.RegisterInputType(reflect.TypeOf((*CSIDriverInput)(nil)).Elem(), &CSIDriver{}) 250 pulumi.RegisterInputType(reflect.TypeOf((*CSIDriverArrayInput)(nil)).Elem(), CSIDriverArray{}) 251 pulumi.RegisterInputType(reflect.TypeOf((*CSIDriverMapInput)(nil)).Elem(), CSIDriverMap{}) 252 pulumi.RegisterOutputType(CSIDriverOutput{}) 253 pulumi.RegisterOutputType(CSIDriverArrayOutput{}) 254 pulumi.RegisterOutputType(CSIDriverMapOutput{}) 255 }