github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/podTemplate.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 // PodTemplate describes a template for creating copies of a predefined pod. 15 type PodTemplate 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 // Template defines the pods that will be created from this pod template. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 25 Template PodTemplateSpecPtrOutput `pulumi:"template"` 26 } 27 28 // NewPodTemplate registers a new resource with the given unique name, arguments, and options. 29 func NewPodTemplate(ctx *pulumi.Context, 30 name string, args *PodTemplateArgs, opts ...pulumi.ResourceOption) (*PodTemplate, error) { 31 if args == nil { 32 args = &PodTemplateArgs{} 33 } 34 35 args.ApiVersion = pulumi.StringPtr("v1") 36 args.Kind = pulumi.StringPtr("PodTemplate") 37 var resource PodTemplate 38 err := ctx.RegisterResource("kubernetes:core/v1:PodTemplate", name, args, &resource, opts...) 39 if err != nil { 40 return nil, err 41 } 42 return &resource, nil 43 } 44 45 // GetPodTemplate gets an existing PodTemplate resource's state with the given name, ID, and optional 46 // state properties that are used to uniquely qualify the lookup (nil if not required). 47 func GetPodTemplate(ctx *pulumi.Context, 48 name string, id pulumi.IDInput, state *PodTemplateState, opts ...pulumi.ResourceOption) (*PodTemplate, error) { 49 var resource PodTemplate 50 err := ctx.ReadResource("kubernetes:core/v1:PodTemplate", name, id, state, &resource, opts...) 51 if err != nil { 52 return nil, err 53 } 54 return &resource, nil 55 } 56 57 // Input properties used for looking up and filtering PodTemplate resources. 58 type podTemplateState struct { 59 } 60 61 type PodTemplateState struct { 62 } 63 64 func (PodTemplateState) ElementType() reflect.Type { 65 return reflect.TypeOf((*podTemplateState)(nil)).Elem() 66 } 67 68 type podTemplateArgs struct { 69 // 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 70 ApiVersion *string `pulumi:"apiVersion"` 71 // 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 72 Kind *string `pulumi:"kind"` 73 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 74 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 75 // Template defines the pods that will be created from this pod template. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 76 Template *PodTemplateSpec `pulumi:"template"` 77 } 78 79 // The set of arguments for constructing a PodTemplate resource. 80 type PodTemplateArgs struct { 81 // 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 82 ApiVersion pulumi.StringPtrInput 83 // 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 84 Kind pulumi.StringPtrInput 85 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 86 Metadata metav1.ObjectMetaPtrInput 87 // Template defines the pods that will be created from this pod template. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 88 Template PodTemplateSpecPtrInput 89 } 90 91 func (PodTemplateArgs) ElementType() reflect.Type { 92 return reflect.TypeOf((*podTemplateArgs)(nil)).Elem() 93 } 94 95 type PodTemplateInput interface { 96 pulumi.Input 97 98 ToPodTemplateOutput() PodTemplateOutput 99 ToPodTemplateOutputWithContext(ctx context.Context) PodTemplateOutput 100 } 101 102 func (*PodTemplate) ElementType() reflect.Type { 103 return reflect.TypeOf((**PodTemplate)(nil)).Elem() 104 } 105 106 func (i *PodTemplate) ToPodTemplateOutput() PodTemplateOutput { 107 return i.ToPodTemplateOutputWithContext(context.Background()) 108 } 109 110 func (i *PodTemplate) ToPodTemplateOutputWithContext(ctx context.Context) PodTemplateOutput { 111 return pulumi.ToOutputWithContext(ctx, i).(PodTemplateOutput) 112 } 113 114 // PodTemplateArrayInput is an input type that accepts PodTemplateArray and PodTemplateArrayOutput values. 115 // You can construct a concrete instance of `PodTemplateArrayInput` via: 116 // 117 // PodTemplateArray{ PodTemplateArgs{...} } 118 type PodTemplateArrayInput interface { 119 pulumi.Input 120 121 ToPodTemplateArrayOutput() PodTemplateArrayOutput 122 ToPodTemplateArrayOutputWithContext(context.Context) PodTemplateArrayOutput 123 } 124 125 type PodTemplateArray []PodTemplateInput 126 127 func (PodTemplateArray) ElementType() reflect.Type { 128 return reflect.TypeOf((*[]*PodTemplate)(nil)).Elem() 129 } 130 131 func (i PodTemplateArray) ToPodTemplateArrayOutput() PodTemplateArrayOutput { 132 return i.ToPodTemplateArrayOutputWithContext(context.Background()) 133 } 134 135 func (i PodTemplateArray) ToPodTemplateArrayOutputWithContext(ctx context.Context) PodTemplateArrayOutput { 136 return pulumi.ToOutputWithContext(ctx, i).(PodTemplateArrayOutput) 137 } 138 139 // PodTemplateMapInput is an input type that accepts PodTemplateMap and PodTemplateMapOutput values. 140 // You can construct a concrete instance of `PodTemplateMapInput` via: 141 // 142 // PodTemplateMap{ "key": PodTemplateArgs{...} } 143 type PodTemplateMapInput interface { 144 pulumi.Input 145 146 ToPodTemplateMapOutput() PodTemplateMapOutput 147 ToPodTemplateMapOutputWithContext(context.Context) PodTemplateMapOutput 148 } 149 150 type PodTemplateMap map[string]PodTemplateInput 151 152 func (PodTemplateMap) ElementType() reflect.Type { 153 return reflect.TypeOf((*map[string]*PodTemplate)(nil)).Elem() 154 } 155 156 func (i PodTemplateMap) ToPodTemplateMapOutput() PodTemplateMapOutput { 157 return i.ToPodTemplateMapOutputWithContext(context.Background()) 158 } 159 160 func (i PodTemplateMap) ToPodTemplateMapOutputWithContext(ctx context.Context) PodTemplateMapOutput { 161 return pulumi.ToOutputWithContext(ctx, i).(PodTemplateMapOutput) 162 } 163 164 type PodTemplateOutput struct{ *pulumi.OutputState } 165 166 func (PodTemplateOutput) ElementType() reflect.Type { 167 return reflect.TypeOf((**PodTemplate)(nil)).Elem() 168 } 169 170 func (o PodTemplateOutput) ToPodTemplateOutput() PodTemplateOutput { 171 return o 172 } 173 174 func (o PodTemplateOutput) ToPodTemplateOutputWithContext(ctx context.Context) PodTemplateOutput { 175 return o 176 } 177 178 // 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 179 func (o PodTemplateOutput) ApiVersion() pulumi.StringPtrOutput { 180 return o.ApplyT(func(v *PodTemplate) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 181 } 182 183 // 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 184 func (o PodTemplateOutput) Kind() pulumi.StringPtrOutput { 185 return o.ApplyT(func(v *PodTemplate) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 186 } 187 188 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 189 func (o PodTemplateOutput) Metadata() metav1.ObjectMetaPtrOutput { 190 return o.ApplyT(func(v *PodTemplate) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 191 } 192 193 // Template defines the pods that will be created from this pod template. https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 194 func (o PodTemplateOutput) Template() PodTemplateSpecPtrOutput { 195 return o.ApplyT(func(v *PodTemplate) PodTemplateSpecPtrOutput { return v.Template }).(PodTemplateSpecPtrOutput) 196 } 197 198 type PodTemplateArrayOutput struct{ *pulumi.OutputState } 199 200 func (PodTemplateArrayOutput) ElementType() reflect.Type { 201 return reflect.TypeOf((*[]*PodTemplate)(nil)).Elem() 202 } 203 204 func (o PodTemplateArrayOutput) ToPodTemplateArrayOutput() PodTemplateArrayOutput { 205 return o 206 } 207 208 func (o PodTemplateArrayOutput) ToPodTemplateArrayOutputWithContext(ctx context.Context) PodTemplateArrayOutput { 209 return o 210 } 211 212 func (o PodTemplateArrayOutput) Index(i pulumi.IntInput) PodTemplateOutput { 213 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PodTemplate { 214 return vs[0].([]*PodTemplate)[vs[1].(int)] 215 }).(PodTemplateOutput) 216 } 217 218 type PodTemplateMapOutput struct{ *pulumi.OutputState } 219 220 func (PodTemplateMapOutput) ElementType() reflect.Type { 221 return reflect.TypeOf((*map[string]*PodTemplate)(nil)).Elem() 222 } 223 224 func (o PodTemplateMapOutput) ToPodTemplateMapOutput() PodTemplateMapOutput { 225 return o 226 } 227 228 func (o PodTemplateMapOutput) ToPodTemplateMapOutputWithContext(ctx context.Context) PodTemplateMapOutput { 229 return o 230 } 231 232 func (o PodTemplateMapOutput) MapIndex(k pulumi.StringInput) PodTemplateOutput { 233 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PodTemplate { 234 return vs[0].(map[string]*PodTemplate)[vs[1].(string)] 235 }).(PodTemplateOutput) 236 } 237 238 func init() { 239 pulumi.RegisterInputType(reflect.TypeOf((*PodTemplateInput)(nil)).Elem(), &PodTemplate{}) 240 pulumi.RegisterInputType(reflect.TypeOf((*PodTemplateArrayInput)(nil)).Elem(), PodTemplateArray{}) 241 pulumi.RegisterInputType(reflect.TypeOf((*PodTemplateMapInput)(nil)).Elem(), PodTemplateMap{}) 242 pulumi.RegisterOutputType(PodTemplateOutput{}) 243 pulumi.RegisterOutputType(PodTemplateArrayOutput{}) 244 pulumi.RegisterOutputType(PodTemplateMapOutput{}) 245 }