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