github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/batch/v1/jobPatch.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  // Job represents the configuration of a single job.
    21  //
    22  // This resource waits until its status is ready before registering success
    23  // for create/update, and populating output properties from the current state of the resource.
    24  // The following conditions are used to determine whether the resource creation has
    25  // succeeded or failed:
    26  //
    27  //  1. The Job's '.status.startTime' is set, which indicates that the Job has started running.
    28  //  2. The Job's '.status.conditions' has a status of type 'Complete', and a 'status' set
    29  //     to 'True'.
    30  //  3. The Job's '.status.conditions' do not have a status of type 'Failed', with a
    31  //     'status' set to 'True'. If this condition is set, we should fail the Job immediately.
    32  //
    33  // If the Job has not reached a Ready state after 10 minutes, it will
    34  // time out and mark the resource update as Failed. You can override the default timeout value
    35  // by setting the 'customTimeouts' option on the resource.
    36  //
    37  // By default, if a resource failed to become ready in a previous update,
    38  // Pulumi will continue to wait for readiness on the next update. If you would prefer
    39  // to schedule a replacement for an unready resource on the next update, you can add the
    40  // "pulumi.com/replaceUnready": "true" annotation to the resource definition.
    41  type JobPatch struct {
    42  	pulumi.CustomResourceState
    43  
    44  	// 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
    45  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    46  	// 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
    47  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    48  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
    49  	Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"`
    50  	// Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    51  	Spec JobSpecPatchPtrOutput `pulumi:"spec"`
    52  	// Current status of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
    53  	Status JobStatusPatchPtrOutput `pulumi:"status"`
    54  }
    55  
    56  // NewJobPatch registers a new resource with the given unique name, arguments, and options.
    57  func NewJobPatch(ctx *pulumi.Context,
    58  	name string, args *JobPatchArgs, opts ...pulumi.ResourceOption) (*JobPatch, error) {
    59  	if args == nil {
    60  		args = &JobPatchArgs{}
    61  	}
    62  
    63  	args.ApiVersion = pulumi.StringPtr("batch/v1")
    64  	args.Kind = pulumi.StringPtr("Job")
    65  	var resource JobPatch
    66  	err := ctx.RegisterResource("kubernetes:batch/v1:JobPatch", name, args, &resource, opts...)
    67  	if err != nil {
    68  		return nil, err
    69  	}
    70  	return &resource, nil
    71  }
    72  
    73  // GetJobPatch gets an existing JobPatch resource's state with the given name, ID, and optional
    74  // state properties that are used to uniquely qualify the lookup (nil if not required).
    75  func GetJobPatch(ctx *pulumi.Context,
    76  	name string, id pulumi.IDInput, state *JobPatchState, opts ...pulumi.ResourceOption) (*JobPatch, error) {
    77  	var resource JobPatch
    78  	err := ctx.ReadResource("kubernetes:batch/v1:JobPatch", name, id, state, &resource, opts...)
    79  	if err != nil {
    80  		return nil, err
    81  	}
    82  	return &resource, nil
    83  }
    84  
    85  // Input properties used for looking up and filtering JobPatch resources.
    86  type jobPatchState struct {
    87  }
    88  
    89  type JobPatchState struct {
    90  }
    91  
    92  func (JobPatchState) ElementType() reflect.Type {
    93  	return reflect.TypeOf((*jobPatchState)(nil)).Elem()
    94  }
    95  
    96  type jobPatchArgs struct {
    97  	// 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
    98  	ApiVersion *string `pulumi:"apiVersion"`
    99  	// 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
   100  	Kind *string `pulumi:"kind"`
   101  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   102  	Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"`
   103  	// Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   104  	Spec *JobSpecPatch `pulumi:"spec"`
   105  }
   106  
   107  // The set of arguments for constructing a JobPatch resource.
   108  type JobPatchArgs struct {
   109  	// 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
   110  	ApiVersion pulumi.StringPtrInput
   111  	// 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
   112  	Kind pulumi.StringPtrInput
   113  	// Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   114  	Metadata metav1.ObjectMetaPatchPtrInput
   115  	// Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   116  	Spec JobSpecPatchPtrInput
   117  }
   118  
   119  func (JobPatchArgs) ElementType() reflect.Type {
   120  	return reflect.TypeOf((*jobPatchArgs)(nil)).Elem()
   121  }
   122  
   123  type JobPatchInput interface {
   124  	pulumi.Input
   125  
   126  	ToJobPatchOutput() JobPatchOutput
   127  	ToJobPatchOutputWithContext(ctx context.Context) JobPatchOutput
   128  }
   129  
   130  func (*JobPatch) ElementType() reflect.Type {
   131  	return reflect.TypeOf((**JobPatch)(nil)).Elem()
   132  }
   133  
   134  func (i *JobPatch) ToJobPatchOutput() JobPatchOutput {
   135  	return i.ToJobPatchOutputWithContext(context.Background())
   136  }
   137  
   138  func (i *JobPatch) ToJobPatchOutputWithContext(ctx context.Context) JobPatchOutput {
   139  	return pulumi.ToOutputWithContext(ctx, i).(JobPatchOutput)
   140  }
   141  
   142  // JobPatchArrayInput is an input type that accepts JobPatchArray and JobPatchArrayOutput values.
   143  // You can construct a concrete instance of `JobPatchArrayInput` via:
   144  //
   145  //	JobPatchArray{ JobPatchArgs{...} }
   146  type JobPatchArrayInput interface {
   147  	pulumi.Input
   148  
   149  	ToJobPatchArrayOutput() JobPatchArrayOutput
   150  	ToJobPatchArrayOutputWithContext(context.Context) JobPatchArrayOutput
   151  }
   152  
   153  type JobPatchArray []JobPatchInput
   154  
   155  func (JobPatchArray) ElementType() reflect.Type {
   156  	return reflect.TypeOf((*[]*JobPatch)(nil)).Elem()
   157  }
   158  
   159  func (i JobPatchArray) ToJobPatchArrayOutput() JobPatchArrayOutput {
   160  	return i.ToJobPatchArrayOutputWithContext(context.Background())
   161  }
   162  
   163  func (i JobPatchArray) ToJobPatchArrayOutputWithContext(ctx context.Context) JobPatchArrayOutput {
   164  	return pulumi.ToOutputWithContext(ctx, i).(JobPatchArrayOutput)
   165  }
   166  
   167  // JobPatchMapInput is an input type that accepts JobPatchMap and JobPatchMapOutput values.
   168  // You can construct a concrete instance of `JobPatchMapInput` via:
   169  //
   170  //	JobPatchMap{ "key": JobPatchArgs{...} }
   171  type JobPatchMapInput interface {
   172  	pulumi.Input
   173  
   174  	ToJobPatchMapOutput() JobPatchMapOutput
   175  	ToJobPatchMapOutputWithContext(context.Context) JobPatchMapOutput
   176  }
   177  
   178  type JobPatchMap map[string]JobPatchInput
   179  
   180  func (JobPatchMap) ElementType() reflect.Type {
   181  	return reflect.TypeOf((*map[string]*JobPatch)(nil)).Elem()
   182  }
   183  
   184  func (i JobPatchMap) ToJobPatchMapOutput() JobPatchMapOutput {
   185  	return i.ToJobPatchMapOutputWithContext(context.Background())
   186  }
   187  
   188  func (i JobPatchMap) ToJobPatchMapOutputWithContext(ctx context.Context) JobPatchMapOutput {
   189  	return pulumi.ToOutputWithContext(ctx, i).(JobPatchMapOutput)
   190  }
   191  
   192  type JobPatchOutput struct{ *pulumi.OutputState }
   193  
   194  func (JobPatchOutput) ElementType() reflect.Type {
   195  	return reflect.TypeOf((**JobPatch)(nil)).Elem()
   196  }
   197  
   198  func (o JobPatchOutput) ToJobPatchOutput() JobPatchOutput {
   199  	return o
   200  }
   201  
   202  func (o JobPatchOutput) ToJobPatchOutputWithContext(ctx context.Context) JobPatchOutput {
   203  	return o
   204  }
   205  
   206  // 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
   207  func (o JobPatchOutput) ApiVersion() pulumi.StringPtrOutput {
   208  	return o.ApplyT(func(v *JobPatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   209  }
   210  
   211  // 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
   212  func (o JobPatchOutput) Kind() pulumi.StringPtrOutput {
   213  	return o.ApplyT(func(v *JobPatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   214  }
   215  
   216  // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
   217  func (o JobPatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput {
   218  	return o.ApplyT(func(v *JobPatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput)
   219  }
   220  
   221  // Specification of the desired behavior of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   222  func (o JobPatchOutput) Spec() JobSpecPatchPtrOutput {
   223  	return o.ApplyT(func(v *JobPatch) JobSpecPatchPtrOutput { return v.Spec }).(JobSpecPatchPtrOutput)
   224  }
   225  
   226  // Current status of a job. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
   227  func (o JobPatchOutput) Status() JobStatusPatchPtrOutput {
   228  	return o.ApplyT(func(v *JobPatch) JobStatusPatchPtrOutput { return v.Status }).(JobStatusPatchPtrOutput)
   229  }
   230  
   231  type JobPatchArrayOutput struct{ *pulumi.OutputState }
   232  
   233  func (JobPatchArrayOutput) ElementType() reflect.Type {
   234  	return reflect.TypeOf((*[]*JobPatch)(nil)).Elem()
   235  }
   236  
   237  func (o JobPatchArrayOutput) ToJobPatchArrayOutput() JobPatchArrayOutput {
   238  	return o
   239  }
   240  
   241  func (o JobPatchArrayOutput) ToJobPatchArrayOutputWithContext(ctx context.Context) JobPatchArrayOutput {
   242  	return o
   243  }
   244  
   245  func (o JobPatchArrayOutput) Index(i pulumi.IntInput) JobPatchOutput {
   246  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *JobPatch {
   247  		return vs[0].([]*JobPatch)[vs[1].(int)]
   248  	}).(JobPatchOutput)
   249  }
   250  
   251  type JobPatchMapOutput struct{ *pulumi.OutputState }
   252  
   253  func (JobPatchMapOutput) ElementType() reflect.Type {
   254  	return reflect.TypeOf((*map[string]*JobPatch)(nil)).Elem()
   255  }
   256  
   257  func (o JobPatchMapOutput) ToJobPatchMapOutput() JobPatchMapOutput {
   258  	return o
   259  }
   260  
   261  func (o JobPatchMapOutput) ToJobPatchMapOutputWithContext(ctx context.Context) JobPatchMapOutput {
   262  	return o
   263  }
   264  
   265  func (o JobPatchMapOutput) MapIndex(k pulumi.StringInput) JobPatchOutput {
   266  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *JobPatch {
   267  		return vs[0].(map[string]*JobPatch)[vs[1].(string)]
   268  	}).(JobPatchOutput)
   269  }
   270  
   271  func init() {
   272  	pulumi.RegisterInputType(reflect.TypeOf((*JobPatchInput)(nil)).Elem(), &JobPatch{})
   273  	pulumi.RegisterInputType(reflect.TypeOf((*JobPatchArrayInput)(nil)).Elem(), JobPatchArray{})
   274  	pulumi.RegisterInputType(reflect.TypeOf((*JobPatchMapInput)(nil)).Elem(), JobPatchMap{})
   275  	pulumi.RegisterOutputType(JobPatchOutput{})
   276  	pulumi.RegisterOutputType(JobPatchArrayOutput{})
   277  	pulumi.RegisterOutputType(JobPatchMapOutput{})
   278  }