26 instantiations of CustomResourceSnapshot
Aspire.Hosting (6)
ApplicationModel\CertificateAuthorityCollectionResourceExtensions.cs (1)
28
.WithInitialState(new
CustomResourceSnapshot
ApplicationModel\ResourceNotificationService.cs (1)
813
previousState ??= new
CustomResourceSnapshot
()
ConnectionStringBuilderExtensions.cs (1)
81
.WithInitialState(new
CustomResourceSnapshot
Dashboard\DashboardEventHandlers.cs (1)
457
var snapshot = new
CustomResourceSnapshot
ExternalServiceBuilderExtensions.cs (1)
82
.WithInitialState(new
CustomResourceSnapshot
ParameterResourceBuilderExtensions.cs (1)
221
var state = new
CustomResourceSnapshot
Aspire.Hosting.DevTunnels (2)
DevTunnelResourceBuilderExtensions.cs (2)
104
.WithInitialState(
new
()
573
.WithInitialState(
new
()
Aspire.Hosting.GitHub.Models (1)
GitHubModelsExtensions.cs (1)
52
.WithInitialState(
new
()
Aspire.Hosting.OpenAI (2)
OpenAIExtensions.cs (2)
64
.WithInitialState(
new
()
111
.WithInitialState(
new
()
Aspire.Hosting.Tests (8)
Backchannel\AppHostBackchannelTests.cs (1)
59
.WithInitialState(
new
() {
Backchannel\Exec\ContainerResourceExecTests.cs (1)
68
.WithInitialState(
new
()
Backchannel\Exec\ProjectResourceExecTests.cs (1)
129
.WithInitialState(
new
()
Dashboard\ResourcePublisherTests.cs (1)
184
return new GenericResourceSnapshot(
new
()
Eventing\DistributedApplicationBuilderEventingTests.cs (1)
296
var testSnapshot = new
CustomResourceSnapshot
ResourceCommandAnnotationTests.cs (1)
56
ResourceSnapshot = new
CustomResourceSnapshot
ResourceNotificationTests.cs (1)
22
.WithInitialState(
new
()
WithUrlsTests.cs (1)
502
.WithInitialState(
new
()
CustomResources.AppHost (3)
TalkingClockResource.cs (2)
40
.WithInitialState(new
CustomResourceSnapshot
// Aspire type for custom resource state.
129
.WithInitialState(
new
()
TestResource.cs (1)
16
.WithInitialState(
new
()
HealthChecksSandbox.AppHost (1)
Program.cs (1)
52
.WithInitialState(
new
()
Stress.AppHost (3)
Program.cs (1)
31
.WithInitialState(new
CustomResourceSnapshot
TestResource.cs (2)
17
.WithInitialState(
new
()
34
.WithInitialState(
new
()
57 references to CustomResourceSnapshot
Aspire.Hosting (48)
ApplicationModel\ResourceCommandAnnotation.cs (1)
174
public required
CustomResourceSnapshot
ResourceSnapshot { get; init; }
ApplicationModel\ResourceNotificationService.cs (23)
242
static bool ShouldYield(WaitBehavior waitBehavior,
CustomResourceSnapshot
snapshot) =>
276
var
snapshot = resourceEvent.Snapshot;
304
static bool IsKnownTerminalState(
CustomResourceSnapshot
snapshot) =>
331
var
snapshot = resourceEvent.Snapshot;
363
static bool IsContinuableState(WaitBehavior waitBehavior,
CustomResourceSnapshot
snapshot) =>
583
/// Updates the snapshot of the <see cref="
CustomResourceSnapshot
"/> for a resource.
588
public Task PublishUpdateAsync(IResource resource, string resourceId, Func<
CustomResourceSnapshot
,
CustomResourceSnapshot
> stateFactory)
598
var
previousState = GetCurrentSnapshot(resource, notificationState);
600
var
newState = stateFactory(previousState);
688
private
CustomResourceSnapshot
UpdateCommands(IResource resource,
CustomResourceSnapshot
previousState)
751
static ResourceCommandSnapshot CreateCommandFromAnnotation(ResourceCommandAnnotation annotation,
CustomResourceSnapshot
previousState, IServiceProvider serviceProvider)
762
private static
CustomResourceSnapshot
UpdateIcons(IResource resource,
CustomResourceSnapshot
previousState)
788
/// Updates the snapshot of the <see cref="
CustomResourceSnapshot
"/> for a resource.
792
public async Task PublishUpdateAsync(IResource resource, Func<
CustomResourceSnapshot
,
CustomResourceSnapshot
> stateFactory)
801
private static
CustomResourceSnapshot
GetCurrentSnapshot(IResource resource, ResourceNotificationState notificationState)
803
var
previousState = notificationState.LastSnapshot;
845
public
CustomResourceSnapshot
? LastSnapshot { get; set; }
873
public class ResourceEvent(IResource resource, string resourceId,
CustomResourceSnapshot
snapshot)
888
public
CustomResourceSnapshot
Snapshot { get; } = snapshot;
ApplicationModel\ResourceSnapshotAnnotation.cs (2)
9
public class ResourceSnapshotAnnotation(
CustomResourceSnapshot
initialSnapshot) : IResourceAnnotation
14
public
CustomResourceSnapshot
InitialSnapshot { get; } = initialSnapshot ?? throw new ArgumentNullException(nameof(initialSnapshot));
Backchannel\AppHostRpcTarget.cs (1)
93
var healthStatus =
CustomResourceSnapshot
.ComputeHealthStatus(resourceEvent.Snapshot.HealthReports, resourceEvent.Snapshot.State?.Text);
CustomResourceExtensions.cs (2)
18
/// <param name="initialSnapshot">The factory to create the initial <see cref="
CustomResourceSnapshot
"/> for this resource.</param>
20
public static IResourceBuilder<TResource> WithInitialState<TResource>(this IResourceBuilder<TResource> builder,
CustomResourceSnapshot
initialSnapshot)
Dashboard\DashboardEventHandlers.cs (1)
457
var
snapshot = new CustomResourceSnapshot
Dashboard\DashboardServiceData.cs (1)
40
static GenericResourceSnapshot CreateResourceSnapshot(IResource resource, string resourceId, DateTime creationTimestamp,
CustomResourceSnapshot
snapshot)
Dashboard\GenericResourceSnapshot.cs (1)
9
internal sealed class GenericResourceSnapshot(
CustomResourceSnapshot
state) : ResourceSnapshot
Dashboard\ResourceSnapshot.cs (1)
51
yield return (KnownProperties.Resource.HealthState,
CustomResourceSnapshot
.ComputeHealthStatus(HealthReports, State) is not { } healthStatus ? Value.ForNull() : Value.ForString(healthStatus.ToString()), IsSensitive: false);
Dcp\DcpExecutor.cs (4)
410
private async Task ProcessResourceChange<T>(WatchEventType watchEventType, T resource, ConcurrentDictionary<string, T> resourceByName, string resourceKind, Func<T,
CustomResourceSnapshot
,
CustomResourceSnapshot
> snapshotFactory) where T : CustomResource
1442
Func<
CustomResourceSnapshot
,
CustomResourceSnapshot
> snapshotBuild = er.DcpResource switch
Dcp\DcpExecutorEvents.cs (2)
13
internal record OnResourceChangedContext(CancellationToken CancellationToken, string ResourceType, IResource Resource, string DcpResourceName, ResourceStatus Status, Func<
CustomResourceSnapshot
,
CustomResourceSnapshot
> UpdateSnapshot);
Dcp\ResourceSnapshotBuilder.cs (6)
20
public
CustomResourceSnapshot
ToSnapshot(Container container,
CustomResourceSnapshot
previous)
94
public
CustomResourceSnapshot
ToSnapshot(ContainerExec executable,
CustomResourceSnapshot
previous)
128
public
CustomResourceSnapshot
ToSnapshot(Executable executable,
CustomResourceSnapshot
previous)
Orchestrator\ApplicationOrchestrator.cs (2)
199
static Task PublishUpdateAsync(ResourceNotificationService notificationService, IResource resource, string? resourceId, Func<
CustomResourceSnapshot
,
CustomResourceSnapshot
> stateFactory)
ParameterResourceBuilderExtensions.cs (1)
221
var
state = new CustomResourceSnapshot
Aspire.Hosting.Azure (2)
Provisioning\Provisioners\AzureProvisioner.cs (2)
43
async Task UpdateStateAsync((IResource Resource, IAzureResource AzureResource) resource, Func<
CustomResourceSnapshot
,
CustomResourceSnapshot
> stateFactory)
Aspire.Hosting.DevTunnels (1)
DevTunnelResourceBuilderExtensions.cs (1)
683
CustomResourceSnapshot
? stoppedSnapshot = default;
Aspire.Hosting.Tests (6)
AddConnectionStringTests.cs (1)
62
var
state = annotation.InitialSnapshot;
AddParameterTests.cs (1)
32
var
state = annotation.InitialSnapshot;
Eventing\DistributedApplicationBuilderEventingTests.cs (1)
296
var
testSnapshot = new CustomResourceSnapshot
Health\HealthStatusTests.cs (1)
26
var actualStatus =
CustomResourceSnapshot
.ComputeHealthStatus(reports, state);
Orchestrator\ParameterProcessorTests.cs (1)
79
var updates = new List<(IResource Resource,
CustomResourceSnapshot
Snapshot)>();
ResourceNotificationTests.cs (1)
32
var
state = annotation.InitialSnapshot;