github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/policy/v1beta1/podDisruptionBudgetPatch.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 v1beta1
     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  // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods
    21  type PodDisruptionBudgetPatch 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  	// 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
    27  	Kind     pulumi.StringPtrOutput          `pulumi:"kind"`
    28  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    29  	// Specification of the desired behavior of the PodDisruptionBudget.
    30  	Spec PodDisruptionBudgetSpecPatchPtrOutput `pulumi:"spec"`
    31  	// Most recently observed status of the PodDisruptionBudget.
    32  	Status PodDisruptionBudgetStatusPatchPtrOutput `pulumi:"status"`
    33  }
    34  
    35  // NewPodDisruptionBudgetPatch registers a new resource with the given unique name, arguments, and options.
    36  func NewPodDisruptionBudgetPatch(ctx *pulumi.Context,
    37  	name string, args *PodDisruptionBudgetPatchArgs, opts ...pulumi.ResourceOption) (*PodDisruptionBudgetPatch, error) {
    38  	if args == nil {
    39  		args = &PodDisruptionBudgetPatchArgs{}
    40  	}
    41  
    42  	args.ApiVersion = pulumi.StringPtr("policy/v1beta1")
    43  	args.Kind = pulumi.StringPtr("PodDisruptionBudget")
    44  	aliases := pulumi.Aliases([]pulumi.Alias{
    45  		{
    46  			Type: pulumi.String("kubernetes:policy/v1:PodDisruptionBudgetPatch"),
    47  		},
    48  	})
    49  	opts = append(opts, aliases)
    50  	var resource PodDisruptionBudgetPatch
    51  	err := ctx.RegisterResource("kubernetes:policy/v1beta1:PodDisruptionBudgetPatch", name, args, &resource, opts...)
    52  	if err != nil {
    53  		return nil, err
    54  	}
    55  	return &resource, nil
    56  }
    57  
    58  // GetPodDisruptionBudgetPatch gets an existing PodDisruptionBudgetPatch resource's state with the given name, ID, and optional
    59  // state properties that are used to uniquely qualify the lookup (nil if not required).
    60  func GetPodDisruptionBudgetPatch(ctx *pulumi.Context,
    61  	name string, id pulumi.IDInput, state *PodDisruptionBudgetPatchState, opts ...pulumi.ResourceOption) (*PodDisruptionBudgetPatch, error) {
    62  	var resource PodDisruptionBudgetPatch
    63  	err := ctx.ReadResource("kubernetes:policy/v1beta1:PodDisruptionBudgetPatch", name, id, state, &resource, opts...)
    64  	if err != nil {
    65  		return nil, err
    66  	}
    67  	return &resource, nil
    68  }
    69  
    70  // Input properties used for looking up and filtering PodDisruptionBudgetPatch resources.
    71  type podDisruptionBudgetPatchState struct {
    72  }
    73  
    74  type PodDisruptionBudgetPatchState struct {
    75  }
    76  
    77  func (PodDisruptionBudgetPatchState) ElementType() reflect.Type {
    78  	return reflect.TypeOf((*podDisruptionBudgetPatchState)(nil)).Elem()
    79  }
    80  
    81  type podDisruptionBudgetPatchArgs struct {
    82  	// 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
    83  	ApiVersion *string `pulumi:"apiVersion"`
    84  	// 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
    85  	Kind     *string                 `pulumi:"kind"`
    86  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
    87  	// Specification of the desired behavior of the PodDisruptionBudget.
    88  	Spec *PodDisruptionBudgetSpecPatch `pulumi:"spec"`
    89  }
    90  
    91  // The set of arguments for constructing a PodDisruptionBudgetPatch resource.
    92  type PodDisruptionBudgetPatchArgs struct {
    93  	// 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
    94  	ApiVersion pulumi.StringPtrInput
    95  	// 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
    96  	Kind     pulumi.StringPtrInput
    97  	Metadata metav1.ObjectMetaPatchPtrInput
    98  	// Specification of the desired behavior of the PodDisruptionBudget.
    99  	Spec PodDisruptionBudgetSpecPatchPtrInput
   100  }
   101  
   102  func (PodDisruptionBudgetPatchArgs) ElementType() reflect.Type {
   103  	return reflect.TypeOf((*podDisruptionBudgetPatchArgs)(nil)).Elem()
   104  }
   105  
   106  type PodDisruptionBudgetPatchInput interface {
   107  	pulumi.Input
   108  
   109  	ToPodDisruptionBudgetPatchOutput() PodDisruptionBudgetPatchOutput
   110  	ToPodDisruptionBudgetPatchOutputWithContext(ctx context.Context) PodDisruptionBudgetPatchOutput
   111  }
   112  
   113  func (*PodDisruptionBudgetPatch) ElementType() reflect.Type {
   114  	return reflect.TypeOf((**PodDisruptionBudgetPatch)(nil)).Elem()
   115  }
   116  
   117  func (i *PodDisruptionBudgetPatch) ToPodDisruptionBudgetPatchOutput() PodDisruptionBudgetPatchOutput {
   118  	return i.ToPodDisruptionBudgetPatchOutputWithContext(context.Background())
   119  }
   120  
   121  func (i *PodDisruptionBudgetPatch) ToPodDisruptionBudgetPatchOutputWithContext(ctx context.Context) PodDisruptionBudgetPatchOutput {
   122  	return pulumi.ToOutputWithContext(ctx, i).(PodDisruptionBudgetPatchOutput)
   123  }
   124  
   125  // PodDisruptionBudgetPatchArrayInput is an input type that accepts PodDisruptionBudgetPatchArray and PodDisruptionBudgetPatchArrayOutput values.
   126  // You can construct a concrete instance of `PodDisruptionBudgetPatchArrayInput` via:
   127  //
   128  //	PodDisruptionBudgetPatchArray{ PodDisruptionBudgetPatchArgs{...} }
   129  type PodDisruptionBudgetPatchArrayInput interface {
   130  	pulumi.Input
   131  
   132  	ToPodDisruptionBudgetPatchArrayOutput() PodDisruptionBudgetPatchArrayOutput
   133  	ToPodDisruptionBudgetPatchArrayOutputWithContext(context.Context) PodDisruptionBudgetPatchArrayOutput
   134  }
   135  
   136  type PodDisruptionBudgetPatchArray []PodDisruptionBudgetPatchInput
   137  
   138  func (PodDisruptionBudgetPatchArray) ElementType() reflect.Type {
   139  	return reflect.TypeOf((*[]*PodDisruptionBudgetPatch)(nil)).Elem()
   140  }
   141  
   142  func (i PodDisruptionBudgetPatchArray) ToPodDisruptionBudgetPatchArrayOutput() PodDisruptionBudgetPatchArrayOutput {
   143  	return i.ToPodDisruptionBudgetPatchArrayOutputWithContext(context.Background())
   144  }
   145  
   146  func (i PodDisruptionBudgetPatchArray) ToPodDisruptionBudgetPatchArrayOutputWithContext(ctx context.Context) PodDisruptionBudgetPatchArrayOutput {
   147  	return pulumi.ToOutputWithContext(ctx, i).(PodDisruptionBudgetPatchArrayOutput)
   148  }
   149  
   150  // PodDisruptionBudgetPatchMapInput is an input type that accepts PodDisruptionBudgetPatchMap and PodDisruptionBudgetPatchMapOutput values.
   151  // You can construct a concrete instance of `PodDisruptionBudgetPatchMapInput` via:
   152  //
   153  //	PodDisruptionBudgetPatchMap{ "key": PodDisruptionBudgetPatchArgs{...} }
   154  type PodDisruptionBudgetPatchMapInput interface {
   155  	pulumi.Input
   156  
   157  	ToPodDisruptionBudgetPatchMapOutput() PodDisruptionBudgetPatchMapOutput
   158  	ToPodDisruptionBudgetPatchMapOutputWithContext(context.Context) PodDisruptionBudgetPatchMapOutput
   159  }
   160  
   161  type PodDisruptionBudgetPatchMap map[string]PodDisruptionBudgetPatchInput
   162  
   163  func (PodDisruptionBudgetPatchMap) ElementType() reflect.Type {
   164  	return reflect.TypeOf((*map[string]*PodDisruptionBudgetPatch)(nil)).Elem()
   165  }
   166  
   167  func (i PodDisruptionBudgetPatchMap) ToPodDisruptionBudgetPatchMapOutput() PodDisruptionBudgetPatchMapOutput {
   168  	return i.ToPodDisruptionBudgetPatchMapOutputWithContext(context.Background())
   169  }
   170  
   171  func (i PodDisruptionBudgetPatchMap) ToPodDisruptionBudgetPatchMapOutputWithContext(ctx context.Context) PodDisruptionBudgetPatchMapOutput {
   172  	return pulumi.ToOutputWithContext(ctx, i).(PodDisruptionBudgetPatchMapOutput)
   173  }
   174  
   175  type PodDisruptionBudgetPatchOutput struct{ *pulumi.OutputState }
   176  
   177  func (PodDisruptionBudgetPatchOutput) ElementType() reflect.Type {
   178  	return reflect.TypeOf((**PodDisruptionBudgetPatch)(nil)).Elem()
   179  }
   180  
   181  func (o PodDisruptionBudgetPatchOutput) ToPodDisruptionBudgetPatchOutput() PodDisruptionBudgetPatchOutput {
   182  	return o
   183  }
   184  
   185  func (o PodDisruptionBudgetPatchOutput) ToPodDisruptionBudgetPatchOutputWithContext(ctx context.Context) PodDisruptionBudgetPatchOutput {
   186  	return o
   187  }
   188  
   189  // 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
   190  func (o PodDisruptionBudgetPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   191  	return o.ApplyT(func(v *PodDisruptionBudgetPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   192  }
   193  
   194  // 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
   195  func (o PodDisruptionBudgetPatchOutput) Kind() pulumi.StringPtrOutput {
   196  	return o.ApplyT(func(v *PodDisruptionBudgetPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   197  }
   198  
   199  func (o PodDisruptionBudgetPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   200  	return o.ApplyT(func(v *PodDisruptionBudgetPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   201  }
   202  
   203  // Specification of the desired behavior of the PodDisruptionBudget.
   204  func (o PodDisruptionBudgetPatchOutput) Spec() PodDisruptionBudgetSpecPatchPtrOutput {
   205  	return o.ApplyT(func(v *PodDisruptionBudgetPatch) PodDisruptionBudgetSpecPatchPtrOutput { return v.Spec }).(PodDisruptionBudgetSpecPatchPtrOutput)
   206  }
   207  
   208  // Most recently observed status of the PodDisruptionBudget.
   209  func (o PodDisruptionBudgetPatchOutput) Status() PodDisruptionBudgetStatusPatchPtrOutput {
   210  	return o.ApplyT(func(v *PodDisruptionBudgetPatch) PodDisruptionBudgetStatusPatchPtrOutput { return v.Status }).(PodDisruptionBudgetStatusPatchPtrOutput)
   211  }
   212  
   213  type PodDisruptionBudgetPatchArrayOutput struct{ *pulumi.OutputState }
   214  
   215  func (PodDisruptionBudgetPatchArrayOutput) ElementType() reflect.Type {
   216  	return reflect.TypeOf((*[]*PodDisruptionBudgetPatch)(nil)).Elem()
   217  }
   218  
   219  func (o PodDisruptionBudgetPatchArrayOutput) ToPodDisruptionBudgetPatchArrayOutput() PodDisruptionBudgetPatchArrayOutput {
   220  	return o
   221  }
   222  
   223  func (o PodDisruptionBudgetPatchArrayOutput) ToPodDisruptionBudgetPatchArrayOutputWithContext(ctx context.Context) PodDisruptionBudgetPatchArrayOutput {
   224  	return o
   225  }
   226  
   227  func (o PodDisruptionBudgetPatchArrayOutput) Index(i pulumi.IntInput) PodDisruptionBudgetPatchOutput {
   228  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PodDisruptionBudgetPatch {
   229  		return vs[0].([]*PodDisruptionBudgetPatch)[vs[1].(int)]
   230  	}).(PodDisruptionBudgetPatchOutput)
   231  }
   232  
   233  type PodDisruptionBudgetPatchMapOutput struct{ *pulumi.OutputState }
   234  
   235  func (PodDisruptionBudgetPatchMapOutput) ElementType() reflect.Type {
   236  	return reflect.TypeOf((*map[string]*PodDisruptionBudgetPatch)(nil)).Elem()
   237  }
   238  
   239  func (o PodDisruptionBudgetPatchMapOutput) ToPodDisruptionBudgetPatchMapOutput() PodDisruptionBudgetPatchMapOutput {
   240  	return o
   241  }
   242  
   243  func (o PodDisruptionBudgetPatchMapOutput) ToPodDisruptionBudgetPatchMapOutputWithContext(ctx context.Context) PodDisruptionBudgetPatchMapOutput {
   244  	return o
   245  }
   246  
   247  func (o PodDisruptionBudgetPatchMapOutput) MapIndex(k pulumi.StringInput) PodDisruptionBudgetPatchOutput {
   248  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PodDisruptionBudgetPatch {
   249  		return vs[0].(map[string]*PodDisruptionBudgetPatch)[vs[1].(string)]
   250  	}).(PodDisruptionBudgetPatchOutput)
   251  }
   252  
   253  func init() {
   254  	pulumi.RegisterInputType(reflect.TypeOf((*PodDisruptionBudgetPatchInput)(nil)).Elem(), &PodDisruptionBudgetPatch{})
   255  	pulumi.RegisterInputType(reflect.TypeOf((*PodDisruptionBudgetPatchArrayInput)(nil)).Elem(), PodDisruptionBudgetPatchArray{})
   256  	pulumi.RegisterInputType(reflect.TypeOf((*PodDisruptionBudgetPatchMapInput)(nil)).Elem(), PodDisruptionBudgetPatchMap{})
   257  	pulumi.RegisterOutputType(PodDisruptionBudgetPatchOutput{})
   258  	pulumi.RegisterOutputType(PodDisruptionBudgetPatchArrayOutput{})
   259  	pulumi.RegisterOutputType(PodDisruptionBudgetPatchMapOutput{})
   260  }