github.com/pulumi/pulumi-kubernetes/sdk/v3@v3.30.2/go/kubernetes/discovery/v1/endpointSlicePatch.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 // Patch resources are used to modify existing Kubernetes resources by using 15 // Server-Side Apply updates. The name of the resource must be specified, but all other properties are optional. More than 16 // one patch may be applied to the same resource, and a random FieldManager name will be used for each Patch resource. 17 // Conflicts will result in an error by default, but can be forced using the "pulumi.com/patchForce" annotation. See the 18 // [Server-Side Apply Docs](https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/managing-resources-with-server-side-apply/) for 19 // additional information about using Server-Side Apply to manage Kubernetes resources with Pulumi. 20 // 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. 21 type EndpointSlicePatch struct { 22 pulumi.CustomResourceState 23 24 // 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. 25 AddressType pulumi.StringPtrOutput `pulumi:"addressType"` 26 // 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 27 ApiVersion pulumi.StringPtrOutput `pulumi:"apiVersion"` 28 // endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints. 29 Endpoints EndpointPatchArrayOutput `pulumi:"endpoints"` 30 // 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 31 Kind pulumi.StringPtrOutput `pulumi:"kind"` 32 // Standard object's metadata. 33 Metadata metav1.ObjectMetaPatchPtrOutput `pulumi:"metadata"` 34 // 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. 35 Ports EndpointPortPatchArrayOutput `pulumi:"ports"` 36 } 37 38 // NewEndpointSlicePatch registers a new resource with the given unique name, arguments, and options. 39 func NewEndpointSlicePatch(ctx *pulumi.Context, 40 name string, args *EndpointSlicePatchArgs, opts ...pulumi.ResourceOption) (*EndpointSlicePatch, error) { 41 if args == nil { 42 args = &EndpointSlicePatchArgs{} 43 } 44 45 args.ApiVersion = pulumi.StringPtr("discovery.k8s.io/v1") 46 args.Kind = pulumi.StringPtr("EndpointSlice") 47 aliases := pulumi.Aliases([]pulumi.Alias{ 48 { 49 Type: pulumi.String("kubernetes:discovery.k8s.io/v1beta1:EndpointSlicePatch"), 50 }, 51 }) 52 opts = append(opts, aliases) 53 var resource EndpointSlicePatch 54 err := ctx.RegisterResource("kubernetes:discovery.k8s.io/v1:EndpointSlicePatch", name, args, &resource, opts...) 55 if err != nil { 56 return nil, err 57 } 58 return &resource, nil 59 } 60 61 // GetEndpointSlicePatch gets an existing EndpointSlicePatch resource's state with the given name, ID, and optional 62 // state properties that are used to uniquely qualify the lookup (nil if not required). 63 func GetEndpointSlicePatch(ctx *pulumi.Context, 64 name string, id pulumi.IDInput, state *EndpointSlicePatchState, opts ...pulumi.ResourceOption) (*EndpointSlicePatch, error) { 65 var resource EndpointSlicePatch 66 err := ctx.ReadResource("kubernetes:discovery.k8s.io/v1:EndpointSlicePatch", name, id, state, &resource, opts...) 67 if err != nil { 68 return nil, err 69 } 70 return &resource, nil 71 } 72 73 // Input properties used for looking up and filtering EndpointSlicePatch resources. 74 type endpointSlicePatchState struct { 75 } 76 77 type EndpointSlicePatchState struct { 78 } 79 80 func (EndpointSlicePatchState) ElementType() reflect.Type { 81 return reflect.TypeOf((*endpointSlicePatchState)(nil)).Elem() 82 } 83 84 type endpointSlicePatchArgs struct { 85 // 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. 86 AddressType *string `pulumi:"addressType"` 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 *string `pulumi:"apiVersion"` 89 // endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints. 90 Endpoints []EndpointPatch `pulumi:"endpoints"` 91 // 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 92 Kind *string `pulumi:"kind"` 93 // Standard object's metadata. 94 Metadata *metav1.ObjectMetaPatch `pulumi:"metadata"` 95 // 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. 96 Ports []EndpointPortPatch `pulumi:"ports"` 97 } 98 99 // The set of arguments for constructing a EndpointSlicePatch resource. 100 type EndpointSlicePatchArgs struct { 101 // 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. 102 AddressType pulumi.StringPtrInput 103 // 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 104 ApiVersion pulumi.StringPtrInput 105 // endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints. 106 Endpoints EndpointPatchArrayInput 107 // 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 108 Kind pulumi.StringPtrInput 109 // Standard object's metadata. 110 Metadata metav1.ObjectMetaPatchPtrInput 111 // 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. 112 Ports EndpointPortPatchArrayInput 113 } 114 115 func (EndpointSlicePatchArgs) ElementType() reflect.Type { 116 return reflect.TypeOf((*endpointSlicePatchArgs)(nil)).Elem() 117 } 118 119 type EndpointSlicePatchInput interface { 120 pulumi.Input 121 122 ToEndpointSlicePatchOutput() EndpointSlicePatchOutput 123 ToEndpointSlicePatchOutputWithContext(ctx context.Context) EndpointSlicePatchOutput 124 } 125 126 func (*EndpointSlicePatch) ElementType() reflect.Type { 127 return reflect.TypeOf((**EndpointSlicePatch)(nil)).Elem() 128 } 129 130 func (i *EndpointSlicePatch) ToEndpointSlicePatchOutput() EndpointSlicePatchOutput { 131 return i.ToEndpointSlicePatchOutputWithContext(context.Background()) 132 } 133 134 func (i *EndpointSlicePatch) ToEndpointSlicePatchOutputWithContext(ctx context.Context) EndpointSlicePatchOutput { 135 return pulumi.ToOutputWithContext(ctx, i).(EndpointSlicePatchOutput) 136 } 137 138 // EndpointSlicePatchArrayInput is an input type that accepts EndpointSlicePatchArray and EndpointSlicePatchArrayOutput values. 139 // You can construct a concrete instance of `EndpointSlicePatchArrayInput` via: 140 // 141 // EndpointSlicePatchArray{ EndpointSlicePatchArgs{...} } 142 type EndpointSlicePatchArrayInput interface { 143 pulumi.Input 144 145 ToEndpointSlicePatchArrayOutput() EndpointSlicePatchArrayOutput 146 ToEndpointSlicePatchArrayOutputWithContext(context.Context) EndpointSlicePatchArrayOutput 147 } 148 149 type EndpointSlicePatchArray []EndpointSlicePatchInput 150 151 func (EndpointSlicePatchArray) ElementType() reflect.Type { 152 return reflect.TypeOf((*[]*EndpointSlicePatch)(nil)).Elem() 153 } 154 155 func (i EndpointSlicePatchArray) ToEndpointSlicePatchArrayOutput() EndpointSlicePatchArrayOutput { 156 return i.ToEndpointSlicePatchArrayOutputWithContext(context.Background()) 157 } 158 159 func (i EndpointSlicePatchArray) ToEndpointSlicePatchArrayOutputWithContext(ctx context.Context) EndpointSlicePatchArrayOutput { 160 return pulumi.ToOutputWithContext(ctx, i).(EndpointSlicePatchArrayOutput) 161 } 162 163 // EndpointSlicePatchMapInput is an input type that accepts EndpointSlicePatchMap and EndpointSlicePatchMapOutput values. 164 // You can construct a concrete instance of `EndpointSlicePatchMapInput` via: 165 // 166 // EndpointSlicePatchMap{ "key": EndpointSlicePatchArgs{...} } 167 type EndpointSlicePatchMapInput interface { 168 pulumi.Input 169 170 ToEndpointSlicePatchMapOutput() EndpointSlicePatchMapOutput 171 ToEndpointSlicePatchMapOutputWithContext(context.Context) EndpointSlicePatchMapOutput 172 } 173 174 type EndpointSlicePatchMap map[string]EndpointSlicePatchInput 175 176 func (EndpointSlicePatchMap) ElementType() reflect.Type { 177 return reflect.TypeOf((*map[string]*EndpointSlicePatch)(nil)).Elem() 178 } 179 180 func (i EndpointSlicePatchMap) ToEndpointSlicePatchMapOutput() EndpointSlicePatchMapOutput { 181 return i.ToEndpointSlicePatchMapOutputWithContext(context.Background()) 182 } 183 184 func (i EndpointSlicePatchMap) ToEndpointSlicePatchMapOutputWithContext(ctx context.Context) EndpointSlicePatchMapOutput { 185 return pulumi.ToOutputWithContext(ctx, i).(EndpointSlicePatchMapOutput) 186 } 187 188 type EndpointSlicePatchOutput struct{ *pulumi.OutputState } 189 190 func (EndpointSlicePatchOutput) ElementType() reflect.Type { 191 return reflect.TypeOf((**EndpointSlicePatch)(nil)).Elem() 192 } 193 194 func (o EndpointSlicePatchOutput) ToEndpointSlicePatchOutput() EndpointSlicePatchOutput { 195 return o 196 } 197 198 func (o EndpointSlicePatchOutput) ToEndpointSlicePatchOutputWithContext(ctx context.Context) EndpointSlicePatchOutput { 199 return o 200 } 201 202 // 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. 203 func (o EndpointSlicePatchOutput) AddressType() pulumi.StringPtrOutput { 204 return o.ApplyT(func(v *EndpointSlicePatch) pulumi.StringPtrOutput { return v.AddressType }).(pulumi.StringPtrOutput) 205 } 206 207 // 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 208 func (o EndpointSlicePatchOutput) ApiVersion() pulumi.StringPtrOutput { 209 return o.ApplyT(func(v *EndpointSlicePatch) pulumi.StringPtrOutput { return v.ApiVersion }).(pulumi.StringPtrOutput) 210 } 211 212 // endpoints is a list of unique endpoints in this slice. Each slice may include a maximum of 1000 endpoints. 213 func (o EndpointSlicePatchOutput) Endpoints() EndpointPatchArrayOutput { 214 return o.ApplyT(func(v *EndpointSlicePatch) EndpointPatchArrayOutput { return v.Endpoints }).(EndpointPatchArrayOutput) 215 } 216 217 // 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 218 func (o EndpointSlicePatchOutput) Kind() pulumi.StringPtrOutput { 219 return o.ApplyT(func(v *EndpointSlicePatch) pulumi.StringPtrOutput { return v.Kind }).(pulumi.StringPtrOutput) 220 } 221 222 // Standard object's metadata. 223 func (o EndpointSlicePatchOutput) Metadata() metav1.ObjectMetaPatchPtrOutput { 224 return o.ApplyT(func(v *EndpointSlicePatch) metav1.ObjectMetaPatchPtrOutput { return v.Metadata }).(metav1.ObjectMetaPatchPtrOutput) 225 } 226 227 // 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. 228 func (o EndpointSlicePatchOutput) Ports() EndpointPortPatchArrayOutput { 229 return o.ApplyT(func(v *EndpointSlicePatch) EndpointPortPatchArrayOutput { return v.Ports }).(EndpointPortPatchArrayOutput) 230 } 231 232 type EndpointSlicePatchArrayOutput struct{ *pulumi.OutputState } 233 234 func (EndpointSlicePatchArrayOutput) ElementType() reflect.Type { 235 return reflect.TypeOf((*[]*EndpointSlicePatch)(nil)).Elem() 236 } 237 238 func (o EndpointSlicePatchArrayOutput) ToEndpointSlicePatchArrayOutput() EndpointSlicePatchArrayOutput { 239 return o 240 } 241 242 func (o EndpointSlicePatchArrayOutput) ToEndpointSlicePatchArrayOutputWithContext(ctx context.Context) EndpointSlicePatchArrayOutput { 243 return o 244 } 245 246 func (o EndpointSlicePatchArrayOutput) Index(i pulumi.IntInput) EndpointSlicePatchOutput { 247 return pulumi.All(o, i).ApplyT(func(vs []interface{}) *EndpointSlicePatch { 248 return vs[0].([]*EndpointSlicePatch)[vs[1].(int)] 249 }).(EndpointSlicePatchOutput) 250 } 251 252 type EndpointSlicePatchMapOutput struct{ *pulumi.OutputState } 253 254 func (EndpointSlicePatchMapOutput) ElementType() reflect.Type { 255 return reflect.TypeOf((*map[string]*EndpointSlicePatch)(nil)).Elem() 256 } 257 258 func (o EndpointSlicePatchMapOutput) ToEndpointSlicePatchMapOutput() EndpointSlicePatchMapOutput { 259 return o 260 } 261 262 func (o EndpointSlicePatchMapOutput) ToEndpointSlicePatchMapOutputWithContext(ctx context.Context) EndpointSlicePatchMapOutput { 263 return o 264 } 265 266 func (o EndpointSlicePatchMapOutput) MapIndex(k pulumi.StringInput) EndpointSlicePatchOutput { 267 return pulumi.All(o, k).ApplyT(func(vs []interface{}) *EndpointSlicePatch { 268 return vs[0].(map[string]*EndpointSlicePatch)[vs[1].(string)] 269 }).(EndpointSlicePatchOutput) 270 } 271 272 func init() { 273 pulumi.RegisterInputType(reflect.TypeOf((*EndpointSlicePatchInput)(nil)).Elem(), &EndpointSlicePatch{}) 274 pulumi.RegisterInputType(reflect.TypeOf((*EndpointSlicePatchArrayInput)(nil)).Elem(), EndpointSlicePatchArray{}) 275 pulumi.RegisterInputType(reflect.TypeOf((*EndpointSlicePatchMapInput)(nil)).Elem(), EndpointSlicePatchMap{}) 276 pulumi.RegisterOutputType(EndpointSlicePatchOutput{}) 277 pulumi.RegisterOutputType(EndpointSlicePatchArrayOutput{}) 278 pulumi.RegisterOutputType(EndpointSlicePatchMapOutput{}) 279 }