30 instantiations of CustomResourceSnapshot
Aspire.Hosting (8)
ApplicationModel\CertificateAuthorityCollectionResourceExtensions.cs (1)
31.WithInitialState(new CustomResourceSnapshot
ApplicationModel\ResourceNotificationService.cs (1)
863previousState ??= new CustomResourceSnapshot()
ConnectionStringBuilderExtensions.cs (1)
82.WithInitialState(new CustomResourceSnapshot
Dashboard\DashboardEventHandlers.cs (1)
515var snapshot = new CustomResourceSnapshot
DotnetToolResourceExtensions.cs (1)
45.WithInitialState(new CustomResourceSnapshot
ExternalServiceBuilderExtensions.cs (1)
85.WithInitialState(new CustomResourceSnapshot
ParameterResourceBuilderExtensions.cs (1)
235var state = new CustomResourceSnapshot
ProjectResourceBuilderExtensions.cs (1)
931.WithInitialState(new CustomResourceSnapshot
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
109.WithInitialState(new() 651.WithInitialState(new()
Aspire.Hosting.GitHub.Models (1)
GitHubModelsExtensions.cs (1)
53.WithInitialState(new()
Aspire.Hosting.Maui (1)
MauiOtlpExtensions.cs (1)
105stubBuilder.WithInitialState(new CustomResourceSnapshot
Aspire.Hosting.OpenAI (2)
OpenAIExtensions.cs (2)
65.WithInitialState(new() 113.WithInitialState(new()
Aspire.Hosting.Tests (9)
Backchannel\AppHostBackchannelTests.cs (1)
60.WithInitialState(new () {
Backchannel\Exec\ContainerResourceExecTests.cs (1)
69.WithInitialState(new()
Backchannel\Exec\ProjectResourceExecTests.cs (1)
130.WithInitialState(new()
Dashboard\ResourcePublisherTests.cs (1)
185return new GenericResourceSnapshot(new()
Eventing\DistributedApplicationBuilderEventingTests.cs (1)
297var testSnapshot = new CustomResourceSnapshot
ResourceCommandAnnotationTests.cs (2)
61ResourceSnapshot = new CustomResourceSnapshot 141ResourceSnapshot = new CustomResourceSnapshot
ResourceNotificationTests.cs (1)
24.WithInitialState(new()
WithUrlsTests.cs (1)
546.WithInitialState(new()
CustomResources.AppHost (3)
TalkingClockResource.cs (2)
41.WithInitialState(new CustomResourceSnapshot // Aspire type for custom resource state. 130.WithInitialState(new()
TestResource.cs (1)
17.WithInitialState(new()
HealthChecksSandbox.AppHost (1)
Program.cs (1)
52.WithInitialState(new()
Stress.AppHost (3)
Program.cs (1)
31.WithInitialState(new CustomResourceSnapshot
TestResource.cs (2)
18.WithInitialState(new() 36.WithInitialState(new()
60 references to CustomResourceSnapshot
Aspire.Hosting (51)
ApplicationModel\ResourceCommandAnnotation.cs (1)
176public required CustomResourceSnapshot ResourceSnapshot { get; init; }
ApplicationModel\ResourceNotificationService.cs (24)
253static bool ShouldYield(WaitBehavior waitBehavior, CustomResourceSnapshot snapshot) => 300var snapshot = resourceEvent.Snapshot; 328static bool IsKnownTerminalState(CustomResourceSnapshot snapshot) => 369var snapshot = resourceEvent.Snapshot; 401static bool IsContinuableState(WaitBehavior waitBehavior, CustomResourceSnapshot snapshot) => 633/// Updates the snapshot of the <see cref="CustomResourceSnapshot"/> for a resource. 638public Task PublishUpdateAsync(IResource resource, string resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 648var previousState = GetCurrentSnapshot(resource, notificationState); 650var newState = stateFactory(previousState); 738private CustomResourceSnapshot UpdateCommands(IResource resource, CustomResourceSnapshot previousState) 801static ResourceCommandSnapshot CreateCommandFromAnnotation(ResourceCommandAnnotation annotation, CustomResourceSnapshot previousState, IServiceProvider serviceProvider) 812private static CustomResourceSnapshot UpdateIcons(IResource resource, CustomResourceSnapshot previousState) 838/// Updates the snapshot of the <see cref="CustomResourceSnapshot"/> for a resource. 842public async Task PublishUpdateAsync(IResource resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory) 851private static CustomResourceSnapshot GetCurrentSnapshot(IResource resource, ResourceNotificationState notificationState) 853var previousState = notificationState.LastSnapshot; 905var snapshot = evt.Snapshot; 959public CustomResourceSnapshot? LastSnapshot { get; set; } 987public class ResourceEvent(IResource resource, string resourceId, CustomResourceSnapshot snapshot) 1002public CustomResourceSnapshot Snapshot { get; } = snapshot;
ApplicationModel\ResourceSnapshotAnnotation.cs (2)
9public class ResourceSnapshotAnnotation(CustomResourceSnapshot initialSnapshot) : IResourceAnnotation 14public CustomResourceSnapshot InitialSnapshot { get; } = initialSnapshot ?? throw new ArgumentNullException(nameof(initialSnapshot));
Backchannel\AppHostRpcTarget.cs (1)
118var healthStatus = CustomResourceSnapshot.ComputeHealthStatus(resourceEvent.Snapshot.HealthReports, resourceEvent.Snapshot.State?.Text);
Backchannel\AuxiliaryBackchannelRpcTarget.cs (1)
507var snapshot = resourceEvent.Snapshot;
CustomResourceExtensions.cs (2)
18/// <param name="initialSnapshot">The factory to create the initial <see cref="CustomResourceSnapshot"/> for this resource.</param> 22public static IResourceBuilder<TResource> WithInitialState<TResource>(this IResourceBuilder<TResource> builder, CustomResourceSnapshot initialSnapshot)
Dashboard\DashboardEventHandlers.cs (1)
515var snapshot = new CustomResourceSnapshot
Dashboard\DashboardServiceData.cs (1)
40static GenericResourceSnapshot CreateResourceSnapshot(IResource resource, string resourceId, DateTime creationTimestamp, CustomResourceSnapshot snapshot)
Dashboard\GenericResourceSnapshot.cs (1)
9internal sealed class GenericResourceSnapshot(CustomResourceSnapshot state) : ResourceSnapshot
Dashboard\ResourceSnapshot.cs (1)
51yield return (KnownProperties.Resource.HealthState, CustomResourceSnapshot.ComputeHealthStatus(HealthReports, State) is not { } healthStatus ? Value.ForNull() : Value.ForString(healthStatus.ToString()), IsSensitive: false);
Dcp\DcpExecutor.cs (4)
486private async Task ProcessResourceChange<T>(WatchEventType watchEventType, T resource, ConcurrentDictionary<string, T> resourceByName, string resourceKind, Func<T, CustomResourceSnapshot, CustomResourceSnapshot> snapshotFactory) where T : CustomResource 1629Func<CustomResourceSnapshot, CustomResourceSnapshot> snapshotBuild = er.DcpResource switch
Dcp\DcpExecutorEvents.cs (2)
13internal record OnResourceChangedContext(CancellationToken CancellationToken, string ResourceType, IResource Resource, string DcpResourceName, ResourceStatus Status, Func<CustomResourceSnapshot, CustomResourceSnapshot> UpdateSnapshot);
Dcp\ResourceSnapshotBuilder.cs (6)
20public CustomResourceSnapshot ToSnapshot(Container container, CustomResourceSnapshot previous) 94public CustomResourceSnapshot ToSnapshot(ContainerExec executable, CustomResourceSnapshot previous) 128public CustomResourceSnapshot ToSnapshot(Executable executable, CustomResourceSnapshot previous)
DistributedApplication.cs (1)
630public required CustomResourceSnapshot? Snapshot { get; init; }
Orchestrator\ApplicationOrchestrator.cs (2)
201static Task PublishUpdateAsync(ResourceNotificationService notificationService, IResource resource, string? resourceId, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
ParameterResourceBuilderExtensions.cs (1)
235var state = new CustomResourceSnapshot
Aspire.Hosting.Azure (2)
Provisioning\Provisioners\AzureProvisioner.cs (2)
43async Task UpdateStateAsync((IResource Resource, IAzureResource AzureResource) resource, Func<CustomResourceSnapshot, CustomResourceSnapshot> stateFactory)
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
761CustomResourceSnapshot? stoppedSnapshot = default;
Aspire.Hosting.Tests (6)
AddConnectionStringTests.cs (1)
63var state = annotation.InitialSnapshot;
AddParameterTests.cs (1)
33var state = annotation.InitialSnapshot;
Eventing\DistributedApplicationBuilderEventingTests.cs (1)
297var testSnapshot = new CustomResourceSnapshot
Health\HealthStatusTests.cs (1)
27var actualStatus = CustomResourceSnapshot.ComputeHealthStatus(reports, state);
Orchestrator\ParameterProcessorTests.cs (1)
84var updates = new List<(IResource Resource, CustomResourceSnapshot Snapshot)>();
ResourceNotificationTests.cs (1)
34var state = annotation.InitialSnapshot;