github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/resource/v1alpha1/podScheduling.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 v1alpha1 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 // PodScheduling objects hold information that is needed to schedule a Pod with ResourceClaims that use "WaitForFirstConsumer" allocation mode. 16 // 17 // This is an alpha type and requires enabling the DynamicResourceAllocation feature gate. 18 type PodScheduling struct { 19 pulumi.CustomResourceState 20 21 // 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 22 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 23 // 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 24 Kind pulumi.StringPtrOutput `pulumi:"kind"` 25 // Standard object metadata 26 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 27 // Spec describes where resources for the Pod are needed. 28 Spec PodSchedulingSpecOutput `pulumi:"spec"` 29 // Status describes where resources for the Pod can be allocated. 30 Status PodSchedulingStatusPtrOutput `pulumi:"status"` 31 } 32 33 // NewPodScheduling registers a new resource with the given unique name, arguments, and options. 34 func NewPodScheduling(ctx *pulumi.Context, 35 name string, args *PodSchedulingArgs, opts ...pulumi.ResourceOption) (*PodScheduling, error) { 36 if args == nil { 37 return nil, errors.New("missing one or more required arguments") 38 } 39 40 if args.Spec == nil { 41 return nil, errors.New("invalid value for required argument 'Spec'") 42 } 43 args.ApiVersion = pulumi.StringPtr("resource.k8s.io/v1alpha1") 44 args.Kind = pulumi.StringPtr("PodScheduling") 45 var resource PodScheduling 46 err := ctx.RegisterResource("kubernetes:resource.k8s.io/v1alpha1:PodScheduling", name, args, &resource, opts...) 47 if err != nil { 48 return nil, err 49 } 50 return &resource, nil 51 } 52 53 // GetPodScheduling gets an existing PodScheduling resource's state with the given name, ID, and optional 54 // state properties that are used to uniquely qualify the lookup (nil if not required). 55 func GetPodScheduling(ctx *pulumi.Context, 56 name string, id pulumi.IDInput, state *PodSchedulingState, opts ...pulumi.ResourceOption) (*PodScheduling, error) { 57 var resource PodScheduling 58 err := ctx.ReadResource("kubernetes:resource.k8s.io/v1alpha1:PodScheduling", name, id, state, &resource, opts...) 59 if err != nil { 60 return nil, err 61 } 62 return &resource, nil 63 } 64 65 // Input properties used for looking up and filtering PodScheduling resources. 66 type podSchedulingState struct { 67 } 68 69 type PodSchedulingState struct { 70 } 71 72 func (PodSchedulingState) ElementType() reflect.Type { 73 return reflect.TypeOf((*podSchedulingState)(nil)).Elem() 74 } 75 76 type podSchedulingArgs struct { 77 // 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 78 ApiVersion *string `pulumi:"apiVersion"` 79 // 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 80 Kind *string `pulumi:"kind"` 81 // Standard object metadata 82 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 83 // Spec describes where resources for the Pod are needed. 84 Spec PodSchedulingSpec `pulumi:"spec"` 85 } 86 87 // The set of arguments for constructing a PodScheduling resource. 88 type PodSchedulingArgs struct { 89 // 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 90 ApiVersion pulumi.StringPtrInput 91 // 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 92 Kind pulumi.StringPtrInput 93 // Standard object metadata 94 Metadata metav1.ObjectMetaPtrInput 95 // Spec describes where resources for the Pod are needed. 96 Spec PodSchedulingSpecInput 97 } 98 99 func (PodSchedulingArgs) ElementType() reflect.Type { 100 return reflect.TypeOf((*podSchedulingArgs)(nil)).Elem() 101 } 102 103 type PodSchedulingInput interface { 104 pulumi.Input 105 106 ToPodSchedulingOutput() PodSchedulingOutput 107 ToPodSchedulingOutputWithContext(ctx context.Context) PodSchedulingOutput 108 } 109 110 func (*PodScheduling) ElementType() reflect.Type { 111 return reflect.TypeOf((**PodScheduling)(nil)).Elem() 112 } 113 114 func (i *PodScheduling) ToPodSchedulingOutput() PodSchedulingOutput { 115 return i.ToPodSchedulingOutputWithContext(context.Background()) 116 } 117 118 func (i *PodScheduling) ToPodSchedulingOutputWithContext(ctx context.Context) PodSchedulingOutput { 119 return pulumi.ToOutputWithContext(ctx, i).(PodSchedulingOutput) 120 } 121 122 // PodSchedulingArrayInput is an input type that accepts PodSchedulingArray and PodSchedulingArrayOutput values. 123 // You can construct a concrete instance of `PodSchedulingArrayInput` via: 124 // 125 // PodSchedulingArray{ PodSchedulingArgs{...} } 126 type PodSchedulingArrayInput interface { 127 pulumi.Input 128 129 ToPodSchedulingArrayOutput() PodSchedulingArrayOutput 130 ToPodSchedulingArrayOutputWithContext(context.Context) PodSchedulingArrayOutput 131 } 132 133 type PodSchedulingArray []PodSchedulingInput 134 135 func (PodSchedulingArray) ElementType() reflect.Type { 136 return reflect.TypeOf((*[]*PodScheduling)(nil)).Elem() 137 } 138 139 func (i PodSchedulingArray) ToPodSchedulingArrayOutput() PodSchedulingArrayOutput { 140 return i.ToPodSchedulingArrayOutputWithContext(context.Background()) 141 } 142 143 func (i PodSchedulingArray) ToPodSchedulingArrayOutputWithContext(ctx context.Context) PodSchedulingArrayOutput { 144 return pulumi.ToOutputWithContext(ctx, i).(PodSchedulingArrayOutput) 145 } 146 147 // PodSchedulingMapInput is an input type that accepts PodSchedulingMap and PodSchedulingMapOutput values. 148 // You can construct a concrete instance of `PodSchedulingMapInput` via: 149 // 150 // PodSchedulingMap{ "key": PodSchedulingArgs{...} } 151 type PodSchedulingMapInput interface { 152 pulumi.Input 153 154 ToPodSchedulingMapOutput() PodSchedulingMapOutput 155 ToPodSchedulingMapOutputWithContext(context.Context) PodSchedulingMapOutput 156 } 157 158 type PodSchedulingMap map[string]PodSchedulingInput 159 160 func (PodSchedulingMap) ElementType() reflect.Type { 161 return reflect.TypeOf((*map[string]*PodScheduling)(nil)).Elem() 162 } 163 164 func (i PodSchedulingMap) ToPodSchedulingMapOutput() PodSchedulingMapOutput { 165 return i.ToPodSchedulingMapOutputWithContext(context.Background()) 166 } 167 168 func (i PodSchedulingMap) ToPodSchedulingMapOutputWithContext(ctx context.Context) PodSchedulingMapOutput { 169 return pulumi.ToOutputWithContext(ctx, i).(PodSchedulingMapOutput) 170 } 171 172 type PodSchedulingOutput struct{ *pulumi.OutputState } 173 174 func (PodSchedulingOutput) ElementType() reflect.Type { 175 return reflect.TypeOf((**PodScheduling)(nil)).Elem() 176 } 177 178 func (o PodSchedulingOutput) ToPodSchedulingOutput() PodSchedulingOutput { 179 return o 180 } 181 182 func (o PodSchedulingOutput) ToPodSchedulingOutputWithContext(ctx context.Context) PodSchedulingOutput { 183 return o 184 } 185 186 // 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 187 func (o PodSchedulingOutput) ApiVersion() pulumi.StringPtrOutput { 188 return o.ApplyT(func(v *PodScheduling) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 189 } 190 191 // 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 192 func (o PodSchedulingOutput) Kind() pulumi.StringPtrOutput { 193 return o.ApplyT(func(v *PodScheduling) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 194 } 195 196 // Standard object metadata 197 func (o PodSchedulingOutput) Metadata() metav1.ObjectMetaPtrOutput { 198 return o.ApplyT(func(v *PodScheduling) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 199 } 200 201 // Spec describes where resources for the Pod are needed. 202 func (o PodSchedulingOutput) Spec() PodSchedulingSpecOutput { 203 return o.ApplyT(func(v *PodScheduling) PodSchedulingSpecOutput { return v.Spec }).(PodSchedulingSpecOutput) 204 } 205 206 // Status describes where resources for the Pod can be allocated. 207 func (o PodSchedulingOutput) Status() PodSchedulingStatusPtrOutput { 208 return o.ApplyT(func(v *PodScheduling) PodSchedulingStatusPtrOutput { return v.Status }).(PodSchedulingStatusPtrOutput) 209 } 210 211 type PodSchedulingArrayOutput struct{ *pulumi.OutputState } 212 213 func (PodSchedulingArrayOutput) ElementType() reflect.Type { 214 return reflect.TypeOf((*[]*PodScheduling)(nil)).Elem() 215 } 216 217 func (o PodSchedulingArrayOutput) ToPodSchedulingArrayOutput() PodSchedulingArrayOutput { 218 return o 219 } 220 221 func (o PodSchedulingArrayOutput) ToPodSchedulingArrayOutputWithContext(ctx context.Context) PodSchedulingArrayOutput { 222 return o 223 } 224 225 func (o PodSchedulingArrayOutput) Index(i pulumi.IntInput) PodSchedulingOutput { 226 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PodScheduling { 227 return vs[0].([]*PodScheduling)[vs[1].(int)] 228 }).(PodSchedulingOutput) 229 } 230 231 type PodSchedulingMapOutput struct{ *pulumi.OutputState } 232 233 func (PodSchedulingMapOutput) ElementType() reflect.Type { 234 return reflect.TypeOf((*map[string]*PodScheduling)(nil)).Elem() 235 } 236 237 func (o PodSchedulingMapOutput) ToPodSchedulingMapOutput() PodSchedulingMapOutput { 238 return o 239 } 240 241 func (o PodSchedulingMapOutput) ToPodSchedulingMapOutputWithContext(ctx context.Context) PodSchedulingMapOutput { 242 return o 243 } 244 245 func (o PodSchedulingMapOutput) MapIndex(k pulumi.StringInput) PodSchedulingOutput { 246 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PodScheduling { 247 return vs[0].(map[string]*PodScheduling)[vs[1].(string)] 248 }).(PodSchedulingOutput) 249 } 250 251 func init() { 252 pulumi.RegisterInputType(reflect.TypeOf((*PodSchedulingInput)(nil)).Elem(), &PodScheduling{}) 253 pulumi.RegisterInputType(reflect.TypeOf((*PodSchedulingArrayInput)(nil)).Elem(), PodSchedulingArray{}) 254 pulumi.RegisterInputType(reflect.TypeOf((*PodSchedulingMapInput)(nil)).Elem(), PodSchedulingMap{}) 255 pulumi.RegisterOutputType(PodSchedulingOutput{}) 256 pulumi.RegisterOutputType(PodSchedulingArrayOutput{}) 257 pulumi.RegisterOutputType(PodSchedulingMapOutput{}) 258 }