github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/scheduling/v1alpha1/priorityClassPatch.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  	metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
    11  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    12  )
    13  
    14  // Patch resources are used to modify existing Kubernetes resources by using
    15  // Server-Side Apply updates. The name of the resource must be specified, but all other properties are optional. More than
    16  // one patch may be applied to the same resource, and a random FieldManager name will be used for each Patch resource.
    17  // Conflicts will result in an error by default, but can be forced using the "pulumi.com/patchForce" annotation. See the
    18  // [Server-Side Apply Docs](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/managing-resources-with-server-side-apply/) for
    19  // additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi.
    20  // DEPRECATED - This group version of PriorityClass is deprecated by scheduling.k8s.io/v1/PriorityClass. PriorityClass defines mapping from a priority class name to the priority integer value. The value can be any valid integer.
    21  type PriorityClassPatch struct {
    22  	pulumi.CustomResourceState
    23  
    24  	// 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
    25  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    26  	// description is an arbitrary string that usually provides guidelines on when this priority class should be used.
    27  	Description pulumi.StringPtrOutput `pulumi:"description"`
    28  	// globalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as `globalDefault`. However, if more than one PriorityClasses exists with their `globalDefault` field set to true, the smallest value of such global default PriorityClasses will be used as the default priority.
    29  	GlobalDefault pulumi.BoolPtrOutput `pulumi:"globalDefault"`
    30  	// 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
    31  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    32  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    33  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    34  	// PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature.
    35  	PreemptionPolicy pulumi.StringPtrOutput `pulumi:"preemptionPolicy"`
    36  	// The value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec.
    37  	Value pulumi.IntPtrOutput `pulumi:"value"`
    38  }
    39  
    40  // NewPriorityClassPatch registers a new resource with the given unique name, arguments, and options.
    41  func NewPriorityClassPatch(ctx *pulumi.Context,
    42  	name string, args *PriorityClassPatchArgs, opts ...pulumi.ResourceOption) (*PriorityClassPatch, error) {
    43  	if args == nil {
    44  		args = &PriorityClassPatchArgs{}
    45  	}
    46  
    47  	args.ApiVersion = pulumi.StringPtr("scheduling.k8s.io/v1alpha1")
    48  	args.Kind = pulumi.StringPtr("PriorityClass")
    49  	aliases := pulumi.Aliases([]pulumi.Alias{
    50  		{
    51  			Type: pulumi.String("kubernetes:scheduling.k8s.io/v1:PriorityClassPatch"),
    52  		},
    53  		{
    54  			Type: pulumi.String("kubernetes:scheduling.k8s.io/v1beta1:PriorityClassPatch"),
    55  		},
    56  	})
    57  	opts = append(opts, aliases)
    58  	var resource PriorityClassPatch
    59  	err := ctx.RegisterResource("kubernetes:scheduling.k8s.io/v1alpha1:PriorityClassPatch", name, args, &resource, opts...)
    60  	if err != nil {
    61  		return nil, err
    62  	}
    63  	return &resource, nil
    64  }
    65  
    66  // GetPriorityClassPatch gets an existing PriorityClassPatch resource's state with the given name, ID, and optional
    67  // state properties that are used to uniquely qualify the lookup (nil if not required).
    68  func GetPriorityClassPatch(ctx *pulumi.Context,
    69  	name string, id pulumi.IDInput, state *PriorityClassPatchState, opts ...pulumi.ResourceOption) (*PriorityClassPatch, error) {
    70  	var resource PriorityClassPatch
    71  	err := ctx.ReadResource("kubernetes:scheduling.k8s.io/v1alpha1:PriorityClassPatch", name, id, state, &resource, opts...)
    72  	if err != nil {
    73  		return nil, err
    74  	}
    75  	return &resource, nil
    76  }
    77  
    78  // Input properties used for looking up and filtering PriorityClassPatch resources.
    79  type priorityClassPatchState struct {
    80  }
    81  
    82  type PriorityClassPatchState struct {
    83  }
    84  
    85  func (PriorityClassPatchState) ElementType() reflect.Type {
    86  	return reflect.TypeOf((*priorityClassPatchState)(nil)).Elem()
    87  }
    88  
    89  type priorityClassPatchArgs struct {
    90  	// 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
    91  	ApiVersion *string `pulumi:"apiVersion"`
    92  	// description is an arbitrary string that usually provides guidelines on when this priority class should be used.
    93  	Description *string `pulumi:"description"`
    94  	// globalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as `globalDefault`. However, if more than one PriorityClasses exists with their `globalDefault` field set to true, the smallest value of such global default PriorityClasses will be used as the default priority.
    95  	GlobalDefault *bool `pulumi:"globalDefault"`
    96  	// 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
    97  	Kind *string `pulumi:"kind"`
    98  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    99  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
   100  	// PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature.
   101  	PreemptionPolicy *string `pulumi:"preemptionPolicy"`
   102  	// The value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec.
   103  	Value *int `pulumi:"value"`
   104  }
   105  
   106  // The set of arguments for constructing a PriorityClassPatch resource.
   107  type PriorityClassPatchArgs struct {
   108  	// 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
   109  	ApiVersion pulumi.StringPtrInput
   110  	// description is an arbitrary string that usually provides guidelines on when this priority class should be used.
   111  	Description pulumi.StringPtrInput
   112  	// globalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as `globalDefault`. However, if more than one PriorityClasses exists with their `globalDefault` field set to true, the smallest value of such global default PriorityClasses will be used as the default priority.
   113  	GlobalDefault pulumi.BoolPtrInput
   114  	// 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
   115  	Kind pulumi.StringPtrInput
   116  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   117  	Metadata metav1.ObjectMetaPatchPtrInput
   118  	// PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature.
   119  	PreemptionPolicy pulumi.StringPtrInput
   120  	// The value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec.
   121  	Value pulumi.IntPtrInput
   122  }
   123  
   124  func (PriorityClassPatchArgs) ElementType() reflect.Type {
   125  	return reflect.TypeOf((*priorityClassPatchArgs)(nil)).Elem()
   126  }
   127  
   128  type PriorityClassPatchInput interface {
   129  	pulumi.Input
   130  
   131  	ToPriorityClassPatchOutput() PriorityClassPatchOutput
   132  	ToPriorityClassPatchOutputWithContext(ctx context.Context) PriorityClassPatchOutput
   133  }
   134  
   135  func (*PriorityClassPatch) ElementType() reflect.Type {
   136  	return reflect.TypeOf((**PriorityClassPatch)(nil)).Elem()
   137  }
   138  
   139  func (i *PriorityClassPatch) ToPriorityClassPatchOutput() PriorityClassPatchOutput {
   140  	return i.ToPriorityClassPatchOutputWithContext(context.Background())
   141  }
   142  
   143  func (i *PriorityClassPatch) ToPriorityClassPatchOutputWithContext(ctx context.Context) PriorityClassPatchOutput {
   144  	return pulumi.ToOutputWithContext(ctx, i).(PriorityClassPatchOutput)
   145  }
   146  
   147  // PriorityClassPatchArrayInput is an input type that accepts PriorityClassPatchArray and PriorityClassPatchArrayOutput values.
   148  // You can construct a concrete instance of `PriorityClassPatchArrayInput` via:
   149  //
   150  //	PriorityClassPatchArray{ PriorityClassPatchArgs{...} }
   151  type PriorityClassPatchArrayInput interface {
   152  	pulumi.Input
   153  
   154  	ToPriorityClassPatchArrayOutput() PriorityClassPatchArrayOutput
   155  	ToPriorityClassPatchArrayOutputWithContext(context.Context) PriorityClassPatchArrayOutput
   156  }
   157  
   158  type PriorityClassPatchArray []PriorityClassPatchInput
   159  
   160  func (PriorityClassPatchArray) ElementType() reflect.Type {
   161  	return reflect.TypeOf((*[]*PriorityClassPatch)(nil)).Elem()
   162  }
   163  
   164  func (i PriorityClassPatchArray) ToPriorityClassPatchArrayOutput() PriorityClassPatchArrayOutput {
   165  	return i.ToPriorityClassPatchArrayOutputWithContext(context.Background())
   166  }
   167  
   168  func (i PriorityClassPatchArray) ToPriorityClassPatchArrayOutputWithContext(ctx context.Context) PriorityClassPatchArrayOutput {
   169  	return pulumi.ToOutputWithContext(ctx, i).(PriorityClassPatchArrayOutput)
   170  }
   171  
   172  // PriorityClassPatchMapInput is an input type that accepts PriorityClassPatchMap and PriorityClassPatchMapOutput values.
   173  // You can construct a concrete instance of `PriorityClassPatchMapInput` via:
   174  //
   175  //	PriorityClassPatchMap{ "key": PriorityClassPatchArgs{...} }
   176  type PriorityClassPatchMapInput interface {
   177  	pulumi.Input
   178  
   179  	ToPriorityClassPatchMapOutput() PriorityClassPatchMapOutput
   180  	ToPriorityClassPatchMapOutputWithContext(context.Context) PriorityClassPatchMapOutput
   181  }
   182  
   183  type PriorityClassPatchMap map[string]PriorityClassPatchInput
   184  
   185  func (PriorityClassPatchMap) ElementType() reflect.Type {
   186  	return reflect.TypeOf((*map[string]*PriorityClassPatch)(nil)).Elem()
   187  }
   188  
   189  func (i PriorityClassPatchMap) ToPriorityClassPatchMapOutput() PriorityClassPatchMapOutput {
   190  	return i.ToPriorityClassPatchMapOutputWithContext(context.Background())
   191  }
   192  
   193  func (i PriorityClassPatchMap) ToPriorityClassPatchMapOutputWithContext(ctx context.Context) PriorityClassPatchMapOutput {
   194  	return pulumi.ToOutputWithContext(ctx, i).(PriorityClassPatchMapOutput)
   195  }
   196  
   197  type PriorityClassPatchOutput struct{ *pulumi.OutputState }
   198  
   199  func (PriorityClassPatchOutput) ElementType() reflect.Type {
   200  	return reflect.TypeOf((**PriorityClassPatch)(nil)).Elem()
   201  }
   202  
   203  func (o PriorityClassPatchOutput) ToPriorityClassPatchOutput() PriorityClassPatchOutput {
   204  	return o
   205  }
   206  
   207  func (o PriorityClassPatchOutput) ToPriorityClassPatchOutputWithContext(ctx context.Context) PriorityClassPatchOutput {
   208  	return o
   209  }
   210  
   211  // 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
   212  func (o PriorityClassPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   213  	return o.ApplyT(func(v *PriorityClassPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   214  }
   215  
   216  // description is an arbitrary string that usually provides guidelines on when this priority class should be used.
   217  func (o PriorityClassPatchOutput) Description() pulumi.StringPtrOutput {
   218  	return o.ApplyT(func(v *PriorityClassPatch) pulumi.StringPtrOutput { return v.Description }).(pulumi.StringPtrOutput)
   219  }
   220  
   221  // globalDefault specifies whether this PriorityClass should be considered as the default priority for pods that do not have any priority class. Only one PriorityClass can be marked as `globalDefault`. However, if more than one PriorityClasses exists with their `globalDefault` field set to true, the smallest value of such global default PriorityClasses will be used as the default priority.
   222  func (o PriorityClassPatchOutput) GlobalDefault() pulumi.BoolPtrOutput {
   223  	return o.ApplyT(func(v *PriorityClassPatch) pulumi.BoolPtrOutput { return v.GlobalDefault }).(pulumi.BoolPtrOutput)
   224  }
   225  
   226  // 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
   227  func (o PriorityClassPatchOutput) Kind() pulumi.StringPtrOutput {
   228  	return o.ApplyT(func(v *PriorityClassPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   229  }
   230  
   231  // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   232  func (o PriorityClassPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   233  	return o.ApplyT(func(v *PriorityClassPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   234  }
   235  
   236  // PreemptionPolicy is the Policy for preempting pods with lower priority. One of Never, PreemptLowerPriority. Defaults to PreemptLowerPriority if unset. This field is alpha-level and is only honored by servers that enable the NonPreemptingPriority feature.
   237  func (o PriorityClassPatchOutput) PreemptionPolicy() pulumi.StringPtrOutput {
   238  	return o.ApplyT(func(v *PriorityClassPatch) pulumi.StringPtrOutput { return v.PreemptionPolicy }).(pulumi.StringPtrOutput)
   239  }
   240  
   241  // The value of this priority class. This is the actual priority that pods receive when they have the name of this class in their pod spec.
   242  func (o PriorityClassPatchOutput) Value() pulumi.IntPtrOutput {
   243  	return o.ApplyT(func(v *PriorityClassPatch) pulumi.IntPtrOutput { return v.Value }).(pulumi.IntPtrOutput)
   244  }
   245  
   246  type PriorityClassPatchArrayOutput struct{ *pulumi.OutputState }
   247  
   248  func (PriorityClassPatchArrayOutput) ElementType() reflect.Type {
   249  	return reflect.TypeOf((*[]*PriorityClassPatch)(nil)).Elem()
   250  }
   251  
   252  func (o PriorityClassPatchArrayOutput) ToPriorityClassPatchArrayOutput() PriorityClassPatchArrayOutput {
   253  	return o
   254  }
   255  
   256  func (o PriorityClassPatchArrayOutput) ToPriorityClassPatchArrayOutputWithContext(ctx context.Context) PriorityClassPatchArrayOutput {
   257  	return o
   258  }
   259  
   260  func (o PriorityClassPatchArrayOutput) Index(i pulumi.IntInput) PriorityClassPatchOutput {
   261  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PriorityClassPatch {
   262  		return vs[0].([]*PriorityClassPatch)[vs[1].(int)]
   263  	}).(PriorityClassPatchOutput)
   264  }
   265  
   266  type PriorityClassPatchMapOutput struct{ *pulumi.OutputState }
   267  
   268  func (PriorityClassPatchMapOutput) ElementType() reflect.Type {
   269  	return reflect.TypeOf((*map[string]*PriorityClassPatch)(nil)).Elem()
   270  }
   271  
   272  func (o PriorityClassPatchMapOutput) ToPriorityClassPatchMapOutput() PriorityClassPatchMapOutput {
   273  	return o
   274  }
   275  
   276  func (o PriorityClassPatchMapOutput) ToPriorityClassPatchMapOutputWithContext(ctx context.Context) PriorityClassPatchMapOutput {
   277  	return o
   278  }
   279  
   280  func (o PriorityClassPatchMapOutput) MapIndex(k pulumi.StringInput) PriorityClassPatchOutput {
   281  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PriorityClassPatch {
   282  		return vs[0].(map[string]*PriorityClassPatch)[vs[1].(string)]
   283  	}).(PriorityClassPatchOutput)
   284  }
   285  
   286  func init() {
   287  	pulumi.RegisterInputType(reflect.TypeOf((*PriorityClassPatchInput)(nil)).Elem(), &PriorityClassPatch{})
   288  	pulumi.RegisterInputType(reflect.TypeOf((*PriorityClassPatchArrayInput)(nil)).Elem(), PriorityClassPatchArray{})
   289  	pulumi.RegisterInputType(reflect.TypeOf((*PriorityClassPatchMapInput)(nil)).Elem(), PriorityClassPatchMap{})
   290  	pulumi.RegisterOutputType(PriorityClassPatchOutput{})
   291  	pulumi.RegisterOutputType(PriorityClassPatchArrayOutput{})
   292  	pulumi.RegisterOutputType(PriorityClassPatchMapOutput{})
   293  }