github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/core/v1/endpoints.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 // Endpoints is a collection of endpoints that implement the actual service. Example: 15 // 16 // Name: "mysvc", 17 // Subsets: [ 18 // { 19 // Addresses: [{"ip": "10.10.1.1"}, {"ip": "10.10.2.2"}], 20 // Ports: [{"name": "a", "port": 8675}, {"name": "b", "port": 309}] 21 // }, 22 // { 23 // Addresses: [{"ip": "10.10.3.3"}], 24 // Ports: [{"name": "a", "port": 93}, {"name": "b", "port": 76}] 25 // }, 26 // ] 27 type Endpoints struct { 28 pulumi.CustomResourceState 29 30 // 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 31 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 32 // 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 33 Kind pulumi.StringPtrOutput `pulumi:"kind"` 34 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 35 Metadata metav1.ObjectMetaPtrOutput `pulumi:"metadata"` 36 // The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service. 37 Subsets EndpointSubsetArrayOutput `pulumi:"subsets"` 38 } 39 40 // NewEndpoints registers a new resource with the given unique name, arguments, and options. 41 func NewEndpoints(ctx *pulumi.Context, 42 name string, args *EndpointsArgs, opts ...pulumi.ResourceOption) (*Endpoints, error) { 43 if args == nil { 44 args = &EndpointsArgs{} 45 } 46 47 args.ApiVersion = pulumi.StringPtr("v1") 48 args.Kind = pulumi.StringPtr("Endpoints") 49 var resource Endpoints 50 err := ctx.RegisterResource("kubernetes:core/v1:Endpoints", name, args, &resource, opts...) 51 if err != nil { 52 return nil, err 53 } 54 return &resource, nil 55 } 56 57 // GetEndpoints gets an existing Endpoints resource's state with the given name, ID, and optional 58 // state properties that are used to uniquely qualify the lookup (nil if not required). 59 func GetEndpoints(ctx *pulumi.Context, 60 name string, id pulumi.IDInput, state *EndpointsState, opts ...pulumi.ResourceOption) (*Endpoints, error) { 61 var resource Endpoints 62 err := ctx.ReadResource("kubernetes:core/v1:Endpoints", name, id, state, &resource, opts...) 63 if err != nil { 64 return nil, err 65 } 66 return &resource, nil 67 } 68 69 // Input properties used for looking up and filtering Endpoints resources. 70 type endpointsState struct { 71 } 72 73 type EndpointsState struct { 74 } 75 76 func (EndpointsState) ElementType() reflect.Type { 77 return reflect.TypeOf((*endpointsState)(nil)).Elem() 78 } 79 80 type endpointsArgs 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 *string `pulumi:"apiVersion"` 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 *string `pulumi:"kind"` 85 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 86 Metadata *metav1.ObjectMeta `pulumi:"metadata"` 87 // The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service. 88 Subsets []EndpointSubset `pulumi:"subsets"` 89 } 90 91 // The set of arguments for constructing a Endpoints resource. 92 type EndpointsArgs struct { 93 // 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 94 ApiVersion pulumi.StringPtrInput 95 // 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 96 Kind pulumi.StringPtrInput 97 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 98 Metadata metav1.ObjectMetaPtrInput 99 // The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service. 100 Subsets EndpointSubsetArrayInput 101 } 102 103 func (EndpointsArgs) ElementType() reflect.Type { 104 return reflect.TypeOf((*endpointsArgs)(nil)).Elem() 105 } 106 107 type EndpointsInput interface { 108 pulumi.Input 109 110 ToEndpointsOutput() EndpointsOutput 111 ToEndpointsOutputWithContext(ctx context.Context) EndpointsOutput 112 } 113 114 func (*Endpoints) ElementType() reflect.Type { 115 return reflect.TypeOf((**Endpoints)(nil)).Elem() 116 } 117 118 func (i *Endpoints) ToEndpointsOutput() EndpointsOutput { 119 return i.ToEndpointsOutputWithContext(context.Background()) 120 } 121 122 func (i *Endpoints) ToEndpointsOutputWithContext(ctx context.Context) EndpointsOutput { 123 return pulumi.ToOutputWithContext(ctx, i).(EndpointsOutput) 124 } 125 126 // EndpointsArrayInput is an input type that accepts EndpointsArray and EndpointsArrayOutput values. 127 // You can construct a concrete instance of `EndpointsArrayInput` via: 128 // 129 // EndpointsArray{ EndpointsArgs{...} } 130 type EndpointsArrayInput interface { 131 pulumi.Input 132 133 ToEndpointsArrayOutput() EndpointsArrayOutput 134 ToEndpointsArrayOutputWithContext(context.Context) EndpointsArrayOutput 135 } 136 137 type EndpointsArray []EndpointsInput 138 139 func (EndpointsArray) ElementType() reflect.Type { 140 return reflect.TypeOf((*[]*Endpoints)(nil)).Elem() 141 } 142 143 func (i EndpointsArray) ToEndpointsArrayOutput() EndpointsArrayOutput { 144 return i.ToEndpointsArrayOutputWithContext(context.Background()) 145 } 146 147 func (i EndpointsArray) ToEndpointsArrayOutputWithContext(ctx context.Context) EndpointsArrayOutput { 148 return pulumi.ToOutputWithContext(ctx, i).(EndpointsArrayOutput) 149 } 150 151 // EndpointsMapInput is an input type that accepts EndpointsMap and EndpointsMapOutput values. 152 // You can construct a concrete instance of `EndpointsMapInput` via: 153 // 154 // EndpointsMap{ "key": EndpointsArgs{...} } 155 type EndpointsMapInput interface { 156 pulumi.Input 157 158 ToEndpointsMapOutput() EndpointsMapOutput 159 ToEndpointsMapOutputWithContext(context.Context) EndpointsMapOutput 160 } 161 162 type EndpointsMap map[string]EndpointsInput 163 164 func (EndpointsMap) ElementType() reflect.Type { 165 return reflect.TypeOf((*map[string]*Endpoints)(nil)).Elem() 166 } 167 168 func (i EndpointsMap) ToEndpointsMapOutput() EndpointsMapOutput { 169 return i.ToEndpointsMapOutputWithContext(context.Background()) 170 } 171 172 func (i EndpointsMap) ToEndpointsMapOutputWithContext(ctx context.Context) EndpointsMapOutput { 173 return pulumi.ToOutputWithContext(ctx, i).(EndpointsMapOutput) 174 } 175 176 type EndpointsOutput struct{ *pulumi.OutputState } 177 178 func (EndpointsOutput) ElementType() reflect.Type { 179 return reflect.TypeOf((**Endpoints)(nil)).Elem() 180 } 181 182 func (o EndpointsOutput) ToEndpointsOutput() EndpointsOutput { 183 return o 184 } 185 186 func (o EndpointsOutput) ToEndpointsOutputWithContext(ctx context.Context) EndpointsOutput { 187 return o 188 } 189 190 // 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 191 func (o EndpointsOutput) ApiVersion() pulumi.StringPtrOutput { 192 return o.ApplyT(func(v *Endpoints) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 193 } 194 195 // 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 196 func (o EndpointsOutput) Kind() pulumi.StringPtrOutput { 197 return o.ApplyT(func(v *Endpoints) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 198 } 199 200 // Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 201 func (o EndpointsOutput) Metadata() metav1.ObjectMetaPtrOutput { 202 return o.ApplyT(func(v *Endpoints) metav1.ObjectMetaPtrOutput { return v.Metadata }).(metav1.ObjectMetaPtrOutput) 203 } 204 205 // The set of all endpoints is the union of all subsets. Addresses are placed into subsets according to the IPs they share. A single address with multiple ports, some of which are ready and some of which are not (because they come from different containers) will result in the address being displayed in different subsets for the different ports. No address will appear in both Addresses and NotReadyAddresses in the same subset. Sets of addresses and ports that comprise a service. 206 func (o EndpointsOutput) Subsets() EndpointSubsetArrayOutput { 207 return o.ApplyT(func(v *Endpoints) EndpointSubsetArrayOutput { return v.Subsets }).(EndpointSubsetArrayOutput) 208 } 209 210 type EndpointsArrayOutput struct{ *pulumi.OutputState } 211 212 func (EndpointsArrayOutput) ElementType() reflect.Type { 213 return reflect.TypeOf((*[]*Endpoints)(nil)).Elem() 214 } 215 216 func (o EndpointsArrayOutput) ToEndpointsArrayOutput() EndpointsArrayOutput { 217 return o 218 } 219 220 func (o EndpointsArrayOutput) ToEndpointsArrayOutputWithContext(ctx context.Context) EndpointsArrayOutput { 221 return o 222 } 223 224 func (o EndpointsArrayOutput) Index(i pulumi.IntInput) EndpointsOutput { 225 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *Endpoints { 226 return vs[0].([]*Endpoints)[vs[1].(int)] 227 }).(EndpointsOutput) 228 } 229 230 type EndpointsMapOutput struct{ *pulumi.OutputState } 231 232 func (EndpointsMapOutput) ElementType() reflect.Type { 233 return reflect.TypeOf((*map[string]*Endpoints)(nil)).Elem() 234 } 235 236 func (o EndpointsMapOutput) ToEndpointsMapOutput() EndpointsMapOutput { 237 return o 238 } 239 240 func (o EndpointsMapOutput) ToEndpointsMapOutputWithContext(ctx context.Context) EndpointsMapOutput { 241 return o 242 } 243 244 func (o EndpointsMapOutput) MapIndex(k pulumi.StringInput) EndpointsOutput { 245 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *Endpoints { 246 return vs[0].(map[string]*Endpoints)[vs[1].(string)] 247 }).(EndpointsOutput) 248 } 249 250 func init() { 251 pulumi.RegisterInputType(reflect.TypeOf((*EndpointsInput)(nil)).Elem(), &Endpoints{}) 252 pulumi.RegisterInputType(reflect.TypeOf((*EndpointsArrayInput)(nil)).Elem(), EndpointsArray{}) 253 pulumi.RegisterInputType(reflect.TypeOf((*EndpointsMapInput)(nil)).Elem(), EndpointsMap{}) 254 pulumi.RegisterOutputType(EndpointsOutput{}) 255 pulumi.RegisterOutputType(EndpointsArrayOutput{}) 256 pulumi.RegisterOutputType(EndpointsMapOutput{}) 257 }