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