IAssetServicesClient
Namespace: Meshmakers.Octo.Sdk.ServiceClient.AssetRepositoryServices.System
Interface of the client proxy for asset services on system level.
public interface IAssetServicesClient : IServiceClient
Implements IServiceClient
Properties
Files
The platform file system of the client's tenant (System.Files): REST byte streaming plus GraphQL metadata. Uses the same endpoint, tenant and access token as this client.
public abstract IFilesClient Files { get; }
Property Value
Methods
GetImportJobStatusAsync(String)
Gets the status of an import job.
Task<JobDto> GetImportJobStatusAsync(string id)
Parameters
id String
The identifier of the import job.
Returns
ImportCkModelAsync(String, String)
Imports a construction kit model.
Task<string> ImportCkModelAsync(string tenantId, string ckModelFilePath)
Parameters
tenantId String
Tenant identifier
ckModelFilePath String
File path to the construction kit model file
that can be a JSON or a zipped JSON file.
Returns
Exceptions
CkUpgradeBlockedException
Against a service with the tenant upgrade guard of the file import: the file would break an
installed model (HTTP 409 CK_UPGRADE_BLOCKED); nothing was imported. Use the overload with
forceBreakingUpdate to override deliberately.
ImportCkModelAsync(String, String, Boolean)
Imports a construction kit model and states what to do when the tenant upgrade guard (CK v2 F2.5)
finds that the file would break an installed model - also for service-managed models such as System.
Task<string> ImportCkModelAsync(string tenantId, string ckModelFilePath, bool forceBreakingUpdate)
Parameters
tenantId String
Tenant identifier
ckModelFilePath String
File path to the construction kit model file (json, yaml or a zip of one).
forceBreakingUpdate Boolean
True imports even if the file breaks an installed model; the service then logs the blockers and the caller
at WARN. Requires the data model management policy (otherwise HTTP 403). False (the default of the other
overload) refuses a breaking file.
Returns
Task<String>
The id of the import job.
Exceptions
CkUpgradeBlockedException
The guard refused the file (only with forceBreakingUpdate false); nothing was imported.
ImportRtModelAsync(String, ImportStrategyDto, String)
Imports a runtime model
Task<string> ImportRtModelAsync(string tenantId, ImportStrategyDto importStrategy, string rtModelFilePath)
Parameters
tenantId String
Tenant identifier
importStrategy ImportStrategyDto
Import strategy for the runtime model.
rtModelFilePath String
File path to the runtime file that can be a JSON or a zipped JSON file.
Returns
ExportRtModelByQueryAsync(String, OctoObjectId)
Exports a runtime model by a query.
Task<string> ExportRtModelByQueryAsync(string tenantId, OctoObjectId queryId)
Parameters
tenantId String
Tenant identifier
queryId OctoObjectId
The query object identifier whose result is exported.
Returns
ExportRtModelByDeepGraphAsync(String, IEnumerable<OctoObjectId>, RtCkId<CkTypeId>, IEnumerable<DeepGraphFollowSpecDto>)
Exports a runtime model by deep graph.
Task<string> ExportRtModelByDeepGraphAsync(string tenantId, IEnumerable<OctoObjectId> originRtIds, RtCkId<CkTypeId> originCkTypeId, IEnumerable<DeepGraphFollowSpecDto> followSpecs)
Parameters
tenantId String
Tenant identifier
originRtIds IEnumerable<OctoObjectId>
Origin runtime identifiers
originCkTypeId RtCkId<CkTypeId>
Origin construction kit type identifier
followSpecs IEnumerable<DeepGraphFollowSpecDto>
Optional directed follow rules the traversal applies; null or empty keeps the ParentChild traversal
Returns
CleanTenantAsync(String)
Resets a child tenant to its initial state.
Task CleanTenantAsync(string childTenantId)
Parameters
childTenantId String
Child tenant identifier
Returns
Remarks:
Resets a child tenant to its initial state. This means that all data of the tenant is deleted and the construction kit is reset to the system-only models.
UpdateSystemCkModelOfTenant(String)
Updates the system construction kit model of a child tenant.
Task UpdateSystemCkModelOfTenant(string childTenantId)
Parameters
childTenantId String
Child tenant identifier
Returns
ClearTenantCacheAsync(String)
Clears the cache of a child tenant.
Task ClearTenantCacheAsync(string childTenantId)
Parameters
childTenantId String
Child tenant identifier
Returns
Remarks:
By executing this action, the cache of a child tenant is cleared. This means that all cached data of the tenant is deleted. That may result in a performance decrease of the tenant and unavailability of services for a certain time.
RecomputeTenantDisplayNamesAsync(String, String)
Recomputes the engine-computed display fields (rtDisplayName / rtDisplayDescription) of a child tenant's entities.
Task<IReadOnlyList<string>> RecomputeTenantDisplayNamesAsync(string childTenantId, string ckTypeId)
Parameters
childTenantId String
Child tenant identifier
ckTypeId String
Optional CK type id to restrict the recompute to (subtree); all rule-bearing types when null
Returns
Task<IReadOnlyList<String>>
The enqueued sweep keys (fully versioned CK type ids)
Remarks:
Enqueues durable, idempotent display-rule sweep tasks; the asset repository's sweep background service processes them asynchronously (default tick 60 s) and writes only entities whose stored value differs from the rule's result.
GetTenantsAsync()
Returns a list of all child tenants.
Task<IEnumerable<TenantDto>> GetTenantsAsync()
Returns
Remarks:
Direct children of the current tenant only. Roll-out tooling that needs to reach nested or re-parented tenants must use IAssetServicesClient.GetAllTenantsAsync() instead — this list silently omits every tenant that hangs below another tenant.
GetAllTenantsAsync()
Returns every tenant registered on the installation, regardless of its logical parent.
Task<IEnumerable<TenantDto>> GetAllTenantsAsync()
Returns
Remarks:
Only answered on the system tenant, whose database doubles as the platform-wide routing registry; any other tenant receives HTTP 403. This is the enumeration for installation-wide tooling such as workload roll-outs, which must reach sub-tenants and re-parented tenants that IAssetServicesClient.GetTenantsAsync() does not list.
GetTenantDescendantsAsync()
Returns EVERY descendant tenant of the current tenant — children,
grandchildren and so on — each entry carrying its
so the caller sees the tree
. Calls GET tenants/descendants on the tenant this client is
configured for (the tenant id comes from the client's service URI, not from a
parameter); an older service without the route fails the call (404) rather
than silently returning only the direct children.
Task<IEnumerable<TenantDto>> GetTenantDescendantsAsync()
Returns
ReconcileTenantRegistryAsync(Boolean)
Repairs the system tenant registry (POST system/v1/tenants/reconcile-registry):
tenants that a parent lists in its own registry (IAssetServicesClient.GetTenantDescendantsAsync()) but that lack
their system registry row (IAssetServicesClient.GetAllTenantsAsync()) get the row inserted. System tenant only.
apply false (default) is a dry run that writes nothing; rows are only ever inserted,
conflicts are reported and left alone; a second apply inserts nothing. Needs an asset-repo service
that has the route (older services answer 404).
Task<TenantRegistryReconcileReportDto> ReconcileTenantRegistryAsync(bool apply)
Parameters
apply Boolean
True to write the missing rows; false for a dry run.
Returns
Task<TenantRegistryReconcileReportDto>
ReviewTenantOwnershipAsync(Boolean)
Reviews tenant-database ownership (POST system/v1/tenants/review-ownership): lists this
instance's tenant databases that have no ownership marker, the marker of another OctoMesh instance, or a
registration in another instance's system database on the same MongoDB server. System tenant only.
stamp false (default) writes nothing; true writes this instance's marker only for
unambiguous databases (no marker, registered only here). Idempotent. Needs an asset-repo service that has
the route (older services answer 404).
Task<TenantOwnershipReviewReportDto> ReviewTenantOwnershipAsync(bool stamp)
Parameters
stamp Boolean
True to stamp the unambiguous unmarked databases; false to list only.
Returns
Task<TenantOwnershipReviewReportDto>
CreateTenantAsync(String, String)
Creates a new child tenant.
Task CreateTenantAsync(string childTenantId, string databaseName)
Parameters
childTenantId String
Child tenant identifier
databaseName String
Name of the database; null lets the service derive it: the tenant id, prefixed with the
instance's tenant-database prefix when one is configured. Services in older versions require the name.
Returns
CreateTenantAsync(String, String, Boolean)
Creates a new child tenant, optionally as a scratch tenant.
Task CreateTenantAsync(string childTenantId, string databaseName, bool scratch)
Parameters
childTenantId String
Child tenant identifier
databaseName String
Name of the database; null lets the service derive it.
scratch Boolean
True to create a scratch tenant.
Returns
Remarks:
With scratch the tenant records its creator and the creator's mirrored client becomes
administrator (TenantOwners) of the new tenant, so an agent can work in it and clean it up without a
human login. Only a client-credentials token of the direct parent with TenantManagement is accepted
(403 otherwise); the client has to be flagged AutoProvisionInChildTenants, or it has no mirror
in the child (400). Without the flag this is the same call as the overload without it.
CreateTenantAsync(String, String, Boolean, String)
Creates a new child tenant with a blueprint applied, optionally as a scratch tenant.
Task CreateTenantAsync(string childTenantId, string databaseName, bool scratch, string blueprintId)
Parameters
childTenantId String
Child tenant identifier
databaseName String
Name of the database; null lets the service derive it.
scratch Boolean
True to create a scratch tenant.
blueprintId String
Catalog blueprint id with version (<Name>-<version>, e.g. MyBlueprint-1.0.0), or
null for none.
Returns
Remarks:
The service creates the tenant and applies the blueprint in one transaction: when the blueprint is unknown or
fails to apply, it aborts, leaves no tenant behind and answers 400 ("Blueprint application failed: …"),
which this call throws. blueprintId is only sent when it is not empty, so with null
this is the same call as the overload without it.
AttachTenantAsync(String, String)
Attaches a child tenant.
Task AttachTenantAsync(string childTenantId, string databaseName)
Parameters
childTenantId String
Child tenant identifier
databaseName String
Name of the database
Returns
Remarks:
The Database must exist and the tenant will be added as a child tenant.
DetachTenantAsync(String)
Detaches a child tenant.
Task DetachTenantAsync(string childTenantId)
Parameters
childTenantId String
Child tenant identifier
Returns
Remarks:
The Database won't be deleted, but the child tenant will be removed.
DeleteTenantAsync(String)
Deletes a child tenant.
Task DeleteTenantAsync(string childTenantId)
Parameters
childTenantId String
Child tenant identifier
Returns
DeleteTenantAsync(String, Boolean)
Deletes a child tenant, optionally with the deliberate override of the cross-instance ownership guard .
Task DeleteTenantAsync(string childTenantId, bool overrideForeignOwnership)
Parameters
childTenantId String
Child tenant identifier
overrideForeignOwnership Boolean
When true, the delete drops a database that only carries another instance's marker (an orphaned
marker: no other instance registers it); the service logs the override as a warning naming the owner.
Another instance's system database and a database another instance still registers are never dropped.
Returns
Remarks:
Without the override the service refuses the delete with the uniform 409 "Database name '...' is not available." when the tenant's database belongs to another OctoMesh instance on the same MongoDB server (its ownership marker names another instance, or another instance's system database registers it).
GetTenantLifecycleAsync(String)
Returns the durable provisioning lifecycle state of a child tenant, or null when the
tenant has no lifecycle record.
Task<TenantLifecycleDto> GetTenantLifecycleAsync(string childTenantId)
Parameters
childTenantId String
Child tenant identifier
Returns
ReRunTenantSetupAsync(String)
Re-opens a child tenant's provisioning so the background reconciler completes it. Returns the
updated lifecycle state, or null when the tenant has no lifecycle record.
Task<TenantLifecycleDto> ReRunTenantSetupAsync(string childTenantId)
Parameters
childTenantId String
Child tenant identifier
Returns
GetTenantFeaturesStatusAsync()
Returns the aggregate enabled-state of the current tenant's capabilities (Stream Data, Communication, Reporting, AI Services) — the same flags the tenant delete/detach guard evaluates. The tenant is the one configured on the client options. Never returns null.
Task<TenantFeaturesStatusDto> GetTenantFeaturesStatusAsync()
Returns
Exceptions
InvalidOperationException
The service answered without a usable response body.
ReconfigureLogLevelAsync(String, LogLevelDto, LogLevelDto)
Reconfigure the log level of the service.
Task ReconfigureLogLevelAsync(string loggerName, LogLevelDto minLogLevel, LogLevelDto maxLogLevel)
Parameters
loggerName String
Logger pattern name, e. g. Microsoft.*
minLogLevel LogLevelDto
Minimal log level to be logged.
maxLogLevel LogLevelDto
Maximum log level to be logged.
Returns
GetCkModelCatalogsAsync()
Lists available CK model catalog sources.
Task<List<CkModelCatalogDto>> GetCkModelCatalogsAsync()
Returns
ListCkModelCatalogModelsAsync(String, String, Int32, Int32)
Lists models from catalogs, optionally filtered by catalog name or search term.
Task<CkModelCatalogListResponseDto> ListCkModelCatalogModelsAsync(string catalogName, string searchTerm, int skip, int take)
Parameters
catalogName String
searchTerm String
skip Int32
take Int32
Returns
Task<CkModelCatalogListResponseDto>
RefreshCkModelCatalogsAsync(String)
Refreshes CK model catalog caches.
Task RefreshCkModelCatalogsAsync(string catalogName)
Parameters
catalogName String
Returns
GetLibraryStatusAsync(String)
Gets the merged library status for a tenant (installed + catalog availability).
Task<CkModelLibraryStatusResponseDto> GetLibraryStatusAsync(string tenantId)
Parameters
tenantId String
Returns
Task<CkModelLibraryStatusResponseDto>
ResolveDependenciesBatchAsync(String, List<ImportFromCatalogRequestDto>)
Resolves dependencies for multiple models in a single call.
Task<BatchDependencyResolutionResponseDto> ResolveDependenciesBatchAsync(string tenantId, List<ImportFromCatalogRequestDto> requests)
Parameters
tenantId String
requests List<ImportFromCatalogRequestDto>
Returns
Task<BatchDependencyResolutionResponseDto>
ImportFromCatalogBatchAsync(String, ImportFromCatalogBatchRequestDto)
Imports multiple CK models from a catalog in dependency order. Tenant upgrade guard: the whole set is judged together; a set that would break an installed model is refused as a whole unless ImportFromCatalogBatchRequestDto.ForceBreakingUpdate is set.
Task<BatchImportResponseDto> ImportFromCatalogBatchAsync(string tenantId, ImportFromCatalogBatchRequestDto request)
Parameters
tenantId String
request ImportFromCatalogBatchRequestDto
Returns
Exceptions
CkUpgradeBlockedException
HTTP 409 CK_UPGRADE_BLOCKED: the update set would break an installed model; nothing was imported.
ImportFromCatalogAsync(String, ImportFromCatalogRequestDto)
Imports one CK model from a catalog (without resolving dependencies) and returns the job id. Tenant upgrade guard: refused unless ImportFromCatalogRequestDto.ForceBreakingUpdate is set when the model would break an installed model.
Task<TransferModelResponseDto> ImportFromCatalogAsync(string tenantId, ImportFromCatalogRequestDto request)
Parameters
tenantId String
request ImportFromCatalogRequestDto
Returns
Task<TransferModelResponseDto>
Exceptions
CkUpgradeBlockedException
HTTP 409 CK_UPGRADE_BLOCKED: the model would break an installed model; nothing was imported.
CheckUpgradeAsync(String, ImportFromCatalogRequestDto)
Pre-flight check for CK model upgrade/migration.
Task<UpgradeCheckResponseDto> CheckUpgradeAsync(string tenantId, ImportFromCatalogRequestDto request)
Parameters
tenantId String
request ImportFromCatalogRequestDto
Returns
ValidateCkModelAsync(String, String)
Validates a CK model draft against the models installed in the tenant without importing it.
Accepts a zip of the source ConstructionKit/ folder (compiled on the server) or a compiled model
(json, yaml or a zip of one). Read-only: no job, no tenant write.
Task<CkModelValidationResponseDto> ValidateCkModelAsync(string tenantId, string ckModelFilePath)
Parameters
tenantId String
Tenant identifier
ckModelFilePath String
Path to the draft (.zip, .json or .yaml).
Returns
Task<CkModelValidationResponseDto>
Valid, or the errors with file and element path; missing dependencies are errors.
ListBlueprintsAsync(Int32, Int32)
Lists blueprints available across configured catalogs.
Task<BlueprintCatalogListResponseDto> ListBlueprintsAsync(int skip, int take)
Parameters
skip Int32
take Int32
Returns
Task<BlueprintCatalogListResponseDto>
RefreshBlueprintCatalogsAsync(String)
Refreshes blueprint catalog caches at the asset repository. The server always performs a forced refresh. Returns one result per catalog (Refreshed / Skipped / Failed).
Task<BlueprintCatalogRefreshResponseDto> RefreshBlueprintCatalogsAsync(string catalogName)
Parameters
catalogName String
Optional catalog name (case-insensitive); null refreshes all catalogs.
Returns
Task<BlueprintCatalogRefreshResponseDto>
ApplyBlueprintAsync(String, String, Boolean)
Applies a blueprint to a tenant for the first time. With force=true,
re-applies seed data via upsert.
Task<BlueprintApplyResultDto> ApplyBlueprintAsync(string tenantId, string blueprintId, bool force)
Parameters
tenantId String
blueprintId String
force Boolean
Returns
ApplyBlueprintAsync(String, BlueprintApplyRequestDto)
Applies a blueprint with the full request. A blueprint whose CK models would break an installed
model is refused with HTTP 409 CK_UPGRADE_BLOCKED, surfaced as CkUpgradeBlockedException,
unless BlueprintApplyRequestDto.ForceBreakingUpdate is set.
Task<BlueprintApplyResultDto> ApplyBlueprintAsync(string tenantId, BlueprintApplyRequestDto request)
Parameters
tenantId String
request BlueprintApplyRequestDto
Returns
Exceptions
CkUpgradeBlockedException
The tenant upgrade guard refused the apply; nothing was changed.
GetBlueprintHistoryAsync(String)
Returns the blueprint application history for a tenant in chronological order.
Task<List<BlueprintHistoryItemDto>> GetBlueprintHistoryAsync(string tenantId)
Parameters
tenantId String
Returns
Task<List<BlueprintHistoryItemDto>>
GetBlueprintUpdateInfoAsync(String)
Returns update information for the tenant's current blueprint (available versions, recommended target).
Task<BlueprintUpdateInfoDto> GetBlueprintUpdateInfoAsync(string tenantId)
Parameters
tenantId String
Returns
PreviewBlueprintUpdateAsync(String, BlueprintUpdateRequestDto)
Previews the changes a blueprint update would make without applying them.
Task<BlueprintUpdatePreviewDto> PreviewBlueprintUpdateAsync(string tenantId, BlueprintUpdateRequestDto request)
Parameters
tenantId String
request BlueprintUpdateRequestDto
Returns
Task<BlueprintUpdatePreviewDto>
ApplyBlueprintUpdateAsync(String, BlueprintUpdateRequestDto)
Applies a blueprint update to a tenant. Without AllowBlanking / ConfirmedBlankings
the tenant values the seed would blank are kept; the result lists them. Against services
older than this change (HTTP 204, no body) the result is a success with empty lists. A blueprint whose CK
models would break an installed model is refused with HTTP 409 CK_UPGRADE_BLOCKED unless
BlueprintUpdateRequestDto.ForceBreakingUpdate is set; a dry run reports the blockers.
Task<BlueprintUpdateResultDto> ApplyBlueprintUpdateAsync(string tenantId, BlueprintUpdateRequestDto request)
Parameters
tenantId String
request BlueprintUpdateRequestDto
Returns
Task<BlueprintUpdateResultDto>
Exceptions
CkUpgradeBlockedException
The tenant upgrade guard refused the update; nothing was changed.
ListBlueprintInstallationsAsync(String)
Lists every blueprint currently installed on the tenant. Distinct from IAssetServicesClient.ListBlueprintsAsync(Int32, Int32) which enumerates the catalog.
Task<List<BlueprintInstallationDto>> ListBlueprintInstallationsAsync(string tenantId)
Parameters
tenantId String
Returns
Task<List<BlueprintInstallationDto>>
UninstallBlueprintAsync(String, String, Boolean)
Removes a blueprint from the tenant. With cascade=true,
dependents are uninstalled first and orphaned dependencies are
auto-cleaned. When dependents block it (HTTP 409), the result is returned with Success = false and
BlueprintUninstallResultDto.BlockingDependents (it was thrown before).
Task<BlueprintUninstallResultDto> UninstallBlueprintAsync(string tenantId, string blueprintName, bool cascade)
Parameters
tenantId String
blueprintName String
cascade Boolean
Returns
Task<BlueprintUninstallResultDto>
PreviewUninstallBlueprintAsync(String, String, Boolean)
The dry run of IAssetServicesClient.UninstallBlueprintAsync(String, String, Boolean). Changes nothing; the result
(BlueprintUninstallResultDto.DryRun = true) lists the entities the uninstall would erase and the
tenant-owned seed entities it would keep, with the reason. Calls
POST blueprints/{name}/uninstall/preview, a route of its own: an asset repository without answers
it with 404 (an exception), never with an uninstall. A 409 (dependents block it) is returned like for the
uninstall.
Task<BlueprintUninstallResultDto> PreviewUninstallBlueprintAsync(string tenantId, string blueprintName, bool cascade)
Parameters
tenantId String
blueprintName String
cascade Boolean
Returns
Task<BlueprintUninstallResultDto>
SendGraphQlAsync(String, String, String, String, CancellationToken)
Sends one GraphQL request to tenants/{tenantId}/GraphQL and returns the response body untouched
. The token is chosen like for every other call that addresses a tenant by name: a
token issued for another tenant is exchanged (cached per tenant) or, without an exchange, refused; it is
never sent as a fallback.
Task<GraphQlRawResponse> SendGraphQlAsync(string tenantId, string query, string variablesJson, string operationName, CancellationToken cancellationToken)
Parameters
tenantId String
The tenant whose GraphQL route is addressed.
query String
The GraphQL query or mutation text.
variablesJson String
Optional variables as a JSON object.
operationName String
Optional operation name when the document holds several operations.
cancellationToken CancellationToken
Cancels the call.
Returns
Task<GraphQlRawResponse>
The answer, also when it carries GraphQL errors (GraphQlRawResponse.HasErrors).
Exceptions
ArgumentException
variablesJson is not a JSON object.
TenantTokenMismatchException
The token is for another tenant and no exchange is available.
TenantTokenExchangeDeniedException
The exchange was denied, or the service answered 403.
UnauthorizedServiceAccessException
The service answered 401.