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β
AccessTokenβ
public IServiceClientAccessToken AccessToken { get; }
Property Valueβ
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β
DownloadExportRtResultAsync(String, String)β
public Task<Byte[]> DownloadExportRtResultAsync(string tenantId, string id)
Parametersβ
tenantId String
id String
Returnsβ
StartRunFixupScriptAsync(String)β
public Task<JobResponseDto> StartRunFixupScriptAsync(string tenantId)
Parametersβ
tenantId String
Returnsβ
StartDumpRepositoryAsync(String, Boolean)β
public Task<JobResponseDto> StartDumpRepositoryAsync(string tenantId, bool includeArchiveData)
Parametersβ
tenantId String
includeArchiveData Boolean
Returnsβ
ReconfigureLogLevelAsync(String, LogLevelDto, LogLevelDto)β
public Task ReconfigureLogLevelAsync(string loggerName, LogLevelDto minLogLevel, LogLevelDto maxLogLevel)
Parametersβ
loggerName String
minLogLevel LogLevelDto
maxLogLevel LogLevelDto
Returnsβ
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β
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β
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β
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β
StartSecretSweepAsync(String, SecretSweepModeDto, Boolean)β
public Task<JobResponseDto> StartSecretSweepAsync(string tenantId, SecretSweepModeDto mode, bool confirm)
Parametersβ
tenantId String
mode SecretSweepModeDto
confirm Boolean
Returnsβ
GetSecretSweepReportAsync(String)β
public Task<SecretSweepReportDto> GetSecretSweepReportAsync(string tenantId)
Parametersβ
tenantId String
Returnsβ
StartSecretSweepAllTenantsAsync(SecretSweepModeDto, Boolean)β
public Task<JobResponseDto> StartSecretSweepAllTenantsAsync(SecretSweepModeDto mode, bool confirm)
Parametersβ
mode SecretSweepModeDto
confirm Boolean
Returnsβ
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β
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.