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