github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/discovery/v1/endpointSlice.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  	"errors"
    11  	metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v3/go/kubernetes/meta/v1"
    12  	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    13  )
    14  
    15  // EndpointSlice represents a subset of the endpoints that implement a service. For a given service there may be multiple EndpointSlice objects, selected by labels, which must be joined to produce the full set of endpoints.
    16  type EndpointSlice struct {
    17  	pulumi.CustomResourceState
    18  
    19  	// addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.
    20  	AddressType pulumi.StringOutput `pulumi:"addressType"`
    21  	// 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
    22  	ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"`
    23  	// endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.
    24  	Endpoints EndpointArrayOutput `pulumi:"endpoints"`
    25  	// 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
    26  	Kind pulumi.StringPtrOutput `pulumi:"kind"`
    27  	// Standard object's metadata.
    28  	Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"`
    29  	// ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports.
    30  	Ports EndpointPortArrayOutput `pulumi:"ports"`
    31  }
    32  
    33  // NewEndpointSlice registers a new resource with the given unique name, arguments, and options.
    34  func NewEndpointSlice(ctx *pulumi.Context,
    35  	name string, args *EndpointSliceArgs, opts ...pulumi.ResourceOption) (*EndpointSlice, error) {
    36  	if args == nil {
    37  		return nil, errors.New("missing one or more required arguments")
    38  	}
    39  
    40  	if args.AddressType == nil {
    41  		return nil, errors.New("invalid value for required argument 'AddressType'")
    42  	}
    43  	if args.Endpoints == nil {
    44  		return nil, errors.New("invalid value for required argument 'Endpoints'")
    45  	}
    46  	args.ApiVersion = pulumi.StringPtr("discovery.k8s.io/v1")
    47  	args.Kind = pulumi.StringPtr("EndpointSlice")
    48  	aliases := pulumi.Aliases([]pulumi.Alias{
    49  		{
    50  			Type: pulumi.String("kubernetes:discovery.k8s.io/v1beta1:EndpointSlice"),
    51  		},
    52  	})
    53  	opts = append(opts, aliases)
    54  	var resource EndpointSlice
    55  	err := ctx.RegisterResource("kubernetes:discovery.k8s.io/v1:EndpointSlice", name, args, &resource, opts...)
    56  	if err != nil {
    57  		return nil, err
    58  	}
    59  	return &resource, nil
    60  }
    61  
    62  // GetEndpointSlice gets an existing EndpointSlice resource's state with the given name, ID, and optional
    63  // state properties that are used to uniquely qualify the lookup (nil if not required).
    64  func GetEndpointSlice(ctx *pulumi.Context,
    65  	name string, id pulumi.IDInput, state *EndpointSliceState, opts ...pulumi.ResourceOption) (*EndpointSlice, error) {
    66  	var resource EndpointSlice
    67  	err := ctx.ReadResource("kubernetes:discovery.k8s.io/v1:EndpointSlice", name, id, state, &resource, opts...)
    68  	if err != nil {
    69  		return nil, err
    70  	}
    71  	return &resource, nil
    72  }
    73  
    74  // Input properties used for looking up and filtering EndpointSlice resources.
    75  type endpointSliceState struct {
    76  }
    77  
    78  type EndpointSliceState struct {
    79  }
    80  
    81  func (EndpointSliceState) ElementType() reflect.Type {
    82  	return reflect.TypeOf((*endpointSliceState)(nil)).Elem()
    83  }
    84  
    85  type endpointSliceArgs struct {
    86  	// addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.
    87  	AddressType string `pulumi:"addressType"`
    88  	// 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
    89  	ApiVersion *string `pulumi:"apiVersion"`
    90  	// endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.
    91  	Endpoints []Endpoint `pulumi:"endpoints"`
    92  	// 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
    93  	Kind *string `pulumi:"kind"`
    94  	// Standard object's metadata.
    95  	Metadata *metav1.ObjectMeta `pulumi:"metadata"`
    96  	// ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports.
    97  	Ports []EndpointPort `pulumi:"ports"`
    98  }
    99  
   100  // The set of arguments for constructing a EndpointSlice resource.
   101  type EndpointSliceArgs struct {
   102  	// addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.
   103  	AddressType pulumi.StringInput
   104  	// 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
   105  	ApiVersion pulumi.StringPtrInput
   106  	// endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.
   107  	Endpoints EndpointArrayInput
   108  	// 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
   109  	Kind pulumi.StringPtrInput
   110  	// Standard object's metadata.
   111  	Metadata metav1.ObjectMetaPtrInput
   112  	// ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports.
   113  	Ports EndpointPortArrayInput
   114  }
   115  
   116  func (EndpointSliceArgs) ElementType() reflect.Type {
   117  	return reflect.TypeOf((*endpointSliceArgs)(nil)).Elem()
   118  }
   119  
   120  type EndpointSliceInput interface {
   121  	pulumi.Input
   122  
   123  	ToEndpointSliceOutput() EndpointSliceOutput
   124  	ToEndpointSliceOutputWithContext(ctx context.Context) EndpointSliceOutput
   125  }
   126  
   127  func (*EndpointSlice) ElementType() reflect.Type {
   128  	return reflect.TypeOf((**EndpointSlice)(nil)).Elem()
   129  }
   130  
   131  func (i *EndpointSlice) ToEndpointSliceOutput() EndpointSliceOutput {
   132  	return i.ToEndpointSliceOutputWithContext(context.Background())
   133  }
   134  
   135  func (i *EndpointSlice) ToEndpointSliceOutputWithContext(ctx context.Context) EndpointSliceOutput {
   136  	return pulumi.ToOutputWithContext(ctx, i).(EndpointSliceOutput)
   137  }
   138  
   139  // EndpointSliceArrayInput is an input type that accepts EndpointSliceArray and EndpointSliceArrayOutput values.
   140  // You can construct a concrete instance of `EndpointSliceArrayInput` via:
   141  //
   142  //	EndpointSliceArray{ EndpointSliceArgs{...} }
   143  type EndpointSliceArrayInput interface {
   144  	pulumi.Input
   145  
   146  	ToEndpointSliceArrayOutput() EndpointSliceArrayOutput
   147  	ToEndpointSliceArrayOutputWithContext(context.Context) EndpointSliceArrayOutput
   148  }
   149  
   150  type EndpointSliceArray []EndpointSliceInput
   151  
   152  func (EndpointSliceArray) ElementType() reflect.Type {
   153  	return reflect.TypeOf((*[]*EndpointSlice)(nil)).Elem()
   154  }
   155  
   156  func (i EndpointSliceArray) ToEndpointSliceArrayOutput() EndpointSliceArrayOutput {
   157  	return i.ToEndpointSliceArrayOutputWithContext(context.Background())
   158  }
   159  
   160  func (i EndpointSliceArray) ToEndpointSliceArrayOutputWithContext(ctx context.Context) EndpointSliceArrayOutput {
   161  	return pulumi.ToOutputWithContext(ctx, i).(EndpointSliceArrayOutput)
   162  }
   163  
   164  // EndpointSliceMapInput is an input type that accepts EndpointSliceMap and EndpointSliceMapOutput values.
   165  // You can construct a concrete instance of `EndpointSliceMapInput` via:
   166  //
   167  //	EndpointSliceMap{ "key": EndpointSliceArgs{...} }
   168  type EndpointSliceMapInput interface {
   169  	pulumi.Input
   170  
   171  	ToEndpointSliceMapOutput() EndpointSliceMapOutput
   172  	ToEndpointSliceMapOutputWithContext(context.Context) EndpointSliceMapOutput
   173  }
   174  
   175  type EndpointSliceMap map[string]EndpointSliceInput
   176  
   177  func (EndpointSliceMap) ElementType() reflect.Type {
   178  	return reflect.TypeOf((*map[string]*EndpointSlice)(nil)).Elem()
   179  }
   180  
   181  func (i EndpointSliceMap) ToEndpointSliceMapOutput() EndpointSliceMapOutput {
   182  	return i.ToEndpointSliceMapOutputWithContext(context.Background())
   183  }
   184  
   185  func (i EndpointSliceMap) ToEndpointSliceMapOutputWithContext(ctx context.Context) EndpointSliceMapOutput {
   186  	return pulumi.ToOutputWithContext(ctx, i).(EndpointSliceMapOutput)
   187  }
   188  
   189  type EndpointSliceOutput struct{ *pulumi.OutputState }
   190  
   191  func (EndpointSliceOutput) ElementType() reflect.Type {
   192  	return reflect.TypeOf((**EndpointSlice)(nil)).Elem()
   193  }
   194  
   195  func (o EndpointSliceOutput) ToEndpointSliceOutput() EndpointSliceOutput {
   196  	return o
   197  }
   198  
   199  func (o EndpointSliceOutput) ToEndpointSliceOutputWithContext(ctx context.Context) EndpointSliceOutput {
   200  	return o
   201  }
   202  
   203  // addressType specifies the type of address carried by this EndpointSlice. All addresses in this slice must be the same type. This field is immutable after creation. The following address types are currently supported: * IPv4: Represents an IPv4 Address. * IPv6: Represents an IPv6 Address. * FQDN: Represents a Fully Qualified Domain Name.
   204  func (o EndpointSliceOutput) AddressType() pulumi.StringOutput {
   205  	return o.ApplyT(func(v *EndpointSlice) pulumi.StringOutput { return v.AddressType }).(pulumi.StringOutput)
   206  }
   207  
   208  // 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
   209  func (o EndpointSliceOutput) ApiVersion() pulumi.StringPtrOutput {
   210  	return o.ApplyT(func(v *EndpointSlice) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput)
   211  }
   212  
   213  // endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints.
   214  func (o EndpointSliceOutput) Endpoints() EndpointArrayOutput {
   215  	return o.ApplyT(func(v *EndpointSlice) EndpointArrayOutput { return v.Endpoints }).(EndpointArrayOutput)
   216  }
   217  
   218  // 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
   219  func (o EndpointSliceOutput) Kind() pulumi.StringPtrOutput {
   220  	return o.ApplyT(func(v *EndpointSlice) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput)
   221  }
   222  
   223  // Standard object's metadata.
   224  func (o EndpointSliceOutput) Metadata() metav1.ObjectMetaPtrOutput {
   225  	return o.ApplyT(func(v *EndpointSlice) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput)
   226  }
   227  
   228  // ports specifies the list of network ports exposed by each endpoint in this slice. Each port must have a unique name. When ports is empty, it indicates that there are no defined ports. When a port is defined with a nil port value, it indicates "all ports". Each slice may include a maximum of 100 ports.
   229  func (o EndpointSliceOutput) Ports() EndpointPortArrayOutput {
   230  	return o.ApplyT(func(v *EndpointSlice) EndpointPortArrayOutput { return v.Ports }).(EndpointPortArrayOutput)
   231  }
   232  
   233  type EndpointSliceArrayOutput struct{ *pulumi.OutputState }
   234  
   235  func (EndpointSliceArrayOutput) ElementType() reflect.Type {
   236  	return reflect.TypeOf((*[]*EndpointSlice)(nil)).Elem()
   237  }
   238  
   239  func (o EndpointSliceArrayOutput) ToEndpointSliceArrayOutput() EndpointSliceArrayOutput {
   240  	return o
   241  }
   242  
   243  func (o EndpointSliceArrayOutput) ToEndpointSliceArrayOutputWithContext(ctx context.Context) EndpointSliceArrayOutput {
   244  	return o
   245  }
   246  
   247  func (o EndpointSliceArrayOutput) Index(i pulumi.IntInput) EndpointSliceOutput {
   248  	return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EndpointSlice {
   249  		return vs[0].([]*EndpointSlice)[vs[1].(int)]
   250  	}).(EndpointSliceOutput)
   251  }
   252  
   253  type EndpointSliceMapOutput struct{ *pulumi.OutputState }
   254  
   255  func (EndpointSliceMapOutput) ElementType() reflect.Type {
   256  	return reflect.TypeOf((*map[string]*EndpointSlice)(nil)).Elem()
   257  }
   258  
   259  func (o EndpointSliceMapOutput) ToEndpointSliceMapOutput() EndpointSliceMapOutput {
   260  	return o
   261  }
   262  
   263  func (o EndpointSliceMapOutput) ToEndpointSliceMapOutputWithContext(ctx context.Context) EndpointSliceMapOutput {
   264  	return o
   265  }
   266  
   267  func (o EndpointSliceMapOutput) MapIndex(k pulumi.StringInput) EndpointSliceOutput {
   268  	return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EndpointSlice {
   269  		return vs[0].(map[string]*EndpointSlice)[vs[1].(string)]
   270  	}).(EndpointSliceOutput)
   271  }
   272  
   273  func init() {
   274  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointSliceInput)(nil)).Elem(), &EndpointSlice{})
   275  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointSliceArrayInput)(nil)).Elem(), EndpointSliceArray{})
   276  	pulumi.RegisterInputType(reflect.TypeOf((*EndpointSliceMapInput)(nil)).Elem(), EndpointSliceMap{})
   277  	pulumi.RegisterOutputType(EndpointSliceOutput{})
   278  	pulumi.RegisterOutputType(EndpointSliceArrayOutput{})
   279  	pulumi.RegisterOutputType(EndpointSliceMapOutput{})
   280  }