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