github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/limitRange.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 // LimitRange sets resource usage limits for each kind of resource in a Namespace. 15 type LimitRange 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 // Spec defines the limits enforced. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 25 Spec LimitRangeSpecPtrOutput `pulumi:"spec"` 26 } 27 28 // NewLimitRange registers a new resource with the given unique name, arguments, and options. 29 func NewLimitRange(ctx *pulumi.Context, 30 name string, args *LimitRangeArgs, opts ...pulumi.ResourceOption) (*LimitRange, error) { 31 if args == nil { 32 args = &LimitRangeArgs{} 33 } 34 35 args.ApiVersion = pulumi.StringPtr("v1") 36 args.Kind = pulumi.StringPtr("LimitRange") 37 var resource LimitRange 38 err := ctx.RegisterResource("kubernetes:core/v1:LimitRange", name, args, &resource, opts...) 39 if err != nil { 40 return nil, err 41 } 42 return &resource, nil 43 } 44 45 // GetLimitRange gets an existing LimitRange resource's state with the given name, ID, and optional 46 // state properties that are used to uniquely qualify the lookup (nil if not required). 47 func GetLimitRange(ctx *pulumi.Context, 48 name string, id pulumi.IDInput, state *LimitRangeState, opts ...pulumi.ResourceOption) (*LimitRange, error) { 49 var resource LimitRange 50 err := ctx.ReadResource("kubernetes:core/v1:LimitRange", name, id, state, &resource, opts...) 51 if err != nil { 52 return nil, err 53 } 54 return &resource, nil 55 } 56 57 // Input properties used for looking up and filtering LimitRange resources. 58 type limitRangeState struct { 59 } 60 61 type LimitRangeState struct { 62 } 63 64 func (LimitRangeState) ElementType() reflect.Type { 65 return reflect.TypeOf((*limitRangeState)(nil)).Elem() 66 } 67 68 type limitRangeArgs struct { 69 // 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 70 ApiVersion *string `pulumi:"apiVersion"` 71 // 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 72 Kind *string `pulumi:"kind"` 73 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 74 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 75 // Spec defines the limits enforced. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 76 Spec *LimitRangeSpec `pulumi:"spec"` 77 } 78 79 // The set of arguments for constructing a LimitRange resource. 80 type LimitRangeArgs struct { 81 // 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 82 ApiVersion pulumi.StringPtrInput 83 // 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 84 Kind pulumi.StringPtrInput 85 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 86 Metadata metav1.ObjectMetaPtrInput 87 // Spec defines the limits enforced. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 88 Spec LimitRangeSpecPtrInput 89 } 90 91 func (LimitRangeArgs) ElementType() reflect.Type { 92 return reflect.TypeOf((*limitRangeArgs)(nil)).Elem() 93 } 94 95 type LimitRangeInput interface { 96 pulumi.Input 97 98 ToLimitRangeOutput() LimitRangeOutput 99 ToLimitRangeOutputWithContext(ctx context.Context) LimitRangeOutput 100 } 101 102 func (*LimitRange) ElementType() reflect.Type { 103 return reflect.TypeOf((**LimitRange)(nil)).Elem() 104 } 105 106 func (i *LimitRange) ToLimitRangeOutput() LimitRangeOutput { 107 return i.ToLimitRangeOutputWithContext(context.Background()) 108 } 109 110 func (i *LimitRange) ToLimitRangeOutputWithContext(ctx context.Context) LimitRangeOutput { 111 return pulumi.ToOutputWithContext(ctx, i).(LimitRangeOutput) 112 } 113 114 // LimitRangeArrayInput is an input type that accepts LimitRangeArray and LimitRangeArrayOutput values. 115 // You can construct a concrete instance of `LimitRangeArrayInput` via: 116 // 117 // LimitRangeArray{ LimitRangeArgs{...} } 118 type LimitRangeArrayInput interface { 119 pulumi.Input 120 121 ToLimitRangeArrayOutput() LimitRangeArrayOutput 122 ToLimitRangeArrayOutputWithContext(context.Context) LimitRangeArrayOutput 123 } 124 125 type LimitRangeArray []LimitRangeInput 126 127 func (LimitRangeArray) ElementType() reflect.Type { 128 return reflect.TypeOf((*[]*LimitRange)(nil)).Elem() 129 } 130 131 func (i LimitRangeArray) ToLimitRangeArrayOutput() LimitRangeArrayOutput { 132 return i.ToLimitRangeArrayOutputWithContext(context.Background()) 133 } 134 135 func (i LimitRangeArray) ToLimitRangeArrayOutputWithContext(ctx context.Context) LimitRangeArrayOutput { 136 return pulumi.ToOutputWithContext(ctx, i).(LimitRangeArrayOutput) 137 } 138 139 // LimitRangeMapInput is an input type that accepts LimitRangeMap and LimitRangeMapOutput values. 140 // You can construct a concrete instance of `LimitRangeMapInput` via: 141 // 142 // LimitRangeMap{ "key": LimitRangeArgs{...} } 143 type LimitRangeMapInput interface { 144 pulumi.Input 145 146 ToLimitRangeMapOutput() LimitRangeMapOutput 147 ToLimitRangeMapOutputWithContext(context.Context) LimitRangeMapOutput 148 } 149 150 type LimitRangeMap map[string]LimitRangeInput 151 152 func (LimitRangeMap) ElementType() reflect.Type { 153 return reflect.TypeOf((*map[string]*LimitRange)(nil)).Elem() 154 } 155 156 func (i LimitRangeMap) ToLimitRangeMapOutput() LimitRangeMapOutput { 157 return i.ToLimitRangeMapOutputWithContext(context.Background()) 158 } 159 160 func (i LimitRangeMap) ToLimitRangeMapOutputWithContext(ctx context.Context) LimitRangeMapOutput { 161 return pulumi.ToOutputWithContext(ctx, i).(LimitRangeMapOutput) 162 } 163 164 type LimitRangeOutput struct{ *pulumi.OutputState } 165 166 func (LimitRangeOutput) ElementType() reflect.Type { 167 return reflect.TypeOf((**LimitRange)(nil)).Elem() 168 } 169 170 func (o LimitRangeOutput) ToLimitRangeOutput() LimitRangeOutput { 171 return o 172 } 173 174 func (o LimitRangeOutput) ToLimitRangeOutputWithContext(ctx context.Context) LimitRangeOutput { 175 return o 176 } 177 178 // 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 179 func (o LimitRangeOutput) ApiVersion() pulumi.StringPtrOutput { 180 return o.ApplyT(func(v *LimitRange) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 181 } 182 183 // 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 184 func (o LimitRangeOutput) Kind() pulumi.StringPtrOutput { 185 return o.ApplyT(func(v *LimitRange) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 186 } 187 188 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 189 func (o LimitRangeOutput) Metadata() metav1.ObjectMetaPtrOutput { 190 return o.ApplyT(func(v *LimitRange) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 191 } 192 193 // Spec defines the limits enforced. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 194 func (o LimitRangeOutput) Spec() LimitRangeSpecPtrOutput { 195 return o.ApplyT(func(v *LimitRange) LimitRangeSpecPtrOutput { return v.Spec }).(LimitRangeSpecPtrOutput) 196 } 197 198 type LimitRangeArrayOutput struct{ *pulumi.OutputState } 199 200 func (LimitRangeArrayOutput) ElementType() reflect.Type { 201 return reflect.TypeOf((*[]*LimitRange)(nil)).Elem() 202 } 203 204 func (o LimitRangeArrayOutput) ToLimitRangeArrayOutput() LimitRangeArrayOutput { 205 return o 206 } 207 208 func (o LimitRangeArrayOutput) ToLimitRangeArrayOutputWithContext(ctx context.Context) LimitRangeArrayOutput { 209 return o 210 } 211 212 func (o LimitRangeArrayOutput) Index(i pulumi.IntInput) LimitRangeOutput { 213 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *LimitRange { 214 return vs[0].([]*LimitRange)[vs[1].(int)] 215 }).(LimitRangeOutput) 216 } 217 218 type LimitRangeMapOutput struct{ *pulumi.OutputState } 219 220 func (LimitRangeMapOutput) ElementType() reflect.Type { 221 return reflect.TypeOf((*map[string]*LimitRange)(nil)).Elem() 222 } 223 224 func (o LimitRangeMapOutput) ToLimitRangeMapOutput() LimitRangeMapOutput { 225 return o 226 } 227 228 func (o LimitRangeMapOutput) ToLimitRangeMapOutputWithContext(ctx context.Context) LimitRangeMapOutput { 229 return o 230 } 231 232 func (o LimitRangeMapOutput) MapIndex(k pulumi.StringInput) LimitRangeOutput { 233 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *LimitRange { 234 return vs[0].(map[string]*LimitRange)[vs[1].(string)] 235 }).(LimitRangeOutput) 236 } 237 238 func init() { 239 pulumi.RegisterInputType(reflect.TypeOf((*LimitRangeInput)(nil)).Elem(), &LimitRange{}) 240 pulumi.RegisterInputType(reflect.TypeOf((*LimitRangeArrayInput)(nil)).Elem(), LimitRangeArray{}) 241 pulumi.RegisterInputType(reflect.TypeOf((*LimitRangeMapInput)(nil)).Elem(), LimitRangeMap{}) 242 pulumi.RegisterOutputType(LimitRangeOutput{}) 243 pulumi.RegisterOutputType(LimitRangeArrayOutput{}) 244 pulumi.RegisterOutputType(LimitRangeMapOutput{}) 245 }