github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/storage/v1/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 v1 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 type CSINode 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's metadata. metadata.name must be the Kubernetes node name. 24 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 25 // spec is the specification of CSINode 26 Spec CSINodeSpecOutput `pulumi:"spec"` 27 } 28 29 // NewCSINode registers a new resource with the given unique name, arguments, and options. 30 func NewCSINode(ctx *pulumi.Context, 31 name string, args *CSINodeArgs, opts ...pulumi.ResourceOption) (*CSINode, 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/v1") 40 args.Kind = pulumi.StringPtr("CSINode") 41 aliases := pulumi.Aliases([]pulumi.Alias{ 42 { 43 Type: pulumi.String("kubernetes:storage.k8s.io/v1beta1:CSINode"), 44 }, 45 }) 46 opts = append(opts, aliases) 47 var resource CSINode 48 err := ctx.RegisterResource("kubernetes:storage.k8s.io/v1:CSINode", name, args, &resource, opts...) 49 if err != nil { 50 return nil, err 51 } 52 return &resource, nil 53 } 54 55 // GetCSINode gets an existing CSINode 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 GetCSINode(ctx *pulumi.Context, 58 name string, id pulumi.IDInput, state *CSINodeState, opts ...pulumi.ResourceOption) (*CSINode, error) { 59 var resource CSINode 60 err := ctx.ReadResource("kubernetes:storage.k8s.io/v1:CSINode", 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 CSINode resources. 68 type csinodeState struct { 69 } 70 71 type CSINodeState struct { 72 } 73 74 func (CSINodeState) ElementType() reflect.Type { 75 return reflect.TypeOf((*csinodeState)(nil)).Elem() 76 } 77 78 type csinodeArgs 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's metadata. metadata.name must be the Kubernetes node name. 84 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 85 // spec is the specification of CSINode 86 Spec CSINodeSpec `pulumi:"spec"` 87 } 88 89 // The set of arguments for constructing a CSINode resource. 90 type CSINodeArgs 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's metadata. metadata.name must be the Kubernetes node name. 96 Metadata metav1.ObjectMetaPtrInput 97 // spec is the specification of CSINode 98 Spec CSINodeSpecInput 99 } 100 101 func (CSINodeArgs) ElementType() reflect.Type { 102 return reflect.TypeOf((*csinodeArgs)(nil)).Elem() 103 } 104 105 type CSINodeInput interface { 106 pulumi.Input 107 108 ToCSINodeOutput() CSINodeOutput 109 ToCSINodeOutputWithContext(ctx context.Context) CSINodeOutput 110 } 111 112 func (*CSINode) ElementType() reflect.Type { 113 return reflect.TypeOf((**CSINode)(nil)).Elem() 114 } 115 116 func (i *CSINode) ToCSINodeOutput() CSINodeOutput { 117 return i.ToCSINodeOutputWithContext(context.Background()) 118 } 119 120 func (i *CSINode) ToCSINodeOutputWithContext(ctx context.Context) CSINodeOutput { 121 return pulumi.ToOutputWithContext(ctx, i).(CSINodeOutput) 122 } 123 124 // CSINodeArrayInput is an input type that accepts CSINodeArray and CSINodeArrayOutput values. 125 // You can construct a concrete instance of `CSINodeArrayInput` via: 126 // 127 // CSINodeArray{ CSINodeArgs{...} } 128 type CSINodeArrayInput interface { 129 pulumi.Input 130 131 ToCSINodeArrayOutput() CSINodeArrayOutput 132 ToCSINodeArrayOutputWithContext(context.Context) CSINodeArrayOutput 133 } 134 135 type CSINodeArray []CSINodeInput 136 137 func (CSINodeArray) ElementType() reflect.Type { 138 return reflect.TypeOf((*[]*CSINode)(nil)).Elem() 139 } 140 141 func (i CSINodeArray) ToCSINodeArrayOutput() CSINodeArrayOutput { 142 return i.ToCSINodeArrayOutputWithContext(context.Background()) 143 } 144 145 func (i CSINodeArray) ToCSINodeArrayOutputWithContext(ctx context.Context) CSINodeArrayOutput { 146 return pulumi.ToOutputWithContext(ctx, i).(CSINodeArrayOutput) 147 } 148 149 // CSINodeMapInput is an input type that accepts CSINodeMap and CSINodeMapOutput values. 150 // You can construct a concrete instance of `CSINodeMapInput` via: 151 // 152 // CSINodeMap{ "key": CSINodeArgs{...} } 153 type CSINodeMapInput interface { 154 pulumi.Input 155 156 ToCSINodeMapOutput() CSINodeMapOutput 157 ToCSINodeMapOutputWithContext(context.Context) CSINodeMapOutput 158 } 159 160 type CSINodeMap map[string]CSINodeInput 161 162 func (CSINodeMap) ElementType() reflect.Type { 163 return reflect.TypeOf((*map[string]*CSINode)(nil)).Elem() 164 } 165 166 func (i CSINodeMap) ToCSINodeMapOutput() CSINodeMapOutput { 167 return i.ToCSINodeMapOutputWithContext(context.Background()) 168 } 169 170 func (i CSINodeMap) ToCSINodeMapOutputWithContext(ctx context.Context) CSINodeMapOutput { 171 return pulumi.ToOutputWithContext(ctx, i).(CSINodeMapOutput) 172 } 173 174 type CSINodeOutput struct{ *pulumi.OutputState } 175 176 func (CSINodeOutput) ElementType() reflect.Type { 177 return reflect.TypeOf((**CSINode)(nil)).Elem() 178 } 179 180 func (o CSINodeOutput) ToCSINodeOutput() CSINodeOutput { 181 return o 182 } 183 184 func (o CSINodeOutput) ToCSINodeOutputWithContext(ctx context.Context) CSINodeOutput { 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 CSINodeOutput) ApiVersion() pulumi.StringPtrOutput { 190 return o.ApplyT(func(v *CSINode) 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 CSINodeOutput) Kind() pulumi.StringPtrOutput { 195 return o.ApplyT(func(v *CSINode) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 196 } 197 198 // Standard object's metadata. metadata.name must be the Kubernetes node name. 199 func (o CSINodeOutput) Metadata() metav1.ObjectMetaPtrOutput { 200 return o.ApplyT(func(v *CSINode) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 201 } 202 203 // spec is the specification of CSINode 204 func (o CSINodeOutput) Spec() CSINodeSpecOutput { 205 return o.ApplyT(func(v *CSINode) CSINodeSpecOutput { return v.Spec }).(CSINodeSpecOutput) 206 } 207 208 type CSINodeArrayOutput struct{ *pulumi.OutputState } 209 210 func (CSINodeArrayOutput) ElementType() reflect.Type { 211 return reflect.TypeOf((*[]*CSINode)(nil)).Elem() 212 } 213 214 func (o CSINodeArrayOutput) ToCSINodeArrayOutput() CSINodeArrayOutput { 215 return o 216 } 217 218 func (o CSINodeArrayOutput) ToCSINodeArrayOutputWithContext(ctx context.Context) CSINodeArrayOutput { 219 return o 220 } 221 222 func (o CSINodeArrayOutput) Index(i pulumi.IntInput) CSINodeOutput { 223 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *CSINode { 224 return vs[0].([]*CSINode)[vs[1].(int)] 225 }).(CSINodeOutput) 226 } 227 228 type CSINodeMapOutput struct{ *pulumi.OutputState } 229 230 func (CSINodeMapOutput) ElementType() reflect.Type { 231 return reflect.TypeOf((*map[string]*CSINode)(nil)).Elem() 232 } 233 234 func (o CSINodeMapOutput) ToCSINodeMapOutput() CSINodeMapOutput { 235 return o 236 } 237 238 func (o CSINodeMapOutput) ToCSINodeMapOutputWithContext(ctx context.Context) CSINodeMapOutput { 239 return o 240 } 241 242 func (o CSINodeMapOutput) MapIndex(k pulumi.StringInput) CSINodeOutput { 243 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *CSINode { 244 return vs[0].(map[string]*CSINode)[vs[1].(string)] 245 }).(CSINodeOutput) 246 } 247 248 func init() { 249 pulumi.RegisterInputType(reflect.TypeOf((*CSINodeInput)(nil)).Elem(), &CSINode{}) 250 pulumi.RegisterInputType(reflect.TypeOf((*CSINodeArrayInput)(nil)).Elem(), CSINodeArray{}) 251 pulumi.RegisterInputType(reflect.TypeOf((*CSINodeMapInput)(nil)).Elem(), CSINodeMap{}) 252 pulumi.RegisterOutputType(CSINodeOutput{}) 253 pulumi.RegisterOutputType(CSINodeArrayOutput{}) 254 pulumi.RegisterOutputType(CSINodeMapOutput{}) 255 }