github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/resource/v1alpha2/podSchedulingContext.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 v1alpha2 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 // PodSchedulingContext 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 PodSchedulingContext 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 PodSchedulingContextSpecOutput `pulumi:"spec"` 29 // Status describes where resources for the Pod can be allocated. 30 Status PodSchedulingContextStatusPtrOutput `pulumi:"status"` 31 } 32 33 // NewPodSchedulingContext registers a new resource with the given unique name, arguments, and options. 34 func NewPodSchedulingContext(ctx *pulumi.Context, 35 name string, args *PodSchedulingContextArgs, opts ...pulumi.ResourceOption) (*PodSchedulingContext, 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/v1alpha2") 44 args.Kind = pulumi.StringPtr("PodSchedulingContext") 45 var resource PodSchedulingContext 46 err := ctx.RegisterResource("kubernetes:resource.k8s.io/v1alpha2:PodSchedulingContext", name, args, &resource, opts...) 47 if err != nil { 48 return nil, err 49 } 50 return &resource, nil 51 } 52 53 // GetPodSchedulingContext gets an existing PodSchedulingContext 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 GetPodSchedulingContext(ctx *pulumi.Context, 56 name string, id pulumi.IDInput, state *PodSchedulingContextState, opts ...pulumi.ResourceOption) (*PodSchedulingContext, error) { 57 var resource PodSchedulingContext 58 err := ctx.ReadResource("kubernetes:resource.k8s.io/v1alpha2:PodSchedulingContext", 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 PodSchedulingContext resources. 66 type podSchedulingContextState struct { 67 } 68 69 type PodSchedulingContextState struct { 70 } 71 72 func (PodSchedulingContextState) ElementType() reflect.Type { 73 return reflect.TypeOf((*podSchedulingContextState)(nil)).Elem() 74 } 75 76 type podSchedulingContextArgs 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 PodSchedulingContextSpec `pulumi:"spec"` 85 } 86 87 // The set of arguments for constructing a PodSchedulingContext resource. 88 type PodSchedulingContextArgs 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 PodSchedulingContextSpecInput 97 } 98 99 func (PodSchedulingContextArgs) ElementType() reflect.Type { 100 return reflect.TypeOf((*podSchedulingContextArgs)(nil)).Elem() 101 } 102 103 type PodSchedulingContextInput interface { 104 pulumi.Input 105 106 ToPodSchedulingContextOutput() PodSchedulingContextOutput 107 ToPodSchedulingContextOutputWithContext(ctx context.Context) PodSchedulingContextOutput 108 } 109 110 func (*PodSchedulingContext) ElementType() reflect.Type { 111 return reflect.TypeOf((**PodSchedulingContext)(nil)).Elem() 112 } 113 114 func (i *PodSchedulingContext) ToPodSchedulingContextOutput() PodSchedulingContextOutput { 115 return i.ToPodSchedulingContextOutputWithContext(context.Background()) 116 } 117 118 func (i *PodSchedulingContext) ToPodSchedulingContextOutputWithContext(ctx context.Context) PodSchedulingContextOutput { 119 return pulumi.ToOutputWithContext(ctx, i).(PodSchedulingContextOutput) 120 } 121 122 // PodSchedulingContextArrayInput is an input type that accepts PodSchedulingContextArray and PodSchedulingContextArrayOutput values. 123 // You can construct a concrete instance of `PodSchedulingContextArrayInput` via: 124 // 125 // PodSchedulingContextArray{ PodSchedulingContextArgs{...} } 126 type PodSchedulingContextArrayInput interface { 127 pulumi.Input 128 129 ToPodSchedulingContextArrayOutput() PodSchedulingContextArrayOutput 130 ToPodSchedulingContextArrayOutputWithContext(context.Context) PodSchedulingContextArrayOutput 131 } 132 133 type PodSchedulingContextArray []PodSchedulingContextInput 134 135 func (PodSchedulingContextArray) ElementType() reflect.Type { 136 return reflect.TypeOf((*[]*PodSchedulingContext)(nil)).Elem() 137 } 138 139 func (i PodSchedulingContextArray) ToPodSchedulingContextArrayOutput() PodSchedulingContextArrayOutput { 140 return i.ToPodSchedulingContextArrayOutputWithContext(context.Background()) 141 } 142 143 func (i PodSchedulingContextArray) ToPodSchedulingContextArrayOutputWithContext(ctx context.Context) PodSchedulingContextArrayOutput { 144 return pulumi.ToOutputWithContext(ctx, i).(PodSchedulingContextArrayOutput) 145 } 146 147 // PodSchedulingContextMapInput is an input type that accepts PodSchedulingContextMap and PodSchedulingContextMapOutput values. 148 // You can construct a concrete instance of `PodSchedulingContextMapInput` via: 149 // 150 // PodSchedulingContextMap{ "key": PodSchedulingContextArgs{...} } 151 type PodSchedulingContextMapInput interface { 152 pulumi.Input 153 154 ToPodSchedulingContextMapOutput() PodSchedulingContextMapOutput 155 ToPodSchedulingContextMapOutputWithContext(context.Context) PodSchedulingContextMapOutput 156 } 157 158 type PodSchedulingContextMap map[string]PodSchedulingContextInput 159 160 func (PodSchedulingContextMap) ElementType() reflect.Type { 161 return reflect.TypeOf((*map[string]*PodSchedulingContext)(nil)).Elem() 162 } 163 164 func (i PodSchedulingContextMap) ToPodSchedulingContextMapOutput() PodSchedulingContextMapOutput { 165 return i.ToPodSchedulingContextMapOutputWithContext(context.Background()) 166 } 167 168 func (i PodSchedulingContextMap) ToPodSchedulingContextMapOutputWithContext(ctx context.Context) PodSchedulingContextMapOutput { 169 return pulumi.ToOutputWithContext(ctx, i).(PodSchedulingContextMapOutput) 170 } 171 172 type PodSchedulingContextOutput struct{ *pulumi.OutputState } 173 174 func (PodSchedulingContextOutput) ElementType() reflect.Type { 175 return reflect.TypeOf((**PodSchedulingContext)(nil)).Elem() 176 } 177 178 func (o PodSchedulingContextOutput) ToPodSchedulingContextOutput() PodSchedulingContextOutput { 179 return o 180 } 181 182 func (o PodSchedulingContextOutput) ToPodSchedulingContextOutputWithContext(ctx context.Context) PodSchedulingContextOutput { 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 PodSchedulingContextOutput) ApiVersion() pulumi.StringPtrOutput { 188 return o.ApplyT(func(v *PodSchedulingContext) 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 PodSchedulingContextOutput) Kind() pulumi.StringPtrOutput { 193 return o.ApplyT(func(v *PodSchedulingContext) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 194 } 195 196 // Standard object metadata 197 func (o PodSchedulingContextOutput) Metadata() metav1.ObjectMetaPtrOutput { 198 return o.ApplyT(func(v *PodSchedulingContext) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 199 } 200 201 // Spec describes where resources for the Pod are needed. 202 func (o PodSchedulingContextOutput) Spec() PodSchedulingContextSpecOutput { 203 return o.ApplyT(func(v *PodSchedulingContext) PodSchedulingContextSpecOutput { return v.Spec }).(PodSchedulingContextSpecOutput) 204 } 205 206 // Status describes where resources for the Pod can be allocated. 207 func (o PodSchedulingContextOutput) Status() PodSchedulingContextStatusPtrOutput { 208 return o.ApplyT(func(v *PodSchedulingContext) PodSchedulingContextStatusPtrOutput { return v.Status }).(PodSchedulingContextStatusPtrOutput) 209 } 210 211 type PodSchedulingContextArrayOutput struct{ *pulumi.OutputState } 212 213 func (PodSchedulingContextArrayOutput) ElementType() reflect.Type { 214 return reflect.TypeOf((*[]*PodSchedulingContext)(nil)).Elem() 215 } 216 217 func (o PodSchedulingContextArrayOutput) ToPodSchedulingContextArrayOutput() PodSchedulingContextArrayOutput { 218 return o 219 } 220 221 func (o PodSchedulingContextArrayOutput) ToPodSchedulingContextArrayOutputWithContext(ctx context.Context) PodSchedulingContextArrayOutput { 222 return o 223 } 224 225 func (o PodSchedulingContextArrayOutput) Index(i pulumi.IntInput) PodSchedulingContextOutput { 226 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PodSchedulingContext { 227 return vs[0].([]*PodSchedulingContext)[vs[1].(int)] 228 }).(PodSchedulingContextOutput) 229 } 230 231 type PodSchedulingContextMapOutput struct{ *pulumi.OutputState } 232 233 func (PodSchedulingContextMapOutput) ElementType() reflect.Type { 234 return reflect.TypeOf((*map[string]*PodSchedulingContext)(nil)).Elem() 235 } 236 237 func (o PodSchedulingContextMapOutput) ToPodSchedulingContextMapOutput() PodSchedulingContextMapOutput { 238 return o 239 } 240 241 func (o PodSchedulingContextMapOutput) ToPodSchedulingContextMapOutputWithContext(ctx context.Context) PodSchedulingContextMapOutput { 242 return o 243 } 244 245 func (o PodSchedulingContextMapOutput) MapIndex(k pulumi.StringInput) PodSchedulingContextOutput { 246 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PodSchedulingContext { 247 return vs[0].(map[string]*PodSchedulingContext)[vs[1].(string)] 248 }).(PodSchedulingContextOutput) 249 } 250 251 func init() { 252 pulumi.RegisterInputType(reflect.TypeOf((*PodSchedulingContextInput)(nil)).Elem(), &PodSchedulingContext{}) 253 pulumi.RegisterInputType(reflect.TypeOf((*PodSchedulingContextArrayInput)(nil)).Elem(), PodSchedulingContextArray{}) 254 pulumi.RegisterInputType(reflect.TypeOf((*PodSchedulingContextMapInput)(nil)).Elem(), PodSchedulingContextMap{}) 255 pulumi.RegisterOutputType(PodSchedulingContextOutput{}) 256 pulumi.RegisterOutputType(PodSchedulingContextArrayOutput{}) 257 pulumi.RegisterOutputType(PodSchedulingContextMapOutput{}) 258 }