Skip to content
DocsTry Aspire
DocsTry

EndpointReference

Handle
📦 Aspire.Hosting v13.4.0
interface EndpointReference
extends IExpressionValue,
IManifestExpressionProvider,
IValueProvider,
IValueWithReferences {
readonly endpointName: string;
readonly errorMessage: string;
readonly excludeReferenceEndpoint: boolean;
readonly exists: boolean;
readonly host: string;
readonly isAllocated: boolean;
readonly isHttp: boolean;
readonly isHttps: boolean;
readonly isHttpSchemeNamedEndpoint: boolean;
readonly port: number;
readonly resource: IResourceWithEndpoints;
readonly scheme: string;
readonly targetPort: number;
readonly tlsEnabled: boolean;
readonly url: string;
getTlsValue(
enabledValue: ReferenceExpression,
disabledValue: ReferenceExpression): ReferenceExpression;
getValueAsync(cancellationToken?: cancellationToken): string;
property(property: EndpointProperty): EndpointReferenceExpression;
}

Properties

propertyendpointNamestringget
Gets the name of the endpoint associated with the endpoint reference.
propertyerrorMessagestringget
Gets or sets a custom error message to be thrown when the endpoint annotation is not found.
propertyexcludeReferenceEndpointbooleanget
Gets a value indicating whether this endpoint is excluded from the default set when referencing the resource's endpoints.
propertyexistsbooleanget
Gets a value indicating whether the endpoint exists.
propertyhoststringget
Gets the host for this endpoint.
propertyisAllocatedbooleanget
Gets a value indicating whether the endpoint is allocated.
propertyisHttpbooleanget
Gets a value indicating whether the endpoint uses HTTP scheme.
propertyisHttpsbooleanget
Gets a value indicating whether the endpoint uses HTTPS scheme.
propertyisHttpSchemeNamedEndpointbooleanget
Gets a value indicating whether the endpoint name is "http" or "https", ignoring case. This is a convention used to identify endpoints that will be resolved based on the scheme of the endpoint in service discovery rather than by the specific endpoint name. This is done to allow http endpoints that are dynamically updated to https to be mapped correctly despite the endpoint name no longer matching the scheme.
propertyportnumberget
Gets the port for this endpoint.
propertyresourceIResourceWithEndpointsget
Gets the resource owner of the endpoint reference.
propertyschemestringget
Gets the scheme for this endpoint.
propertytargetPortnumberget
Gets the target port for this endpoint. If the port is dynamically allocated, this will return `null`.
propertytlsEnabledbooleanget
Gets a value indicating whether TLS is enabled for this endpoint.
propertyurlstringget
Gets the URL for this endpoint.

Methods

Gets a conditional expression that resolves to the enabledValue when TLS is enabled on the endpoint, or to the disabledValue otherwise.
getTlsValue(
enabledValue: ReferenceExpression,
disabledValue: ReferenceExpression): ReferenceExpression
enabledValueReferenceExpression
disabledValueReferenceExpression
ReferenceExpression
Gets the URL of the endpoint asynchronously. Waits for the endpoint to be allocated if necessary.
getValueAsync(cancellationToken?: cancellationToken): string
cancellationTokencancellationTokenoptional
string
methodproperty
Gets the specified property expression of the endpoint.
property(property: EndpointProperty): EndpointReferenceExpression
propertyEndpointProperty
EndpointReferenceExpression