5 instantiations of NetworkIdentifier
Aspire.Hosting (4)
ApplicationModel\Network.cs (3)
19
public static readonly NetworkIdentifier LocalhostNetwork = new
NetworkIdentifier
("localhost");
24
public static readonly NetworkIdentifier PublicInternet = new
NetworkIdentifier
(".");
29
public static readonly NetworkIdentifier DefaultAspireContainerNetwork = new
NetworkIdentifier
("aspire-container-network");
Dcp\DcpExecutor.cs (1)
1130
var networkID = new
NetworkIdentifier
(ts.ContainerNetworkName!);
Aspire.Hosting.Testing (1)
DistributedApplicationHostingTestingExtensions.cs (1)
125
return app.GetEndpointForNetwork(resourceName, networkIdentifier is null ? null : new
NetworkIdentifier
(networkIdentifier), endpointName);
43 references to NetworkIdentifier
Aspire.Hosting (38)
ApplicationModel\AllocatedEndpoint.cs (2)
54
NetworkIdentifier
? networkID = null
142
public
NetworkIdentifier
NetworkID { get; private set; }
ApplicationModel\ContainerNetworkAliasAnnotation.cs (2)
19
private
NetworkIdentifier
_network = KnownNetworkIdentifiers.DefaultAspireContainerNetwork;
41
public
NetworkIdentifier
Network
ApplicationModel\EndpointAnnotation.cs (8)
26
private readonly
NetworkIdentifier
_networkID;
76
NetworkIdentifier
? networkID,
217
public
NetworkIdentifier
DefaultNetworkID => _networkID;
275
public record class NetworkEndpointSnapshot(ValueSnapshot<AllocatedEndpoint> Snapshot,
NetworkIdentifier
NetworkID);
302
public bool TryAdd(
NetworkIdentifier
networkID, ValueSnapshot<AllocatedEndpoint> snapshot)
318
public void AddOrUpdateAllocatedEndpoint(
NetworkIdentifier
networkID, AllocatedEndpoint endpoint)
331
public Task<AllocatedEndpoint> GetAllocatedEndpointAsync(
NetworkIdentifier
networkID, CancellationToken cancellationToken = default)
337
private NetworkEndpointSnapshot GetSnapshotFor(
NetworkIdentifier
networkID)
ApplicationModel\EndpointReference.cs (7)
19
private readonly
NetworkIdentifier
? _contextNetworkID;
95
public
NetworkIdentifier
? ContextNetworkID => _contextNetworkID;
229
/// or host processes calling container via mapped ports). If a <see cref="
NetworkIdentifier
"/> is specified, the <see cref="EndpointReference"/>
230
/// will always resolve in the context of that network. If the <see cref="
NetworkIdentifier
"/> is null, the reference will attempt to resolve itself
233
public EndpointReference(IResourceWithEndpoints owner, EndpointAnnotation endpoint,
NetworkIdentifier
? contextNetworkID)
265
public EndpointReference(IResourceWithEndpoints owner, string endpointName,
NetworkIdentifier
? contextNetworkID = null)
332
var
networkContext = Endpoint.ContextNetworkID ?? context.GetNetworkIdentifier();
ApplicationModel\EndpointReferenceAnnotation.cs (1)
15
public
NetworkIdentifier
ContextNetworkID { get; set; } = KnownNetworkIdentifiers.LocalhostNetwork;
ApplicationModel\HostUrl.cs (1)
25
var
networkContext = context.GetNetworkIdentifier();
ApplicationModel\IValueProvider.cs (1)
24
public
NetworkIdentifier
? Network { get; init; }
ApplicationModel\Network.cs (3)
19
public static readonly
NetworkIdentifier
LocalhostNetwork = new NetworkIdentifier("localhost");
24
public static readonly
NetworkIdentifier
PublicInternet = new NetworkIdentifier(".");
29
public static readonly
NetworkIdentifier
DefaultAspireContainerNetwork = new NetworkIdentifier("aspire-container-network");
ApplicationModel\ResourceExtensions.cs (4)
514
internal static
NetworkIdentifier
GetDefaultResourceNetwork(this IResource resource)
519
internal static IEnumerable<
NetworkIdentifier
> GetSupportedNetworks(this IResource resource)
706
public static IEnumerable<EndpointReference> GetEndpoints(this IResourceWithEndpoints resource,
NetworkIdentifier
contextNetworkID)
744
public static EndpointReference GetEndpoint(this IResourceWithEndpoints resource, string endpointName,
NetworkIdentifier
contextNetworkID)
ApplicationModel\ResourceUrlsCallbackContext.cs (1)
42
public EndpointReference? GetEndpoint(string name,
NetworkIdentifier
contextNetworkID) =>
ApplicationModel\ValueProviderExtensions.cs (1)
8
public static
NetworkIdentifier
GetNetworkIdentifier(this ValueProviderContext context)
Dcp\DcpExecutor.cs (1)
1130
var
networkID = new NetworkIdentifier(ts.ContainerNetworkName!);
Dcp\OtlpEndpointReferenceGatherer.cs (1)
58
var
resourceNetwork = resource.GetDefaultResourceNetwork();
ResourceBuilderExtensions.cs (5)
1073
/// Exposes an endpoint on a resource. A reference to this endpoint can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string,
NetworkIdentifier
)"/>.
1130
/// Exposes an endpoint on a resource. This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string,
NetworkIdentifier
)"/>.
1152
/// Exposes an HTTP endpoint on a resource. This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string,
NetworkIdentifier
)"/>.
1173
/// Exposes an HTTPS endpoint on a resource. This endpoint reference can be retrieved using <see cref="ResourceBuilderExtensions.GetEndpoint{T}(IResourceBuilder{T}, string,
NetworkIdentifier
)"/>.
1231
public static EndpointReference GetEndpoint<T>(this IResourceBuilder<T> builder, [EndpointName] string name,
NetworkIdentifier
contextNetworkID) where T : IResourceWithEndpoints
Aspire.Hosting.Testing (3)
DistributedApplicationHostingTestingExtensions.cs (3)
104
public static Uri GetEndpointForNetwork(this DistributedApplication app, string resourceName,
NetworkIdentifier
? networkIdentifier, string? endpointName = default)
144
static string GetEndpointUriStringCore(DistributedApplication app, string resourceName, string? endpointName = default,
NetworkIdentifier
? networkIdentifier = default)
179
static EndpointReference? GetEndpointOrDefault(IResourceWithEndpoints resourceWithEndpoints, string endpointName,
NetworkIdentifier
? networkIdentifier = default)
Aspire.Hosting.Tests (2)
Dcp\DcpExecutorTests.cs (1)
2308
async ValueTask AssertEndpoint(IResourceWithEndpoints resource, string name,
NetworkIdentifier
network, string address, int port)
EndpointReferenceTests.cs (1)
338
var
network = source.GetDefaultResourceNetwork();