Skip to main content

IBlueprintService

Namespace: Meshmakers.Octo.Runtime.Contracts.Blueprints

Service for applying blueprints to tenants

public interface IBlueprintService

Methods

ApplyBlueprintAsync(String, BlueprintId, Boolean, CancellationToken)

Applies a blueprint to initialize a tenant with CK models and seed data.

Task<BlueprintApplicationResult> ApplyBlueprintAsync(string tenantId, BlueprintId blueprintId, bool force, CancellationToken cancellationToken)

Parameters

tenantId String
Target tenant identifier

blueprintId BlueprintId
Blueprint to apply

force Boolean
If true, re-apply seed data via upsert even if the same version is already recorded for the tenant (recovery after storage corruption or manual cleanup). The recorded application mode is then BlueprintApplicationMode.ReApply instead of BlueprintApplicationMode.Initial.

cancellationToken CancellationToken
Cancellation token

Returns

Task<BlueprintApplicationResult>
Result of the blueprint application

ValidateBlueprintAsync(BlueprintId, CancellationToken)

Validates that a blueprint can be applied (checks CK dependencies exist, seed data is valid, etc.)

Task<BlueprintValidationResult> ValidateBlueprintAsync(BlueprintId blueprintId, CancellationToken cancellationToken)

Parameters

blueprintId BlueprintId
Blueprint to validate

cancellationToken CancellationToken
Cancellation token

Returns

Task<BlueprintValidationResult>
Result of the validation

ListBlueprintsAsync(Int32, Int32, CancellationToken)

Lists all available blueprints

Task<BlueprintListResult> ListBlueprintsAsync(int skip, int take, CancellationToken cancellationToken)

Parameters

skip Int32
Number of blueprints to skip

take Int32
Number of blueprints to take

cancellationToken CancellationToken
Cancellation token

Returns

Task<BlueprintListResult>
List of available blueprints

SearchBlueprintsAsync(String, Int32, Int32, CancellationToken)

Searches for blueprints by name or description

Task<BlueprintSearchResult> SearchBlueprintsAsync(string searchTerm, int skip, int take, CancellationToken cancellationToken)

Parameters

searchTerm String
Search term

skip Int32
Number of blueprints to skip

take Int32
Number of blueprints to take

cancellationToken CancellationToken
Cancellation token

Returns

Task<BlueprintSearchResult>
Search results

GetUpdateInfoAsync(String, CancellationToken)

Gets update information for a tenant's current blueprint

Task<BlueprintUpdateInfo> GetUpdateInfoAsync(string tenantId, CancellationToken cancellationToken)

Parameters

tenantId String
Tenant identifier

cancellationToken CancellationToken
Cancellation token

Returns

Task<BlueprintUpdateInfo>
Information about available updates, or null if no blueprint is applied

PreviewUpdateAsync(String, BlueprintId, BlueprintUpdateMode, CancellationToken)

Previews the changes that would be made by updating to a specific blueprint version

Task<BlueprintUpdatePreview> PreviewUpdateAsync(string tenantId, BlueprintId targetVersion, BlueprintUpdateMode updateMode, CancellationToken cancellationToken)

Parameters

tenantId String
Tenant identifier

targetVersion BlueprintId
Target blueprint version

updateMode BlueprintUpdateMode
How to apply the update

cancellationToken CancellationToken
Cancellation token

Returns

Task<BlueprintUpdatePreview>
Preview of changes including conflicts

ApplyUpdateAsync(String, BlueprintId, BlueprintUpdateMode, BlueprintUpdateOptions, CancellationToken)

Applies an update to a tenant's blueprint

Task<BlueprintUpdateResult> ApplyUpdateAsync(string tenantId, BlueprintId targetVersion, BlueprintUpdateMode updateMode, BlueprintUpdateOptions options, CancellationToken cancellationToken)

Parameters

tenantId String
Tenant identifier

targetVersion BlueprintId
Target blueprint version

updateMode BlueprintUpdateMode
How to apply the update

options BlueprintUpdateOptions
Update options including conflict resolutions

cancellationToken CancellationToken
Cancellation token

Returns

Task<BlueprintUpdateResult>
Result of the update operation

GetHistoryAsync(String, CancellationToken)

Gets the 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

RollbackAsync(String, String, CancellationToken)

Restores a tenant from a backup, returning the tenant to the state captured in the backup. Wraps ITenantBackupService.RestoreBackupAsync(String, String, CancellationToken) with audit-trail notifications.

Task<BackupRestoreResult> RollbackAsync(string tenantId, string backupId, CancellationToken cancellationToken)

Parameters

tenantId String
Target tenant identifier

backupId String
Backup identifier to restore from

cancellationToken CancellationToken
Cancellation token

Returns

Task<BackupRestoreResult>
Result of the rollback

UninstallAsync(String, String, Boolean, CancellationToken)

Removes a blueprint from a tenant. Locked entities owned by the blueprint are erased; unlocked entities are left as user data (they may have been adopted by the user after the original apply).

Task<BlueprintUninstallResult> UninstallAsync(string tenantId, string blueprintName, bool cascade, CancellationToken cancellationToken)

Parameters

tenantId String
Target tenant identifier.

blueprintName String
Name of the blueprint to uninstall.

cascade Boolean
When true, transitive dependencies of the uninstalled blueprint that were originally installed as dependencies (IsDependency = true) and that no other installed blueprint still references are uninstalled in the same pass. When false, dependencies are left in place.

cancellationToken CancellationToken
Cancellation token.

Returns

Task<BlueprintUninstallResult>
BlueprintUninstallResult describing how many entities were removed, which dependencies were cascaded, and any conflicts that prevented the uninstall (e.g. other installed blueprints still depend on the requested target).