Skip to main content

ITenantBlueprintHistory

Namespace: Meshmakers.Octo.Runtime.Contracts.Blueprints

Service for tracking blueprint application history per tenant

public interface ITenantBlueprintHistory

Methods

GetHistoryAsync(String, CancellationToken)

Gets the complete blueprint application history for a tenant

Task<IReadOnlyList<TenantBlueprintInfo>> GetHistoryAsync(string tenantId, CancellationToken cancellationToken)

Parameters

tenantId String
Tenant identifier

cancellationToken CancellationToken
Cancellation token

Returns

Task<IReadOnlyList<TenantBlueprintInfo>>
List of blueprint applications in chronological order

GetCurrentAsync(String, CancellationToken)

Gets the most recent history entry of the tenant, across all blueprints.

Task<TenantBlueprintInfo> GetCurrentAsync(string tenantId, CancellationToken cancellationToken)

Parameters

tenantId String
Tenant identifier

cancellationToken CancellationToken
Cancellation token

Returns

Task<TenantBlueprintInfo>
Most recent blueprint info, or null if no blueprint was applied

Remarks:

A tenant can host any number of blueprints concurrently, so "the last entry of the tenant" says nothing about a specific blueprint - on a multi-blueprint tenant this returns whichever blueprint happened to be applied last. Any caller that means "the version of blueprint X currently in effect" has to use ITenantBlueprintHistory.GetCurrentByBlueprintNameAsync(String, String, CancellationToken) instead.

GetCurrentByBlueprintNameAsync(String, String, CancellationToken)

Gets the most recent history entry of one specific blueprint on the tenant.

Task<TenantBlueprintInfo> GetCurrentByBlueprintNameAsync(string tenantId, string blueprintName, CancellationToken cancellationToken)

Parameters

tenantId String
Tenant identifier

blueprintName String
Blueprint name, without the version suffix. Must not be null, empty or whitespace - use ITenantBlueprintHistory.GetCurrentAsync(String, CancellationToken) when no specific blueprint is meant.

cancellationToken CancellationToken
Cancellation token

Returns

Task<TenantBlueprintInfo>
Most recent blueprint info of that blueprint, or null when the blueprint was never applied to the tenant

Remarks:

This is the lookup the update path needs: it answers "which version of this blueprint is in effect", independently of what else was applied to the tenant afterwards. Counterpart of ITenantBlueprintInstallations.GetByBlueprintNameAsync(String, String, CancellationToken) on the live-state side.

AddEntryAsync(String, TenantBlueprintInfo, CancellationToken)

Records a new blueprint application

Task AddEntryAsync(string tenantId, TenantBlueprintInfo info, CancellationToken cancellationToken)

Parameters

tenantId String
Tenant identifier

info TenantBlueprintInfo
Blueprint application info

cancellationToken CancellationToken
Cancellation token

Returns

Task

HasBlueprintAsync(String, CancellationToken)

Checks if a tenant has any blueprint applied

Task<bool> HasBlueprintAsync(string tenantId, CancellationToken cancellationToken)

Parameters

tenantId String
Tenant identifier

cancellationToken CancellationToken
Cancellation token

Returns

Task<Boolean>
True if a blueprint was applied to this tenant