Skip to main content

BotServicesClient

Namespace: Meshmakers.Octo.Sdk.ServiceClient.BotServices

Implementation of the client proxy for bot services.

public class BotServicesClient : ServiceClient, IServiceClient, IBotServicesClient

Inheritance Object → ServiceClient → BotServicesClient
Implements IServiceClient, IBotServicesClient

Remarks:

🔴 The base URI stays system-scoped; five job verbs leave it (AB#5060). Dump, restore-from-upload, archive export, archive import and the fixup run used to address their tenant through a ?tenantId= query parameter on system/v1/jobs/…. The service's transport tenant gate reads the tenant from the route value, so that form was never matched against the caller's tenant_id claim — a token issued for one tenant could dump or restore another. Those five now build an absolute {tenantId}/v1/jobs/… URL from their own tenantId argument (see ), the same way the tus calls below build their absolute upload URL.

The tenant is per call, not per client, on purpose. It is the first argument of every one of those methods and routinely differs from the caller's own tenant — backing up a child tenant as its parent's administrator is exactly what the tenant routes were added for. An ambient tenant on the options could not express it: ServiceClient.ServiceUri is built once and cached, and octo-cli holds this client as a singleton. Keeping the tenant in the argument also leaves every public signature untouched.

What deliberately stays on system/v1: job status, job download (both the buffered and the streaming variant) and the diagnostics log-level verb — they act on a job instance or on the service process, not on a tenant, and have no tenant route. So does the tus upload sink: the service stores the upload flat under its tus file id, and the tenant-carrying, gated decision is the restore / import call that consumes it. Both tus methods below build the system upload URL and a tenant job URL in the same body — they are not interchangeable.

Properties​

Options​

Returns the options for configuration of the client proxy.

public ServiceClientOptions Options { get; }

Property Value​

ServiceClientOptions

AccessToken​

public IServiceClientAccessToken AccessToken { get; }

Property Value​

IServiceClientAccessToken

ServiceUri​

public Uri ServiceUri { get; }

Property Value​

Uri

Constructors​

BotServicesClient(IOptions<BotServiceClientOptions>, IBotServiceClientAccessToken)​

Constructor.

public BotServicesClient(IOptions<BotServiceClientOptions> serviceClientOptions, IBotServiceClientAccessToken botAccessToken)

Parameters​

serviceClientOptions IOptions<BotServiceClientOptions>
Options for configuration of the client proxy.

botAccessToken IBotServiceClientAccessToken
The access token management object

BotServicesClient(BotServiceClientOptions, IBotServiceClientAccessToken)​

Constructor.

public BotServicesClient(BotServiceClientOptions serviceClientOptions, IBotServiceClientAccessToken botAccessToken)

Parameters​

serviceClientOptions BotServiceClientOptions
Options for configuration of the client proxy.

botAccessToken IBotServiceClientAccessToken
The access token management object

Methods​

GetImportJobStatus(String)​

public Task<JobDto> GetImportJobStatus(string id)

Parameters​

id String

Returns​

Task<JobDto>

DownloadExportRtResultAsync(String, String)​

public Task<Byte[]> DownloadExportRtResultAsync(string tenantId, string id)

Parameters​

tenantId String

id String

Returns​

Task<Byte[]>

StartRunFixupScriptAsync(String)​

public Task<JobResponseDto> StartRunFixupScriptAsync(string tenantId)

Parameters​

tenantId String

Returns​

Task<JobResponseDto>

StartDumpRepositoryAsync(String, Boolean)​

public Task<JobResponseDto> StartDumpRepositoryAsync(string tenantId, bool includeArchiveData)

Parameters​

tenantId String

includeArchiveData Boolean

Returns​

Task<JobResponseDto>

ReconfigureLogLevelAsync(String, LogLevelDto, LogLevelDto)​

public Task ReconfigureLogLevelAsync(string loggerName, LogLevelDto minLogLevel, LogLevelDto maxLogLevel)

Parameters​

loggerName String

minLogLevel LogLevelDto

maxLogLevel LogLevelDto

Returns​

Task

RestoreRepositoryWithTusAsync(String, String, String, String, Boolean, Action<Double>, CancellationToken)​

public Task<JobResponseDto> RestoreRepositoryWithTusAsync(string tenantId, string databaseName, string filePath, string oldDatabaseName, bool restoreArchiveData, Action<double> progressCallback, CancellationToken cancellationToken)

Parameters​

tenantId String

databaseName String

filePath String

oldDatabaseName String

restoreArchiveData Boolean

progressCallback Action<Double>

cancellationToken CancellationToken

Returns​

Task<JobResponseDto>

DownloadDumpToFileAsync(String, String, String, Action<Int64>, CancellationToken)​

public Task DownloadDumpToFileAsync(string tenantId, string jobId, string outputFilePath, Action<long> progressCallback, CancellationToken cancellationToken)

Parameters​

tenantId String

jobId String

outputFilePath String

progressCallback Action<Int64>

cancellationToken CancellationToken

Returns​

Task

StartExportArchiveDataAsync(String, String, Nullable<DateTime>, Nullable<DateTime>)​

public Task<JobResponseDto> StartExportArchiveDataAsync(string tenantId, string archiveRtId, Nullable<DateTime> fromUtc, Nullable<DateTime> toUtc)

Parameters​

tenantId String

archiveRtId String

fromUtc Nullable<DateTime>

toUtc Nullable<DateTime>

Returns​

Task<JobResponseDto>

StartImportArchiveDataWithTusAsync(String, String, String, ArchiveImportMode, Action<Double>, CancellationToken)​

public Task<JobResponseDto> StartImportArchiveDataWithTusAsync(string tenantId, string archiveRtId, string filePath, ArchiveImportMode mode, Action<double> progressCallback, CancellationToken cancellationToken)

Parameters​

tenantId String

archiveRtId String

filePath String

mode ArchiveImportMode

progressCallback Action<Double>

cancellationToken CancellationToken

Returns​

Task<JobResponseDto>

StartSecretSweepAsync(String, SecretSweepModeDto, Boolean)​

public Task<JobResponseDto> StartSecretSweepAsync(string tenantId, SecretSweepModeDto mode, bool confirm)

Parameters​

tenantId String

mode SecretSweepModeDto

confirm Boolean

Returns​

Task<JobResponseDto>

GetSecretSweepReportAsync(String)​

public Task<SecretSweepReportDto> GetSecretSweepReportAsync(string tenantId)

Parameters​

tenantId String

Returns​

Task<SecretSweepReportDto>

StartSecretSweepAllTenantsAsync(SecretSweepModeDto, Boolean)​

public Task<JobResponseDto> StartSecretSweepAllTenantsAsync(SecretSweepModeDto mode, bool confirm)

Parameters​

mode SecretSweepModeDto

confirm Boolean

Returns​

Task<JobResponseDto>

GetSecretSweepReportsAsync()​

public Task<IReadOnlyList<SecretSweepReportDto>> GetSecretSweepReportsAsync()

Returns​

Task<IReadOnlyList<SecretSweepReportDto>>

GetSecretEnvironmentStatusAsync(String)​

public Task<SecretEnvironmentStatusDto> GetSecretEnvironmentStatusAsync(string tenantId)

Parameters​

tenantId String

Returns​

Task<SecretEnvironmentStatusDto>

GetSecretSweepRunsAsync(String, Int32)​

public Task<IReadOnlyList<SecretSweepRunDto>> GetSecretSweepRunsAsync(string tenantId, int limit)

Parameters​

tenantId String

limit Int32

Returns​

Task<IReadOnlyList<SecretSweepRunDto>>

DeleteSecretSweepDumpAsync(String, String)​

public Task<SecretSweepDumpDeleteResultDto> DeleteSecretSweepDumpAsync(string tenantId, string runId)

Parameters​

tenantId String

runId String

Returns​

Task<SecretSweepDumpDeleteResultDto>

RestoreSecretSweepDumpAsync(String, String, Boolean)​

public Task<JobResponseDto> RestoreSecretSweepDumpAsync(string tenantId, string runId, bool confirm)

Parameters​

tenantId String

runId String

confirm Boolean

Returns​

Task<JobResponseDto>

BuildServiceUri()​

protected Uri BuildServiceUri()

Returns​

Uri

Remarks:

Stays system-scoped (AB#5060). It is the base URI of the operations that have no tenant route — job status, job download, diagnostics and the tus upload sink. The tenant-addressed job verbs do not use it; they build their URL per call from their own tenantId argument, because this value is computed once and cached for the lifetime of the client.