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