Interface IConfigClient
- Namespace
- OpenShell
- Assembly
- OpenShell.Sdk.dll
Reads and updates sandbox and gateway configuration.
public interface IConfigClient
Methods
DeleteGlobalSettingAsync(string, CancellationToken)
Deletes one gateway-global setting.
ValueTask<ConfigUpdateResult> DeleteGlobalSettingAsync(string key, CancellationToken cancellationToken = default)
Parameters
keystringcancellationTokenCancellationToken
Returns
GetGatewayAsync(CancellationToken)
Gets the gateway-global settings.
ValueTask<GatewayConfig> GetGatewayAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
GetSandboxAsync(string, CancellationToken)
Gets the effective policy and settings of a sandbox.
ValueTask<SandboxConfig> GetSandboxAsync(string sandbox, CancellationToken cancellationToken = default)
Parameters
sandboxstringcancellationTokenCancellationToken
Returns
MergePolicyAsync(string, IReadOnlyList<PolicyMergeOperation>, SetPolicyOptions?, CancellationToken)
Applies incremental network policy merge operations to a sandbox.
ValueTask<ConfigUpdateResult> MergePolicyAsync(string sandbox, IReadOnlyList<PolicyMergeOperation> operations, SetPolicyOptions? options = null, CancellationToken cancellationToken = default)
Parameters
sandboxstringoperationsIReadOnlyList<PolicyMergeOperation>optionsSetPolicyOptionscancellationTokenCancellationToken
Returns
SetGlobalPolicyAsync(SandboxPolicy, string?, CancellationToken)
Replaces the gateway-global policy for every sandbox.
ValueTask<ConfigUpdateResult> SetGlobalPolicyAsync(SandboxPolicy policy, string? requestId = null, CancellationToken cancellationToken = default)
Parameters
policySandboxPolicyrequestIdstringcancellationTokenCancellationToken
Returns
SetGlobalSettingAsync(string, SettingValue, CancellationToken)
Upserts one gateway-global setting.
ValueTask<ConfigUpdateResult> SetGlobalSettingAsync(string key, SettingValue value, CancellationToken cancellationToken = default)
Parameters
keystringvalueSettingValuecancellationTokenCancellationToken
Returns
SetPolicyAsync(string, SandboxPolicy, SetPolicyOptions?, CancellationToken)
Updates the sandbox-scoped policy. Only network_policies may differ from the create-time policy;
the gateway rejects changes to the static fields, so set those when the sandbox is created.
ValueTask<ConfigUpdateResult> SetPolicyAsync(string sandbox, SandboxPolicy policy, SetPolicyOptions? options = null, CancellationToken cancellationToken = default)
Parameters
sandboxstringpolicySandboxPolicyoptionsSetPolicyOptionscancellationTokenCancellationToken
Returns
SetSettingAsync(string, string, SettingValue, CancellationToken)
Upserts one sandbox-scoped setting. The gateway rejects sandbox-scoped deletes.
ValueTask<ConfigUpdateResult> SetSettingAsync(string sandbox, string key, SettingValue value, CancellationToken cancellationToken = default)
Parameters
sandboxstringkeystringvalueSettingValuecancellationTokenCancellationToken
Returns
UpdateAsync(ConfigUpdate, CancellationToken)
Applies an arbitrary ConfigUpdate.
ValueTask<ConfigUpdateResult> UpdateAsync(ConfigUpdate update, CancellationToken cancellationToken = default)
Parameters
updateConfigUpdatecancellationTokenCancellationToken