github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/policy/v1beta1/podDisruptionBudget.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 // PodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods 15 type PodDisruptionBudget 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 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 23 // Specification of the desired behavior of the PodDisruptionBudget. 24 Spec PodDisruptionBudgetSpecPtrOutput `pulumi:"spec"` 25 // Most recently observed status of the PodDisruptionBudget. 26 Status PodDisruptionBudgetStatusPtrOutput `pulumi:"status"` 27 } 28 29 // NewPodDisruptionBudget registers a new resource with the given unique name, arguments, and options. 30 func NewPodDisruptionBudget(ctx *pulumi.Context, 31 name string, args *PodDisruptionBudgetArgs, opts ...pulumi.ResourceOption) (*PodDisruptionBudget, error) { 32 if args == nil { 33 args = &PodDisruptionBudgetArgs{} 34 } 35 36 args.ApiVersion = pulumi.StringPtr("policy/v1beta1") 37 args.Kind = pulumi.StringPtr("PodDisruptionBudget") 38 aliases := pulumi.Aliases([]pulumi.Alias{ 39 { 40 Type: pulumi.String("kubernetes:policy/v1:PodDisruptionBudget"), 41 }, 42 }) 43 opts = append(opts, aliases) 44 var resource PodDisruptionBudget 45 err := ctx.RegisterResource("kubernetes:policy/v1beta1:PodDisruptionBudget", name, args, &resource, opts...) 46 if err != nil { 47 return nil, err 48 } 49 return &resource, nil 50 } 51 52 // GetPodDisruptionBudget gets an existing PodDisruptionBudget resource's state with the given name, ID, and optional 53 // state properties that are used to uniquely qualify the lookup (nil if not required). 54 func GetPodDisruptionBudget(ctx *pulumi.Context, 55 name string, id pulumi.IDInput, state *PodDisruptionBudgetState, opts ...pulumi.ResourceOption) (*PodDisruptionBudget, error) { 56 var resource PodDisruptionBudget 57 err := ctx.ReadResource("kubernetes:policy/v1beta1:PodDisruptionBudget", name, id, state, &resource, opts...) 58 if err != nil { 59 return nil, err 60 } 61 return &resource, nil 62 } 63 64 // Input properties used for looking up and filtering PodDisruptionBudget resources. 65 type podDisruptionBudgetState struct { 66 } 67 68 type PodDisruptionBudgetState struct { 69 } 70 71 func (PodDisruptionBudgetState) ElementType() reflect.Type { 72 return reflect.TypeOf((*podDisruptionBudgetState)(nil)).Elem() 73 } 74 75 type podDisruptionBudgetArgs struct { 76 // 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 77 ApiVersion *string `pulumi:"apiVersion"` 78 // 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 79 Kind *string `pulumi:"kind"` 80 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 81 // Specification of the desired behavior of the PodDisruptionBudget. 82 Spec *PodDisruptionBudgetSpec `pulumi:"spec"` 83 } 84 85 // The set of arguments for constructing a PodDisruptionBudget resource. 86 type PodDisruptionBudgetArgs struct { 87 // 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 88 ApiVersion pulumi.StringPtrInput 89 // 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 90 Kind pulumi.StringPtrInput 91 Metadata metav1.ObjectMetaPtrInput 92 // Specification of the desired behavior of the PodDisruptionBudget. 93 Spec PodDisruptionBudgetSpecPtrInput 94 } 95 96 func (PodDisruptionBudgetArgs) ElementType() reflect.Type { 97 return reflect.TypeOf((*podDisruptionBudgetArgs)(nil)).Elem() 98 } 99 100 type PodDisruptionBudgetInput interface { 101 pulumi.Input 102 103 ToPodDisruptionBudgetOutput() PodDisruptionBudgetOutput 104 ToPodDisruptionBudgetOutputWithContext(ctx context.Context) PodDisruptionBudgetOutput 105 } 106 107 func (*PodDisruptionBudget) ElementType() reflect.Type { 108 return reflect.TypeOf((**PodDisruptionBudget)(nil)).Elem() 109 } 110 111 func (i *PodDisruptionBudget) ToPodDisruptionBudgetOutput() PodDisruptionBudgetOutput { 112 return i.ToPodDisruptionBudgetOutputWithContext(context.Background()) 113 } 114 115 func (i *PodDisruptionBudget) ToPodDisruptionBudgetOutputWithContext(ctx context.Context) PodDisruptionBudgetOutput { 116 return pulumi.ToOutputWithContext(ctx, i).(PodDisruptionBudgetOutput) 117 } 118 119 // PodDisruptionBudgetArrayInput is an input type that accepts PodDisruptionBudgetArray and PodDisruptionBudgetArrayOutput values. 120 // You can construct a concrete instance of `PodDisruptionBudgetArrayInput` via: 121 // 122 // PodDisruptionBudgetArray{ PodDisruptionBudgetArgs{...} } 123 type PodDisruptionBudgetArrayInput interface { 124 pulumi.Input 125 126 ToPodDisruptionBudgetArrayOutput() PodDisruptionBudgetArrayOutput 127 ToPodDisruptionBudgetArrayOutputWithContext(context.Context) PodDisruptionBudgetArrayOutput 128 } 129 130 type PodDisruptionBudgetArray []PodDisruptionBudgetInput 131 132 func (PodDisruptionBudgetArray) ElementType() reflect.Type { 133 return reflect.TypeOf((*[]*PodDisruptionBudget)(nil)).Elem() 134 } 135 136 func (i PodDisruptionBudgetArray) ToPodDisruptionBudgetArrayOutput() PodDisruptionBudgetArrayOutput { 137 return i.ToPodDisruptionBudgetArrayOutputWithContext(context.Background()) 138 } 139 140 func (i PodDisruptionBudgetArray) ToPodDisruptionBudgetArrayOutputWithContext(ctx context.Context) PodDisruptionBudgetArrayOutput { 141 return pulumi.ToOutputWithContext(ctx, i).(PodDisruptionBudgetArrayOutput) 142 } 143 144 // PodDisruptionBudgetMapInput is an input type that accepts PodDisruptionBudgetMap and PodDisruptionBudgetMapOutput values. 145 // You can construct a concrete instance of `PodDisruptionBudgetMapInput` via: 146 // 147 // PodDisruptionBudgetMap{ "key": PodDisruptionBudgetArgs{...} } 148 type PodDisruptionBudgetMapInput interface { 149 pulumi.Input 150 151 ToPodDisruptionBudgetMapOutput() PodDisruptionBudgetMapOutput 152 ToPodDisruptionBudgetMapOutputWithContext(context.Context) PodDisruptionBudgetMapOutput 153 } 154 155 type PodDisruptionBudgetMap map[string]PodDisruptionBudgetInput 156 157 func (PodDisruptionBudgetMap) ElementType() reflect.Type { 158 return reflect.TypeOf((*map[string]*PodDisruptionBudget)(nil)).Elem() 159 } 160 161 func (i PodDisruptionBudgetMap) ToPodDisruptionBudgetMapOutput() PodDisruptionBudgetMapOutput { 162 return i.ToPodDisruptionBudgetMapOutputWithContext(context.Background()) 163 } 164 165 func (i PodDisruptionBudgetMap) ToPodDisruptionBudgetMapOutputWithContext(ctx context.Context) PodDisruptionBudgetMapOutput { 166 return pulumi.ToOutputWithContext(ctx, i).(PodDisruptionBudgetMapOutput) 167 } 168 169 type PodDisruptionBudgetOutput struct{ *pulumi.OutputState } 170 171 func (PodDisruptionBudgetOutput) ElementType() reflect.Type { 172 return reflect.TypeOf((**PodDisruptionBudget)(nil)).Elem() 173 } 174 175 func (o PodDisruptionBudgetOutput) ToPodDisruptionBudgetOutput() PodDisruptionBudgetOutput { 176 return o 177 } 178 179 func (o PodDisruptionBudgetOutput) ToPodDisruptionBudgetOutputWithContext(ctx context.Context) PodDisruptionBudgetOutput { 180 return o 181 } 182 183 // 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 184 func (o PodDisruptionBudgetOutput) ApiVersion() pulumi.StringPtrOutput { 185 return o.ApplyT(func(v *PodDisruptionBudget) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 186 } 187 188 // 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 189 func (o PodDisruptionBudgetOutput) Kind() pulumi.StringPtrOutput { 190 return o.ApplyT(func(v *PodDisruptionBudget) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 191 } 192 193 func (o PodDisruptionBudgetOutput) Metadata() metav1.ObjectMetaPtrOutput { 194 return o.ApplyT(func(v *PodDisruptionBudget) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 195 } 196 197 // Specification of the desired behavior of the PodDisruptionBudget. 198 func (o PodDisruptionBudgetOutput) Spec() PodDisruptionBudgetSpecPtrOutput { 199 return o.ApplyT(func(v *PodDisruptionBudget) PodDisruptionBudgetSpecPtrOutput { return v.Spec }).(PodDisruptionBudgetSpecPtrOutput) 200 } 201 202 // Most recently observed status of the PodDisruptionBudget. 203 func (o PodDisruptionBudgetOutput) Status() PodDisruptionBudgetStatusPtrOutput { 204 return o.ApplyT(func(v *PodDisruptionBudget) PodDisruptionBudgetStatusPtrOutput { return v.Status }).(PodDisruptionBudgetStatusPtrOutput) 205 } 206 207 type PodDisruptionBudgetArrayOutput struct{ *pulumi.OutputState } 208 209 func (PodDisruptionBudgetArrayOutput) ElementType() reflect.Type { 210 return reflect.TypeOf((*[]*PodDisruptionBudget)(nil)).Elem() 211 } 212 213 func (o PodDisruptionBudgetArrayOutput) ToPodDisruptionBudgetArrayOutput() PodDisruptionBudgetArrayOutput { 214 return o 215 } 216 217 func (o PodDisruptionBudgetArrayOutput) ToPodDisruptionBudgetArrayOutputWithContext(ctx context.Context) PodDisruptionBudgetArrayOutput { 218 return o 219 } 220 221 func (o PodDisruptionBudgetArrayOutput) Index(i pulumi.IntInput) PodDisruptionBudgetOutput { 222 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *PodDisruptionBudget { 223 return vs[0].([]*PodDisruptionBudget)[vs[1].(int)] 224 }).(PodDisruptionBudgetOutput) 225 } 226 227 type PodDisruptionBudgetMapOutput struct{ *pulumi.OutputState } 228 229 func (PodDisruptionBudgetMapOutput) ElementType() reflect.Type { 230 return reflect.TypeOf((*map[string]*PodDisruptionBudget)(nil)).Elem() 231 } 232 233 func (o PodDisruptionBudgetMapOutput) ToPodDisruptionBudgetMapOutput() PodDisruptionBudgetMapOutput { 234 return o 235 } 236 237 func (o PodDisruptionBudgetMapOutput) ToPodDisruptionBudgetMapOutputWithContext(ctx context.Context) PodDisruptionBudgetMapOutput { 238 return o 239 } 240 241 func (o PodDisruptionBudgetMapOutput) MapIndex(k pulumi.StringInput) PodDisruptionBudgetOutput { 242 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *PodDisruptionBudget { 243 return vs[0].(map[string]*PodDisruptionBudget)[vs[1].(string)] 244 }).(PodDisruptionBudgetOutput) 245 } 246 247 func init() { 248 pulumi.RegisterInputType(reflect.TypeOf((*PodDisruptionBudgetInput)(nil)).Elem(), &PodDisruptionBudget{}) 249 pulumi.RegisterInputType(reflect.TypeOf((*PodDisruptionBudgetArrayInput)(nil)).Elem(), PodDisruptionBudgetArray{}) 250 pulumi.RegisterInputType(reflect.TypeOf((*PodDisruptionBudgetMapInput)(nil)).Elem(), PodDisruptionBudgetMap{}) 251 pulumi.RegisterOutputType(PodDisruptionBudgetOutput{}) 252 pulumi.RegisterOutputType(PodDisruptionBudgetArrayOutput{}) 253 pulumi.RegisterOutputType(PodDisruptionBudgetMapOutput{}) 254 }