EndpointAnnotation
Class sealed net10.0
Represents an endpoint annotation that describes how a service should be bound to a network.
namespace Aspire.Hosting.ApplicationModel;
public sealed class EndpointAnnotation : Aspire.Hosting.ApplicationModel.IResourceAnnotation{ // ...} 15 members
Remarks
Section titled Remarks This class is used to specify the network protocol, port, URI scheme, transport, and other details for a service.
Constructors2
Section titled ConstructorsEndpointAnnotation(ProtocolType, string?, string?, string?, int?, int?, bool?, bool) Initializes a new instance of
EndpointAnnotation. EndpointAnnotation(ProtocolType, NetworkIdentifier?, string?, string?, string?, int?, int?, bool?, bool) Initializes a new instance of
EndpointAnnotation. Properties13
Section titled PropertiesAllAllocatedEndpointsget Gets the list of all AllocatedEndpoints associated with this Endpoint.
AllocatedEndpointget; set Gets or sets the default
EndpointAnnotation.AllocatedEndpoint for this Endpoint. AllocatedEndpointSnapshotgetValueSnapshot<AllocatedEndpoint> Gets the
EndpointAnnotation.AllocatedEndpointSnapshot for the default EndpointAnnotation.AllocatedEndpoint. DefaultNetworkIDget Gets the ID of the network that is the "default" network for the Endpoint (the one the Endpoint is associated with and can be reached without routing or network address translation).
IsExternalget; setbool Indicates that this endpoint should be exposed externally at publish time.
IsProxiedget; setbool Indicates that this endpoint should be managed by DCP. This means it can be replicated and use a different port internally than the one publicly exposed. Setting to false means the endpoint will be handled and exposed by the resource.
Nameget; setstring Name of the service
Portget; setint? Desired port for the service
Protocolget; setProtocolType Network protocol: TCP or UDP are supported today, others possibly in future.
TargetHostget; setstring This is the address the resource is listening on. By default it is localhost.
TargetPortget; setint? This is the port the resource is listening on. If the endpoint is used for the container, it is the container port.
Transportget; setstring Transport that is being used (e.g. http, http2, http3 etc).
UriSchemeget; setstring If a service is URI-addressable, this property will contain the URI scheme to use for constructing service URI.