github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/extensions/v1beta1/replicaSet.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  // ReplicaSet ensures that a specified number of pod replicas are running at any given time.
    15  //
    16  // Deprecated: extensions/v1beta1/ReplicaSet is deprecated by apps/v1/ReplicaSet and not supported by Kubernetes v1.16+ clusters.
    17  type ReplicaSet struct {
    18  	pulumi.CustomResourceState
    19  
    20  	// 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
    21  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    22  	// 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
    23  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    24  	// 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
    25  	Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
    26  	// 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
    27  	Spec ReplicaSetSpecPtrOutput `pulumi:"spec"`
    28  	// 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
    29  	Status ReplicaSetStatusPtrOutput `pulumi:"status"`
    30  }
    31  
    32  // NewReplicaSet registers a new resource with the given unique name, arguments, and options.
    33  func NewReplicaSet(ctx *pulumi.Context,
    34  	name string, args *ReplicaSetArgs, opts ...pulumi.ResourceOption) (*ReplicaSet, error) {
    35  	if args == nil {
    36  		args = &ReplicaSetArgs{}
    37  	}
    38  
    39  	args.ApiVersion = pulumi.StringPtr("extensions/v1beta1")
    40  	args.Kind = pulumi.StringPtr("ReplicaSet")
    41  	aliases := pulumi.Aliases([]pulumi.Alias{
    42  		{
    43  			Type: pulumi.String("kubernetes:apps/v1:ReplicaSet"),
    44  		},
    45  		{
    46  			Type: pulumi.String("kubernetes:apps/v1beta2:ReplicaSet"),
    47  		},
    48  	})
    49  	opts = append(opts, aliases)
    50  	var resource ReplicaSet
    51  	err := ctx.RegisterResource("kubernetes:extensions/v1beta1:ReplicaSet", name, args, &resource, opts...)
    52  	if err != nil {
    53  		return nil, err
    54  	}
    55  	return &resource, nil
    56  }
    57  
    58  // GetReplicaSet gets an existing ReplicaSet 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 GetReplicaSet(ctx *pulumi.Context,
    61  	name string, id pulumi.IDInput, state *ReplicaSetState, opts ...pulumi.ResourceOption) (*ReplicaSet, error) {
    62  	var resource ReplicaSet
    63  	err := ctx.ReadResource("kubernetes:extensions/v1beta1:ReplicaSet", 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 ReplicaSet resources.
    71  type replicaSetState struct {
    72  }
    73  
    74  type ReplicaSetState struct {
    75  }
    76  
    77  func (ReplicaSetState) ElementType() reflect.Type {
    78  	return reflect.TypeOf((*replicaSetState)(nil)).Elem()
    79  }
    80  
    81  type replicaSetArgs 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  	// 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
    87  	Metadata *metav1.ObjectMeta `pulumi:"metadata"`
    88  	// 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
    89  	Spec *ReplicaSetSpec `pulumi:"spec"`
    90  }
    91  
    92  // The set of arguments for constructing a ReplicaSet resource.
    93  type ReplicaSetArgs struct {
    94  	// 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
    95  	ApiVersion pulumi.StringPtrInput
    96  	// 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
    97  	Kind pulumi.StringPtrInput
    98  	// 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
    99  	Metadata metav1.ObjectMetaPtrInput
   100  	// 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
   101  	Spec ReplicaSetSpecPtrInput
   102  }
   103  
   104  func (ReplicaSetArgs) ElementType() reflect.Type {
   105  	return reflect.TypeOf((*replicaSetArgs)(nil)).Elem()
   106  }
   107  
   108  type ReplicaSetInput interface {
   109  	pulumi.Input
   110  
   111  	ToReplicaSetOutput() ReplicaSetOutput
   112  	ToReplicaSetOutputWithContext(ctx context.Context) ReplicaSetOutput
   113  }
   114  
   115  func (*ReplicaSet) ElementType() reflect.Type {
   116  	return reflect.TypeOf((**ReplicaSet)(nil)).Elem()
   117  }
   118  
   119  func (i *ReplicaSet) ToReplicaSetOutput() ReplicaSetOutput {
   120  	return i.ToReplicaSetOutputWithContext(context.Background())
   121  }
   122  
   123  func (i *ReplicaSet) ToReplicaSetOutputWithContext(ctx context.Context) ReplicaSetOutput {
   124  	return pulumi.ToOutputWithContext(ctx, i).(ReplicaSetOutput)
   125  }
   126  
   127  // ReplicaSetArrayInput is an input type that accepts ReplicaSetArray and ReplicaSetArrayOutput values.
   128  // You can construct a concrete instance of `ReplicaSetArrayInput` via:
   129  //
   130  //	ReplicaSetArray{ ReplicaSetArgs{...} }
   131  type ReplicaSetArrayInput interface {
   132  	pulumi.Input
   133  
   134  	ToReplicaSetArrayOutput() ReplicaSetArrayOutput
   135  	ToReplicaSetArrayOutputWithContext(context.Context) ReplicaSetArrayOutput
   136  }
   137  
   138  type ReplicaSetArray []ReplicaSetInput
   139  
   140  func (ReplicaSetArray) ElementType() reflect.Type {
   141  	return reflect.TypeOf((*[]*ReplicaSet)(nil)).Elem()
   142  }
   143  
   144  func (i ReplicaSetArray) ToReplicaSetArrayOutput() ReplicaSetArrayOutput {
   145  	return i.ToReplicaSetArrayOutputWithContext(context.Background())
   146  }
   147  
   148  func (i ReplicaSetArray) ToReplicaSetArrayOutputWithContext(ctx context.Context) ReplicaSetArrayOutput {
   149  	return pulumi.ToOutputWithContext(ctx, i).(ReplicaSetArrayOutput)
   150  }
   151  
   152  // ReplicaSetMapInput is an input type that accepts ReplicaSetMap and ReplicaSetMapOutput values.
   153  // You can construct a concrete instance of `ReplicaSetMapInput` via:
   154  //
   155  //	ReplicaSetMap{ "key": ReplicaSetArgs{...} }
   156  type ReplicaSetMapInput interface {
   157  	pulumi.Input
   158  
   159  	ToReplicaSetMapOutput() ReplicaSetMapOutput
   160  	ToReplicaSetMapOutputWithContext(context.Context) ReplicaSetMapOutput
   161  }
   162  
   163  type ReplicaSetMap map[string]ReplicaSetInput
   164  
   165  func (ReplicaSetMap) ElementType() reflect.Type {
   166  	return reflect.TypeOf((*map[string]*ReplicaSet)(nil)).Elem()
   167  }
   168  
   169  func (i ReplicaSetMap) ToReplicaSetMapOutput() ReplicaSetMapOutput {
   170  	return i.ToReplicaSetMapOutputWithContext(context.Background())
   171  }
   172  
   173  func (i ReplicaSetMap) ToReplicaSetMapOutputWithContext(ctx context.Context) ReplicaSetMapOutput {
   174  	return pulumi.ToOutputWithContext(ctx, i).(ReplicaSetMapOutput)
   175  }
   176  
   177  type ReplicaSetOutput struct{ *pulumi.OutputState }
   178  
   179  func (ReplicaSetOutput) ElementType() reflect.Type {
   180  	return reflect.TypeOf((**ReplicaSet)(nil)).Elem()
   181  }
   182  
   183  func (o ReplicaSetOutput) ToReplicaSetOutput() ReplicaSetOutput {
   184  	return o
   185  }
   186  
   187  func (o ReplicaSetOutput) ToReplicaSetOutputWithContext(ctx context.Context) ReplicaSetOutput {
   188  	return o
   189  }
   190  
   191  // 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
   192  func (o ReplicaSetOutput) ApiVersion() pulumi.StringPtrOutput {
   193  	return o.ApplyT(func(v *ReplicaSet) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   194  }
   195  
   196  // 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
   197  func (o ReplicaSetOutput) Kind() pulumi.StringPtrOutput {
   198  	return o.ApplyT(func(v *ReplicaSet) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   199  }
   200  
   201  // 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
   202  func (o ReplicaSetOutput) Metadata() metav1.ObjectMetaPtrOutput {
   203  	return o.ApplyT(func(v *ReplicaSet) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   204  }
   205  
   206  // 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
   207  func (o ReplicaSetOutput) Spec() ReplicaSetSpecPtrOutput {
   208  	return o.ApplyT(func(v *ReplicaSet) ReplicaSetSpecPtrOutput { return v.Spec }).(ReplicaSetSpecPtrOutput)
   209  }
   210  
   211  // 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
   212  func (o ReplicaSetOutput) Status() ReplicaSetStatusPtrOutput {
   213  	return o.ApplyT(func(v *ReplicaSet) ReplicaSetStatusPtrOutput { return v.Status }).(ReplicaSetStatusPtrOutput)
   214  }
   215  
   216  type ReplicaSetArrayOutput struct{ *pulumi.OutputState }
   217  
   218  func (ReplicaSetArrayOutput) ElementType() reflect.Type {
   219  	return reflect.TypeOf((*[]*ReplicaSet)(nil)).Elem()
   220  }
   221  
   222  func (o ReplicaSetArrayOutput) ToReplicaSetArrayOutput() ReplicaSetArrayOutput {
   223  	return o
   224  }
   225  
   226  func (o ReplicaSetArrayOutput) ToReplicaSetArrayOutputWithContext(ctx context.Context) ReplicaSetArrayOutput {
   227  	return o
   228  }
   229  
   230  func (o ReplicaSetArrayOutput) Index(i pulumi.IntInput) ReplicaSetOutput {
   231  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *ReplicaSet {
   232  		return vs[0].([]*ReplicaSet)[vs[1].(int)]
   233  	}).(ReplicaSetOutput)
   234  }
   235  
   236  type ReplicaSetMapOutput struct{ *pulumi.OutputState }
   237  
   238  func (ReplicaSetMapOutput) ElementType() reflect.Type {
   239  	return reflect.TypeOf((*map[string]*ReplicaSet)(nil)).Elem()
   240  }
   241  
   242  func (o ReplicaSetMapOutput) ToReplicaSetMapOutput() ReplicaSetMapOutput {
   243  	return o
   244  }
   245  
   246  func (o ReplicaSetMapOutput) ToReplicaSetMapOutputWithContext(ctx context.Context) ReplicaSetMapOutput {
   247  	return o
   248  }
   249  
   250  func (o ReplicaSetMapOutput) MapIndex(k pulumi.StringInput) ReplicaSetOutput {
   251  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *ReplicaSet {
   252  		return vs[0].(map[string]*ReplicaSet)[vs[1].(string)]
   253  	}).(ReplicaSetOutput)
   254  }
   255  
   256  func init() {
   257  	pulumi.RegisterInputType(reflect.TypeOf((*ReplicaSetInput)(nil)).Elem(), &ReplicaSet{})
   258  	pulumi.RegisterInputType(reflect.TypeOf((*ReplicaSetArrayInput)(nil)).Elem(), ReplicaSetArray{})
   259  	pulumi.RegisterInputType(reflect.TypeOf((*ReplicaSetMapInput)(nil)).Elem(), ReplicaSetMap{})
   260  	pulumi.RegisterOutputType(ReplicaSetOutput{})
   261  	pulumi.RegisterOutputType(ReplicaSetArrayOutput{})
   262  	pulumi.RegisterOutputType(ReplicaSetMapOutput{})
   263  }