Zum Hauptinhalt springen

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. 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. The tus upload sink does not stay there: it is tenant-routed ({tenantId}/v1/tus-upload, see ), and the service stores the upload under the tenant's own directory. Every request of an upload β€” creation, offset read and parts β€” and the job call that consumes it address the tenant route. ServiceClient.ServiceUri is the system-scoped base of the operations above; a log line that prints it does not name the upload target.

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>

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

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

Parameters​

tenantId String

databaseName String

filePath String

oldDatabaseName String

restoreArchiveData Boolean

progressCallback Action<Double>

cancellationToken CancellationToken

overrideForeignOwnership Boolean

Returns​

Task<JobResponseDto>

UploadRestoreFileWithTusAsync(String, String, String, String, Action<Double>, CancellationToken)​

public Task<string> UploadRestoreFileWithTusAsync(string tenantId, string databaseName, string filePath, string oldDatabaseName, Action<double> progressCallback, CancellationToken cancellationToken)

Parameters​

tenantId String

databaseName String

filePath String

oldDatabaseName String

progressCallback Action<Double>

cancellationToken CancellationToken

Returns​

Task<String>

StartRestoreFromUploadAsync(String, String, String, String, Boolean)​

public Task<JobResponseDto> StartRestoreFromUploadAsync(string tenantId, string tusFileId, string databaseName, string oldDatabaseName, bool restoreArchiveData)

Parameters​

tenantId String

tusFileId String

databaseName String

oldDatabaseName String

restoreArchiveData Boolean

Returns​

Task<JobResponseDto>

StartRestoreFromUploadAsync(String, String, String, String, Boolean, Boolean)​

public Task<JobResponseDto> StartRestoreFromUploadAsync(string tenantId, string tusFileId, string databaseName, string oldDatabaseName, bool restoreArchiveData, bool overrideForeignOwnership)

Parameters​

tenantId String

tusFileId String

databaseName String

oldDatabaseName String

restoreArchiveData Boolean

overrideForeignOwnership Boolean

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>

UploadArchiveDataWithTusAsync(String, String, String, Action<Double>, CancellationToken)​

public Task<string> UploadArchiveDataWithTusAsync(string tenantId, string archiveRtId, string filePath, Action<double> progressCallback, CancellationToken cancellationToken)

Parameters​

tenantId String

archiveRtId String

filePath String

progressCallback Action<Double>

cancellationToken CancellationToken

Returns​

Task<String>

StartImportArchiveDataFromUploadAsync(String, String, String, ArchiveImportMode)​

public Task<JobResponseDto> StartImportArchiveDataFromUploadAsync(string tenantId, string tusFileId, string archiveRtId, ArchiveImportMode mode)

Parameters​

tenantId String

tusFileId String

archiveRtId String

mode ArchiveImportMode

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. It is the base URI of the operations that have no tenant route β€” job status, job download and diagnostics. The tenant-addressed job verbs and the tus upload 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.